-1

I have moved from one server provider to another porting all my domains and services. Everything went smoothly at first sight, but I realised now that i am having some problems with dovecot/postfix.

First problem: In the webinterface (Roundcube) I see all old mails with the correct timestamp, when getting them on a mailclient, I always see 5th May 2015 (one day after server has been moved) as date.

Second problem: I seem to not be able to send and receive mails via IMAP. I do not get an error (ill post the logs later in this post), it seems as if the mail has been sent.

Third problem: Logfile is spammed with this errors: warning: 9C42A2408E2: virtual_alias_maps map lookup problem for root@dirty-harry -- message not accepted, try again later (dirty-harry is my servers name!).

I have googled all of these problems, looked over my configurations again but cannot find anything that would solve my problem.

Here are the configurations:

main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/postfix/sslcert/mailserver.crt
smtpd_tls_key_file=/etc/postfix/sslcert/mailserver.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = dirty-harry
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = static.136.90.47.78.clients.your-server.de, dirty-harry, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

disable_vrfy_command = yes

smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth_dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes

proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps

smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql_sender_login_maps.cf

smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
        reject_unknown_sender_domain

smtpd_recipient_restrictions = permit_sasl_authenticated
        permit_mynetworks
        reject_unauth_destination


virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /var/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 112400000
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 104
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

master.cf

smtp      inet  n       -       -       -       -       smtpd
smtps     inet  n       -       -       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix    -    n    n    -    2    pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

dovecot.conf

protocols = imap imaps pop3 pop3s

log_timestamp = "%Y-%m-%d %H:%M:%S "

ssl_cert_file = /etc/postfix/sslcert/mailserver.crt
ssl_key_file = /etc/postfix/sslcert/mailserver.key

protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}

protocol lda {
  postmaster_address = aender.mich@example.org
  auth_socket_path = /var/run/dovecot/auth-master
}

auth default {
  mechanisms = plain login

  passdb sql {
    args = /etc/dovecot/dovecot-mysql.conf
  }

  userdb sql {
    # Path for SQL configuration file, see /etc/dovecot/dovecot-sql.conf for example
    args = /etc/dovecot/dovecot-mysql.conf
  }

  user = root

  socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
      user = vmail
    }
    client {
      path = /var/spool/postfix/private/auth_dovecot
      mode = 0660
      user = postfix
      group = postfix
    }
  }
}

mail.log (Stripped down, these messaged repeat every second)

May 18 06:24:48 dirty-harry postfix/pickup[20017]: warning: B46BD2416D6: message has been queued for 6 days
May 18 06:24:48 dirty-harry postfix/pickup[20017]: B46BD2416D6: uid=0 from=<root>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: B46BD2416D6: message-id=<20150518042448.B46BD2416D6@dirty-harry>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "root@static.136.90.47.78.clients.your-server.de"
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: B46BD2416D6: virtual_alias_maps map lookup problem for root@static.136.90.47.78.clients.your-server.de -- message not accepted, try again later
May 18 06:24:48 dirty-harry postfix/pickup[20017]: warning: B4B262416D6: message has been queued for 2 days
May 18 06:24:48 dirty-harry postfix/pickup[20017]: B4B262416D6: uid=0 from=<root>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: B4B262416D6: message-id=<20150518042448.B4B262416D6@dirty-harry>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "root@static.136.90.47.78.clients.your-server.de"
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: B4B262416D6: virtual_alias_maps map lookup problem for root@static.136.90.47.78.clients.your-server.de -- message not accepted, try again later
May 18 06:24:48 dirty-harry postfix/pickup[20017]: warning: B4F932416D6: message has been queued for 8 days
May 18 06:24:48 dirty-harry postfix/pickup[20017]: B4F932416D6: uid=0 from=<root>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: B4F932416D6: message-id=<20150518042448.B4F932416D6@dirty-harry>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "root@static.136.90.47.78.clients.your-server.de"
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: B4F932416D6: virtual_alias_maps map lookup problem for root@static.136.90.47.78.clients.your-server.de -- message not accepted, try again later
May 18 06:24:48 dirty-harry postfix/pickup[20017]: warning: B53FA2416D6: message has been queued for 3 days
May 18 06:24:48 dirty-harry postfix/pickup[20017]: B53FA2416D6: uid=0 from=<root>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: B53FA2416D6: message-id=<20150518042448.B53FA2416D6@dirty-harry>
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "root@static.136.90.47.78.clients.your-server.de"
May 18 06:24:48 dirty-harry postfix/cleanup[20080]: warning: B53FA2416D6: virtual_alias_maps map lookup problem for root@static.136.90.47.78.clients.your-server.de -- message not accepted, try again later

mail.err and mail.warn are empty.

I would be very greatful if someone could have a look at it! Thank you!

  • What was the exact nature of the porting process? – Konrad Gajewski May 21 '15 at 10:36
  • Can you post /etc/postfix/mysql_virtual_alias_maps.cf file ? Did you migrate the mysql database ? – eltrai May 21 '15 at 10:56
  • Seems like you are not able to log into mysql database or the connections is not defined correctly. – alphamikevictor May 21 '15 at 11:36
  • I am very sorry to answer that late. One issue I have resolved, eltrai was right, there was a problem with the DB connection. I had a typo in the db name. I am now able to send mails, but I cant receive and dont get any error or any logentry, nor a error on the senders site. @Eltrai: I did migrate it, yes. – Nidhoegger May 21 '15 at 11:55
  • 1
    I might have found the issue, i got the wrong DNS mx0 entry. Ill have to wait for DNS update on the remote servers now. Ill report back! – Nidhoegger May 21 '15 at 12:27
1

I have found the solution now with the guys here at Server Fault.

There were two problems going on:

Why wasnt I able to receive Mails?

I migrated the server and updated the DNS A records, but forgot to update the mx records, so the old server was still receiving the mails, where postfix and dovecot were still running. Updating the mx record solved the issue.

Why wasnt I able to send mails and got the log spammed?

I had a typo in the postfix database name. Fixing that resolved that issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.