Greg, Just taking a cursory look....
On Mon, 2013-09-16 at 19:04 -0700, Greg Ryman wrote:
mail_location = maildir:/var/vmail/%d/%n mail_plugins = quota mail_uid = vmail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
Be careful declaring capabilities, personally I dont eg:
protocol sieve { managesieve_max_line_length = 65536 managesieve_logout_format = bytes=%i/%o managesieve_implementation_string = Dovecot Pigeonhole managesieve_max_compile_errors = 5 mail_max_userip_connections = 10 }
seems to work just fine, though 99% of our users, use pop3, not imap
protocols = " imap sieve pop3"
You have defined a lmtp below but are not defining it here in protocols, by looks of postfix master.cf, your not using it so dont want it at all anywaymso if you are not intending on using it, clean it up below
protocol lmtp { mail_plugins = " sieve autocreate quota" }
Youve already declared quota in global plugins
protocol lda { mail_plugins = sieve quota
replace to: mail_plugins = $mail_plugins sieve
}
protocol imap { mail_plugins = quota antispam autocreate quota imap_quota }
mail_plugins = $mail_plugins imap_quota (antispam/autocreate - check up on, I dont use them so wont comment)
root@mail:/etc/dovecot# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf driver = mysql connect = host=localhost dbname=mail user=mail password=mailpassword default_pass_scheme = MD5-CRYPT
not affecting, but a word of advice, if you have a modern system change that to CRYPT (no, it if you have a modern OS it will NOT use the old exploitable, 8 char limited "crypt" but will allow you to use salted sha512 etc)
password_query =
SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home,
'maildir:/var/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid
FROM mailbox WHERE username = '%u' AND active = '1'
Try cleaning that up, for example password_query = SELECT username, password FROM mailbox WHERE username='%u' and active='1' (it doesnt need all that other stuff, it gets it from user query)
user_query looks ok (see below), but you can drop off the "and active" stuff
user_query =
SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail,
150 AS uid, 8 AS gid, concat('dirsize:storage=', quota) AS quota
FROM mailbox WHERE username = '%u' AND active = '1'
concat('*:storage=', quota,'M') if you dont specify a type, I might be wrong, but I think it would likely default to bytes, which might be ok if thats how you've setup your database anyway.
# Integration with Dovecot - hand mail over to it for local delivery, and # run the process under the vmail user and mail group. dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/dovecot-lda -d $(recipient)
dovecot-lda -f ${sender} -e -d ${user}@${nexthop} would be better, can allow you to use recip delim as well.