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 HoferI 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
------------------------------------------------------------
Hi again, Thank you for your first hints. I have now set up a dedicated test instance of postfix and dovecot to be able to recreate the problems in detail. Even after using your inputs, they do not seem to work with my setup I already mentioned above. I get errors like postfix/lmtp[10994]: C2DF4C000DF: to=<user1 at mydomain.org>, relay=mail.mydomain.org[private/dovecot-lmtp], delay=0.1, delays=0.05/0/0/0.04, dsn=5.1.1, status=bounced (host mail.mydomain.org[private/dovecot-lmtp] said: 550 5.1.1 <user1 at mydomain.org> User doesn't exist: user1 at mydomain.org (in reply to RCPT TO command)) As stated before, my setup is as follows:> 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.I do not know how to strip the domain when the username is handed over from postfix to dovecot, and what would be the sane solution. I hope, you can give me a hint to that. Thank you, again, and greetings, Matthias Hofer
>> So, is there a way for dovecot-{lda/lmtpd} to accept "user1 at mydomain.org" but checks for "user1" in the >> user >> DB? > > Try username_format=%n so dovecot uses the username only: > http://wiki2.dovecot.org/Variables > > passdb { > driver = passwd-file > args = scheme=PLAIN username_format=%n /etc/dovecot/mypasswd.file > }Great! I did not think about that, but this solved this issue :D Thank you a lot. And I was now able to solve also my further issues. So I am prepared to try again to switch :) Have great day! Matthias Hofer