Postfix Configuration Woes
Wednesday, April 12. 2006
At home I have a simple setup running: Fetchmail fetches emails from my POP3 accounts hosted at my ISP, forwards them to a localuser using the local transport of postfix, which in turn delivers them to a mail dir in my home directory that is served via IMAP using courier. A simple setup that was configured within 30 minutes.
But then I intended to do the same for the server in my dads home. Easy, I thought, since I already did that before and expected to perform this in less than 30 minutes. At first it looked like I had no problems, but then fetchmail fetched the mails, but it didn't forward them to the local mailbox. In addition I wasn't able to send emails using the local transport to my dads mailbox and in
Well, my first thought was that I someone missconfigured the domains for local delivery or that postfix somehow messed up the domain names, so that it thought that mails to my internal domain should be routed externally. After hours of googling and adjusting main.cf I didn't manage a proper setup. Then after looking closer at the log files I discovered that at first postfix performs a local transport and then forwards the mail to my ISPs SMTP gateway... Huh??? OK, finally I was on the right track... Looking into /etc/aliases for a misconfigured alias... Nothing. But finally after additional hours I remembered... newaliases. Damn it! /etc/aliases was clean, put /etc/aliases.db was not and this contained an alias for the local user to an external address. So, after running newaliases, the problem was gone. So people, what do we learn from that? The postfix admin learns to always recreated the DBs using newaliases and postmap before going into trouble shooting. The software developer learns that it's never a good idea to have configuration stored in two places and that it's even worse to have a media break: text files on one side, binary files on the other - unless you have a very good reason and I hope the postfix developers had one.
/var/log/mail I saw errors like"421 dns lookup failed for sender domain indicating that postfix contacts the SMTP Gateway of my ISP for delivering local mails.
Do you have any clue what could have been the problem here?
Well, my first thought was that I someone missconfigured the domains for local delivery or that postfix somehow messed up the domain names, so that it thought that mails to my internal domain should be routed externally. After hours of googling and adjusting main.cf I didn't manage a proper setup. Then after looking closer at the log files I discovered that at first postfix performs a local transport and then forwards the mail to my ISPs SMTP gateway... Huh??? OK, finally I was on the right track... Looking into /etc/aliases for a misconfigured alias... Nothing. But finally after additional hours I remembered... newaliases. Damn it! /etc/aliases was clean, put /etc/aliases.db was not and this contained an alias for the local user to an external address. So, after running newaliases, the problem was gone. So people, what do we learn from that? The postfix admin learns to always recreated the DBs using newaliases and postmap before going into trouble shooting. The software developer learns that it's never a good idea to have configuration stored in two places and that it's even worse to have a media break: text files on one side, binary files on the other - unless you have a very good reason and I hope the postfix developers had one.
Trackbacks
Trackback specific URI for this entry
No Trackbacks



Comments