[Dovecot] LMTP Setup/Design Help Request
Hi altogether,
I am switching from dbmail 2.2 to dovecot 2.1.7, and I was able to do a successful transition of IMAP. But I had a very hard time with receiving mail, and in the end -- after loads of reading and debugging -- I broke down and failed. This is why I am asking you for your kind help.
I only have virtual users and have set
mail_uid = dovemail mail_gid = dovemail
For authentication, I simply use (for now) a flat file:
passdb { driver = passwd-file args = scheme=PLAIN username_format=%u /etc/dovecot/mypasswd.file }
# cat /etc/dovecot/mypasswd.file user1:{PLAIN}userpw1 user2:{PLAIN}userpw2 user3:{PLAIN}userpw3
And everything works fine with IMAP. I am completely domain-agnostic here. But I was not able to use this fine setup to receive mails with my postfix. I tried about 13 different configurations, some with considerable changes dovecot-config, the passwd-file or postfix, but I could not find a single variant working.
In this situation, I would be very happy if somebody could give me a hint, which would be the prudent way to configure dovecot, LDA/LMTP and postfix based on the setup above.
Thank you very much in advance, and have a great time,
Matthias Hofer
On 08-04-2013 22:39, Matthias Hofer wrote:
Hi altogether,
I am switching from dbmail 2.2 to dovecot 2.1.7, and I was able to do a successful transition of IMAP. But I had a very hard time with receiving mail, and in the end -- after loads of reading and debugging -- I broke down and failed. This is why I am asking you for your kind help.
I only have virtual users and have set
mail_uid = dovemail mail_gid = dovemail
For authentication, I simply use (for now) a flat file:
passdb { driver = passwd-file args = scheme=PLAIN username_format=%u /etc/dovecot/mypasswd.file }
# cat /etc/dovecot/mypasswd.file user1:{PLAIN}userpw1 user2:{PLAIN}userpw2 user3:{PLAIN}userpw3
And everything works fine with IMAP. I am completely domain-agnostic here. But I was not able to use this fine setup to receive mails with my postfix. I tried about 13 different configurations, some with considerable changes dovecot-config, the passwd-file or postfix, but I could not find a single variant working.
In this situation, I would be very happy if somebody could give me a hint, which would be the prudent way to configure dovecot, LDA/LMTP and postfix based on the setup above.
Thank you very much in advance, and have a great time,
Matthias Hofer
I suppose your postfix is in working state. Note that you do not need dovecot to deliver mail with postfix. But it is a good idea. To deliver using dovecot-lda my postfix main.cf contains
mail_spool_directory = /Mail/ mailbox_command = /usr/local/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"
(forgot to send to list)
Hi Matthias,
Here a litte bit of code snipplets how I configured dovecot authentication via relay domains. No user-handling in postfix exept relay domains and virtual alias map, user-handling over dovecot SASL/LMTP.
This is no complete configuration, no warranty that this works for you!
Greetings, Jan
# /etc/dovecot/conf.d/10-master.conf
#
service auth { unix_listener auth-userdb { mode = 0600 user = dovemail group = dovemail }
unix_listener /var/spool/postfix/private/auth { mode = 0660 # Assuming the default Postfix user and group user = postfix group = postfix } ### Also possible: # inet_listener { # port = 12345 # } }
service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { mode = 0660 user = postfix group = postfix } ### Also possible: # inet_listener lmtp { # address = 192.168.0.123 127.0.0.1 ::1 # port = 24 # } }
# /etc/postfix/lmtp_domains
yourdomain.invalid lmtp:unix:private/dovecot-lmtp
# /etc/postfix/main.cf
transport_maps = btree:/etc/postfix/lmtp_domains,[...] relay_domains = btree:/etc/postfix/lmtp_domains,[...]
unverified_recipient_reject_code = 577
smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth
smtpd_recipient_restrictions = # no dirty mails reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, # Authorized mailers permit_sasl_authenticated, permit_mynetworks, # Policyd-Weight check_policy_service inet:127.0.0.1:12525, # Dynamic check of relay-recipients reject_unverified_recipient, # permit_mx_backup, reject_unauth_destination, permit
participants (3)
-
Andreas K.
-
Jan Phillip Greimann
-
Matthias Hofer