dovecot.conf
auth default { socket listen { master { # Master socket provides access to userdb information. It's typically # used to give Dovecot's local delivery agent access to userdb so it # can find mailbox locations. path = /var/run/dovecot/auth-master mode = 0600 # Default user/group is the one who started dovecot-auth (root) user = vmail group = mail } } }
master.cf
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}
mail.cf
dovecot_destination_concurrency_limit = 1 dovecot_destination_recipient_limit = 1 virtual_transport = dovecot
dovecot-sql.conf
user_query = SELECT concat(/home/mbox/', maildir) AS home, 'maildir:/home/mbox/%u' AS mail , 150 AS uid, 150 AS gid FROM mailbox WHERE username = '%u' AND active = '1' password_query = SELECT username AS user, password, concat('/home/mbox/', maildir) AS userdb_home, 'maildir:/home/mbox/%u' AS userdb_mail, 150 AS userdb_uid, 150 AS userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
ref.
http://wiki.dovecot.org/LDA/Postfix
Q:
Dec 12 02:28:15 mail dovecot: deliver(johnpupu@example.tw): Fatal: setgid(125(postfix)) failed with euid=143(dovecot), gid=6(mail), egid=6(mail): Operation not permitted
A:
像這樣的uid錯誤就是,dovecot-sql.conf 這個 uid 和master.cf中設的user id 沒不一樣造成的..
Q:
Dec 12 16:36:07 mail dovecot: deliver(johnpupu@example.tw): mail_location: Ambiguous mail location setting, don’t know what to do with it: /home/mbox/johnpupu@example.tw (try prefixing it with mbox: or maildir:)
A:
請乖乖的在dovecot-sql.conf把
maildir: 加在你的/home/mbox/%u 前面
就好了…
Q:
Relative home directory paths not supported (user johnpupu@example.tw): maildir:/home/mbox/johnpupu@example.tw
A:
這個問題就是user_query 的home 設錯了..
請設成
SELECT concat(‘/home/mbox/’, maildir) AS home,
就好了….
把mail_debug=yes 打開會看的滿清楚的