Postfix 2.7.0 ignoring main.cf params?
I've recently upgraded my home server from fc5 to fc13 which means installing the latest version of postfix (identified as 2.7.0 in the maillog). It is used to send mail from cron jobs and logwatch to a local mailbox (aliased) and my googlemail account so I can monitor when away from home.
I finally got it working, but had to pull a trick that I feel bad about--it feels very hacky, and does not survive a reboot. The problem is no matter what I do, this version of Postfix ignores the settings for "masquerade_domains", "myhostname" and "mydomain" in main.cf, using instead getting the domain name from whatever 127.0.0.1 (or :::1) is set to in /etc/hosts!! To send mail to Internet locations, the "from" needs to be a valid domain with an MX record. In an earlier version of Postfix (2.6.x) I just fudged this to a domain I own (that is parked) in main.cf using "masquerade_domains". Now I have to insert it in /etc/hosts instead of "localhost", eg: Code:
127.0.0.1 hostname.real.domain hostname As I said, it works, but I don't like my solution and /etc/hosts gets rewritten to ":::1 localhost6.localdomain6" when the system is rebooted, meaning I have to edit it to get Postfix working again as sendmail rejects "localhost6.localdomain6" as not found. Suggestions most welcome. |
Could you please provide a 'postconf -n'.. feel free to sanitise
cheers |
Quote:
Code:
alias_database = hash:/etc/aliases |
Can you try making /etc/hosts look like this ?
Code:
127.0.0.1 localhost.localdomain localhost cheers |
Quote:
Code:
192.168.1.x name name.<my domain> |
Another possibility is that something went screwy because you upgraded, remember that upgrading is not recommended. If all else fails it may be worth a fresh build ...
|
Quote:
All that said, I've just tried editing the hosts file to "ip fully-qualified alias" format, and rebooted. Results no different--postfix mail still fails be delivered following boot. The previous 127.0.0.1 entry in /etc/hosts (which used a hostname.domain with a MX record) was replaced with the following 2 lines (effectively 2 aliases): Code:
127.0.0.1 kali localhost.localdomain localhost After changing the 127.0.0.1 entry to the the valid fully qualified host.domain, the same mailx test succeeded. Didn't even have to restart postfix, so it must reread /etc/hosts every time! Code:
Sep 1 17:18:14 kali postfix/master[1253]: daemon started -- version 2.7.0, configuration /etc/postfix |
Seems like your system is using dhcp instead of static addressing and something may be modifying /etc/hosts, can you confirm the contents of /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 ?
|
Some progress, I found that the "kali" which was being inserted as the canonical host name in the localhost address (ipv4 and 6) during boot was being read from the file /etc/sysconfig/network.
The doco says the HOSTNAME value should be canonical, so I changed this and the full host name now gets inserted into the 127.0.0.1 and ::1 lines of the host file during reboot. That sort of fixed my postfix problem of having to make changes after a reboot, though why the main.cf params myhostname, mydomain, and masquerade_domain are all being ignored is still most perplexing. The next point of investigation would be the 2.7.0 source, so I'll probably give up at this point. The other odd thing is in all Fedora distros I've used since 3, I don't think I've ever seen /etc/hosts unilaterally modified at boot time before F13 (though I skipped 10,11,12 :D ) |
Quote:
Code:
DEVICE=eth0 |
The 3 directives you're having problems with are all networking related, I think if you switch eth0 to static and fix your /etc/hosts file the problems will go away.. try this:
/etc/sysconfig/network-scripts/ifcfg-eth0 Code:
DEVICE=eth0 Code:
127.0.0.1 localhost.localdomain localhost Code:
domain <your real domain> Code:
NETWORKING=yes cheers |
Quote:
The 127.0.0.1 and ::1 lines are still being set on boot using the HOSTNAME from /etc/sysconf/network: Code:
127.0.0.1 kali.xyzzy.com kali localhost.localdomain localhost So progress, sort of. I agree with the IP statically set, you'd not expect hosts and resolv.conf to get rewritten at boot, but they do! I could chmod +s but that's too tacky for words. However, as is, they are rewritten in a "good" state so postfix works and firefox won't have name RARP delays waiting for the modem DNS to time out. |
To revive an earlier question in this thread, "The problem is no matter what I do, this version of Postfix ignores the settings for "masquerade_domains", "myhostname" and "mydomain" in main.cf, using instead getting the domain name from whatever 127.0.0.1 (or :::1) is set to in /etc/hosts!!"
I'm having this same issue with RHEL 5.5 and Postfix 2.3.3. Is there a way to tell Postfix to ignore the Linux hostname and use what I tell it in the main.cf for the envelope sender (the from address)? I don't want to change the hostname of the server. I just need to email backup summaries using the "mail" command, but they get rejected due to a non-resolvable domain name (i.e. root@domain.local). Here is the rejection I get: 550 5.1.0 domain.local does not exist (in reply to MAIL FROM command) Thanks |
All times are GMT -5. The time now is 09:30 PM. |