1

I followed this guide one to set up email using postfix, dovecot, and mysql using vhosts. When I send an email to the mailserver it gets bounced back and I get the following message in /var/log/mail.info:

Nov 27 14:39:21 myserver postfix/lmtp[21637]: B999E1E86A: to=<1@myserver.example.com>, orig_to=, relay=example.com[private/dovecot-lmtp], delay=0.14, delays=0.12/0/0.01/0.01, dsn=5.1.1, status=bounced (host example.com[private/dovecot-lmtp] said: 550 5.1.1 <1@myserver.example.com> User doesn't exist: 1@myserver.example.com (in reply to RCPT TO command))

For some reason I see that it is forwarding fred@example.com to 1@myserver.example.com.

I'm not an expert here as to how it is supposed to work, but I think there are two problems with this.

  1. The username is being replaced by the number 1
  2. The hostname is added to the front of the domain name (not sure if this is by design or if it's an error)

What is causing my problem and what can I do to fix it?

Full error

Based on comment, here is my full error:

Nov 28 17:55:56 myserver dovecot: master: Warning: Killed with signal 15 (by pid=21680 uid=0 code=kill)
Nov 28 17:55:56 myserver dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 28 17:55:56 myserver dovecot: master: Dovecot v2.2.27 (c0f36b0) starting up for imap, pop3, lmtp (core dumps disabled)
Nov 28 17:56:12 myserver postfix/smtpd[21693]: connect from sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203]
Nov 28 17:56:12 myserver postfix/smtpd[21693]: B3B801EB8C: client=sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203]
Nov 28 17:56:12 myserver postfix/cleanup[21697]: B3B801EB8C: message-id=<703991399.578697.1543449370484@mail.yahoo.com>
Nov 28 17:56:12 myserver postfix/qmgr[8196]: B3B801EB8C: from=<myemailaddress@yahoo.com>, size=3187, nrcpt=1 (queue active)
Nov 28 17:56:12 myserver dovecot: lmtp(21699): Connect from local
Nov 28 17:56:12 myserver postfix/lmtp[21698]: B3B801EB8C: to=<1@myserver.example.com>, orig_to=<fred@example.com>, relay=example.com[private/dovecot-lmtp], delay=0.16, delays=0.12/0.01/0.01/0.02, dsn=5.1.1, status=bounced (host example.com[private/dovecot-lmtp] said: 550 5.1.1 <1@myserver.example.com> User doesn't exist: 1@myserver.example.com (in reply to RCPT TO command))
Nov 28 17:56:12 myserver dovecot: lmtp(21699): Disconnect from local: Successful quit
Nov 28 17:56:12 myserver postfix/cleanup[21697]: CF9BA1EBA8: message-id=<20181128235612.CF9BA1EBA8@example.com>
Nov 28 17:56:12 myserver postfix/qmgr[8196]: CF9BA1EBA8: from=<>, size=5485, nrcpt=1 (queue active)
Nov 28 17:56:12 myserver postfix/bounce[21703]: B3B801EB8C: sender non-delivery notification: CF9BA1EBA8
Nov 28 17:56:12 myserver postfix/qmgr[8196]: B3B801EB8C: removed
Nov 28 17:56:12 myserver postfix/smtpd[21693]: disconnect from sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Nov 28 17:56:14 myserver postfix/smtp[21705]: CF9BA1EBA8: to=<myemailaddress@yahoo.com>, relay=mta5.am0.yahoodns.net[67.195.229.58]:25, delay=1.6, delays=0/0.01/0.3/1.3, dsn=2.0.0, status=sent (250 ok dirdel)
Nov 28 17:56:14 myserver postfix/qmgr[8196]: CF9BA1EBA8: removed
  • Check your mail server logs. There are more log entries for this message. – Michael Hampton Nov 29 '18 at 0:28
  • @MichaelHampton I have added my full logs above – kojow7 Nov 29 '18 at 1:41
  • How is this related to dovecot? I only see postfix here. Please show your postfix configuration and - as some address translation is the reason - all your referenced maps. – sebix Dec 1 '18 at 10:56
0

The problem was actually in /etc/postfix/mysql-virtual-email2email.cf. The file should have looked like this:

user = mailuser
password = mailuserpass
hosts = 127.0.0.1
dbname = mailserver
query = SELECT email FROM virtual_users WHERE email='%s'

However, the last line in my file looked like this:

query = SELECT 1 FROM virtual_users WHERE email='%s'

This was an error in copying either the mysql-virtual-mailbox-domains.cf or the mysql-virtual-mailbox-maps.cf files as they both have a SELECT 1 FROM ... query.

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.