1

I've got a postfix virtual setup with MySQL and dovecot. Everything is working fine, the only problem currently is that mails to root are not delivered locally as it should be. Instead, postfix expands mails sent to "root" to "root@example.com". As there's no virtual mailbox for root@example.com, they can't be delivered:

Nov 17 03:20:26 xxx postfix/qmgr[16914]: E49903AB4045: from=<root@example.com>, size=783, nrcpt=1 (queue active)
Nov 17 03:20:26 xxx postfix/pipe[17901]: E49903AB4045: to=<root@example.com>, orig_to=<root>, relay=dovecot, delay=626, delays=625/0.01/0/0.17, dsn=4.1.1, status=SOFTBOUNCE (user unknown)

To get this fixed, I've tried what is described at

http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local

and added a root alias to my sql virtual alias maps:

| address       | goto             | domain        | created             | modified            | active |
+---------------+------------------+---------------+---------------------+---------------------+--------+
| root          | root@localhost   | localhost     | 2013-11-18 11:20:00 | 2013-11-18 11:20:00 |      1 |

At least it has changed a bit now, but it's still not working, as it seems the domainname is expanded to root@localhost.example.com now:

Nov 18 11:36:39 xxx postfix/qmgr[16914]: 0741763B6001: from=<root@example.com>, size=316, nrcpt=1 (queue active)
Nov 18 11:36:39 xxx postfix/smtp[30046]: 0741763B6001: to=<root@localhost.example.com>, orig_to=<root>, relay=none, delay=11, delays=11/0/0.52/0, dsn=4.4.6, status=SOFTBOUNCE (mail for localhost.example.com loops back to myself)

From my main.cf:

mydestination = localhost.localdomain, localhost
mydomain = example.com
myhostname = mail.example.com
myorigin = $mydomain
smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient,permit_sasl_authenticated,reject_unauth_destination,reject_rbl_client zen.spamhaus.org,pcre:/etc/postfix/dspam_filter_access
virtual_alias_maps = mysql:/etc/postfix/sql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/sql_virtual_domain_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql_virtual_mailbox_maps.cf

As far as I understand, Postfix should check the sql_virtual_alias_maps, forward mails to root to root@localhost, and try to deliver this locally.

What am I doing wrong and how do I get postfix to deliver these root-mails locally?

etagenklo
  • 5,694
  • 1
  • 25
  • 31

2 Answers2

2

OK, I fixed it. The problem was the parameter

append_dot_mydomain

which is set to yes per default. After setting

append_dot_mydomain = no

, in main.cf, it's working as it should.

etagenklo
  • 5,694
  • 1
  • 25
  • 31
0

It looks like its trying to forward to it self, do you by any chance define that the "goto" field in your db, is the forwarding address? if so, try to delete that forward and see if that helps

  • The forward is not the problem. As I said, without it, the recipient address gets expanded to `root@example.com`, which is not what I want, because there's no such virtual mailbox. – etagenklo Nov 19 '13 at 09:15