Install dovecot

Install :

# apt-get install dovecot-postfix

Create SSL/TLS certificate for secure connections :

# cd  /etc/ssl/

# mkdir -p dovecot

# cd /etc/ssl/dovecot/

# openssl req -new -x509 -nodes -out cert.pem -keyout key.pem -days 365

Generating a 1024 bit RSA private key
………………..++++++
………++++++
writing new private key to ‘key.pem’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:ID
State or Province Name (full name) [Some-State]:SumSel
Locality Name (eg, city) []:Palembang
Organization Name (eg, company) [Internet Widgits Pty Ltd]:DigitalFusi
Organizational Unit Name (eg, section) []:DigitalFusi
Common Name (eg, YOUR name) []:DigitalFusi
Email Address []:alamster@gmail.com

#

(Edit BOLD data with your own)

Edit /etc/dovecot/dovecot.conf  file:

Find and edit the RED text.

protocols = imap imaps pop3 pop3s
disable_plaintext_auth = no
ssl_disable = no
ssl_cert_file = /etc/ssl/dovecot/cert.pem
ssl_key_file = /etc/ssl/dovecot/key.pem
login_greeting = DigitalFusi Mail Server Ready.
mail_location = maildir:/usr/local/virtual/%d/%n
first_valid_uid = 109
last_valid_uid = 109
first_valid_gid = 117
last_valid_gid = 117
protocol imap {
mail_plugins = quota imap_quota
}
protocol pop3 {
mail_plugins = quota
}
protocol lda {
postmaster_address = postmaster@digitalfusi.com
}
auth default {
mechanisms = plain login
# passdb pam {

# args = session=yes dovecot

# }
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
# userdb passwd {
# }
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
socket listen {
client {
path = /var/spool/postfix/private/dovecot-auth
mode = 0660
user = postfix
group = postfix
}
}
}

Tips :

Find uid and guid of postfix:

# cat  /etc/passwd | grep postfix

postfix:x:109:117::/var/spool/postfix:/bin/false

Turn On auth for debugging purpose.

Uncomment these lines :

auth_verbose = yes

auth_debug = yes

auth_debug_passwords = yes

Edit /etc/dovecot/dovecot-sql.conf file:
You can either copy this file or edit your own file to match.

# echo ‘ ‘ > /etc/dovecot/dovecot-sql.conf

driver = mysql
connect = host=localhost dbname=postfix user=postfix password=postfixjaunty
default_pass_scheme = MD5
password_query = SELECT password FROM mailbox WHERE username = ‘%u’
user_query = SELECT maildir, 109 AS uid, 117 AS gid, CONCAT(‘maildir:storage=’, FLOOR( quota / 1024 ) ) AS quota FROM mailbox WHERE username = ‘%u’ AND active = ‘1

Restart dovecot :

# /etc/init.d/dovecot restart

Remember : 109 and 117 depend on previous step.

  • Pages

  • Download Ubuntu

  • Download Fedora

  • Tags

    atmail open on ubuntu server change ip address check connection clamav continue install dns dovecot fuzzyocr install jaunty maia mailguard mysql New Virtual Disk Wizard nginx pear php postfix postfixadmin preparation roundcube mail Setting Virtual Machine spamassassin squirrelmail
  • Categories

    • Translate to: