Christian Benke
2013-Mar-17 00:20 UTC
[Dovecot] Dovecot as LDA with Postfix and virtual users
Hello! I've been trying to configure Dovecot to work as LDA for file-based virtual users with Postfix. Some part in the configuration seems to miss though, as mails are received by Postfix, but instead of giving it to Dovecot for delivery, it delivers the mails itself. Postfix drops the mail in /var/mail/<user>/mbox, if Dovecot would be called, it should deliver it to /var/vmail/<domain>/<user>/Maildir. I've made sure to add the dovecot-service to postfix/master.cf according to http://wiki2.dovecot.org/LDA/Postfix and tried all kinds of settings and did quadruple checks for errors. I'm using Debian 6.0 with Dovecot 2.1.7(From backports) and Postfix 2.7.1 I've been trying to figure out what's missing for a few hours now and have to give up for today. I hope someone can help me with a hint what's missing or wrong :-/ Here's an excerpt from my mail.log, my postconf -n and dovecot -n: Mar 17 00:02:46 poab postfix/smtpd[15333]: connect from mail-wg0-f47.google.com[74.125.82.47] Mar 17 00:02:46 poab postfix/smtpd[15333]: setting up TLS connection from mail-wg0-f47.google.com[74.125.82.47] Mar 17 00:02:46 poab postfix/smtpd[15333]: Anonymous TLS connection established from mail-wg0-f47.google.com[74.125.82.47]: TLSv1 with cipher RC4-SHA (128/128 bits) Mar 17 00:02:46 poab dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth Mar 17 00:02:46 poab dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so Mar 17 00:02:46 poab dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_pgsql.so Mar 17 00:02:46 poab dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_sqlite.so Mar 17 00:02:46 poab dovecot: auth: Debug: passwd-file /etc/dovecot/users: Read 1 users in 0 secs Mar 17 00:02:46 poab dovecot: auth: Debug: auth client connected (pid=0) Mar 17 00:02:46 poab postfix/smtpd[15333]: 66AD04E23EE: client=mail-wg0-f47.google.com[74.125.82.47] Mar 17 00:02:46 poab postfix/cleanup[15340]: 66AD04E23EE: message-id=<CAAMQ8bSEetcSYKKHKhbAqWxJwRewaPB_wA2DK8J4N-q5Y+dG7w at mail.gmail.com> Mar 17 00:02:46 poab postfix/qmgr[14844]: 66AD04E23EE: from=<benkkk AT wheemail.com>, size=1611, nrcpt=1 (queue active) Mar 17 00:02:46 poab postfix/smtpd[15333]: disconnect from mail-wg0-f47.google.com[74.125.82.47] Mar 17 00:02:46 poab postfix/local[15341]: 66AD04E23EE: to=<benkkk AT example.com>, relay=local, delay=0.35, delays=0.3/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox) Mar 17 00:02:46 poab postfix/qmgr[14844]: 66AD04E23EE: removed # postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix debug_peer_level = 3 inet_interfaces = all inet_protocols = all mailbox_size_limit = 5120000000 myhostname = example.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_tls_note_starttls_offer = yes smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_helo_required = yes smtpd_helo_restrictions = reject_invalid_helo_hostname smtpd_recipient_restrictions = reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_reject_unlisted_recipient = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_tls_security_options = $smtpd_sasl_security_options smtpd_sasl_type = dovecot smtpd_sender_login_maps = hash:/etc/postfix/sender_login_maps smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem smtpd_tls_key_file = /etc/ssl/private/postfix.key smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_tls_session_cache_timeout = 3600s smtpd_use_tls = yes tls_random_source = dev:/dev/urandom virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps virtual_transport = dovecot # dovecot -n # 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-5-openvz-amd64 x86_64 Debian 6.0.7 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login auth_socket_path = /var/run/dovecot/auth-master auth_verbose = yes auth_verbose_passwords = sha1 first_valid_gid = 5000 first_valid_uid = 5000 last_valid_gid = 5000 last_valid_uid = 5000 lda_mailbox_autocreate = yes log_timestamp = "%Y-%m-%d %H:%M:%S " mail_debug = yes mail_gid = 5000 mail_home = /var/vmail/%d/%n mail_location = maildir:~/Maildir mail_privileged_group = vmail mail_uid = 5000 namespace inbox { inbox = yes location mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix } passdb { args = scheme=SHA1 /etc/dovecot/users driver = passwd-file } plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = " imap" service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } } service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 0 } } ssl_cert = </etc/ssl/certs/postfix.pem ssl_key = </etc/ssl/private/postfix.key userdb { args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes driver = static } verbose_ssl = yes protocol lda { mail_plugins } Thanks & good night, Christian -- Central Asia by bike, starting May 2013 - http://poab.org
On Sun, Mar 17, 2013 at 01:20:55AM +0100, Christian Benke wrote:> I've been trying to configure Dovecot to work as LDA for file-based > virtual users with Postfix. > > Some part in the configuration seems to miss though, as mails are > received by Postfix, but instead of giving it to Dovecot for > delivery, it delivers the mails itself.Perhaps surprisingly, this is a Postfix issue, not a Dovecot one.> Postfix drops the mail in /var/mail/<user>/mbox, if Dovecot would be > called, it should deliver it to /var/vmail/<domain>/<user>/Maildir. > > I've made sure to add the dovecot-service to postfix/master.cf > according to http://wiki2.dovecot.org/LDA/Postfix and tried all kinds > of settings and did quadruple checks for errors. > > I'm using Debian 6.0 with Dovecot 2.1.7(From backports) and Postfix 2.7.1 > > I've been trying to figure out what's missing for a few hours now and > have to give up for today. I hope someone can help me with a hint > what's missing or wrong :-/ > > Here's an excerpt from my mail.log, my postconf -n and dovecot -n: >[snip]> Mar 17 00:02:46 poab postfix/local[15341]: 66AD04E23EE: to=<benkkk AT > example.com>, relay=local, delay=0.35, delays=0.3/0.01/0/0.04, > dsn=2.0.0, status=sent (delivered to mailbox)This is postfix/local, which means it is not being routed to your virtual_transport. It means example.com is in mydestination.> Mar 17 00:02:46 poab postfix/qmgr[14844]: 66AD04E23EE: removed > > # postconf -n > alias_database = hash:/etc/aliases > alias_maps = hash:/etc/aliases > append_dot_mydomain = no > biff = no > broken_sasl_auth_clients = yes > config_directory = /etc/postfix > debug_peer_level = 3 > inet_interfaces = all > inet_protocols = all > mailbox_size_limit = 5120000000 > myhostname = example.com... You did not even set mydestination, thus you get the default. You really should review the Postfix Basic Configuration README: http://www.postfix.org/BASIC_CONFIGURATION_README.html Perhaps you'd be better off without the virtual mailboxes anyway? [snip]> Central Asia by bike, starting May 2013 - http://poab.orgWow, a great adventure, good luck! -- http://rob0.nodns4.us/ -- system administration and consulting Offlist GMX mail is seen only if "/dev/rob0" is in the Subject: