Quick and dirty web post for dovecot
So here we go with dovevot for checking that spiffy new mail server.
Since I have postfix encrypting the passwords so I dont have to worry about admins being trustworthy that presented a fun issue or two and here is how i got around them.
I did the default install of dovecot
yum install dovecot
and then edited the funk out of my /etc/dovecot.conf file
dont forget to make a backup of it before you edit it
#where to run it
base_dir = /var/run/dovecot/
# Just the basics, no s protocols with it
protocols = imap pop3
#listen on all addresses and standard ports
listen = [::]
#i wanted to seperate it from my maillog so that i could get a better reading of whats going on
log_path = /var/log/dovecot
log_timestamp = "%Y-%m-%d %H:%M:S "
# what directory should it "login to"
login_dir = /var/run/dovecot/login
# most people have this as /var/vmail/%d/%n
mail_location = maildir:/home/vmail/%d/%n/Maildir
# !! Turn this off before going to production!!
mail_debug = yes
# this is my postfix user ID and group ID
first_valid_uid = 89
last_valid_uid = 89
# how many connections at a time
max_mail_processes = 50
#specify the protocols and anything special about them
protocol imap {
}
protocol pop3 {
}
protocol lda {
postmaster_address = postmaster@yourdomain.com
hostname = mail.yourdomain.com
}
#this is to enforce standard user names
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
# Again turn these off before going to production
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = no
#how many worker processes per login (If needed)
auth_worker_max_count = 20
# what type of authorization
auth default {
mechanisms = plain login digest-md5 cram-md5
passdb sql {
#the location to your user and password information
args = /etc/dovecot-mysql.conf
}
userdb sql {
#the location to your database connection
args = /etc/dovecot-mysql.conf
}
#Tried a few things for this part, and this one finally worked for me
socket listen {
client {
path = /var/run/dovecot/auth-client
mode = 0660
user = postfix
group = postfix
}
}
}
# Any special plugins you want to load up
plugin {
}
That is simple enough, but it took a while to get everything dialed in, and now the killer, dovecot-mysql.conf. It was a pain getting this information straight so here it is
#NOTHING i found mentioned the Driver = anwhere .. it was a leap of faith to get it
driver = mysql
# if you do not have encrypted password you do not need this part
default_pass_scheme = CRYPT
# YOUR database connection string
connect = host=localhost dbname=postfix user=postfixuser password=mySuperSecretPassword
#get the password for the user name
password_query = SELECT password FROM mailbox WHERE username = '%u'
# change to reflect your mail directories, your postfix user/group number and quotas
user_query = SELECT '/home/vmail/%d/%nMaildir' as home, 'maildir:/home/vmail/%d/%n/Maildir' as mail, 89 AS uid, 89 AS gid, concat('dirsize:storage=',quota) AS quota FROM mailbox WHERE username ='%u' AND active ='1'