Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
I can't find anyone on the web who seems to be having this problem. Postfix is definitely reading main.cf as it is obviously picking up other setings such as debug_peer_level and proxy_interfaces.
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.
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 ...
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 ...
Sorry, bad wording. The F13 was a clean install from DVD, followed by painstaking rebuild of stuff like users, perl libraries, yum installs (postfix etc) and diffs of new config files with old versions to modify the new ones (I didn't replace the new with old).
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
::1 kali localhost6.localdomain6 localhost6
Mail stopped being delivered due to postfix picking localhost.localdomain as the "from" domain (despite the main.cf settings, and why not the "kali" string which was in the canonical position?). The maillog extract (edited to change actual names and domains) shows what happened when mailx was used to send 1 mail to two addresses ("root,ron@valid.org").
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
Sep 1 17:23:57 kali sendmail[2060]: o817Nkpw002060: from=me, size=238, class=0, nrcpts=2, msgid=<201009010723.o817Nkpw002060@localhost.localdomain>, relay=me@localhost
Sep 1 17:23:58 kali postfix/smtpd[2062]: connect from kali[127.0.0.1]
Sep 1 17:23:58 kali postfix/smtpd[2062]: 1B51280162: client=kali[127.0.0.1]
Sep 1 17:23:58 kali postfix/cleanup[2065]: 1B51280162: message-id=<201009010723.o817Nkpw002060@localhost.localdomain>
Sep 1 17:23:58 kali postfix/qmgr[1262]: 1B51280162: from=<me@localhost.localdomain>, size=689, nrcpt=2 (queue active)
Sep 1 17:23:58 kali sendmail[2060]: o817Nkpw002060: to=root,ron@valid.org, ctladdr=chernich (500/500), delay=00:00:12, xdelay=00:00:01, mailer=relay, pri=60238, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 1B51280162)
Sep 1 17:23:58 kali postfix/smtpd[2062]: disconnect from kali[127.0.0.1]
Sep 1 17:24:07 kali postfix/smtp[2066]: 1B51280162: to=<root@localhost.localdomain>, relay=none, delay=8.9, delays=0.11/0.04/8.8/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localhost.localdomain type=AAAA: Host not found)
Sep 1 17:24:11 kali postfix/smtp[2067]: 1B51280162: to=<ron@valid.org>, relay=valid.org[75.126.89.28]:25, delay=14, delays=0.11/0.04/13/0.28, dsn=5.0.0, status=bounced (host valid.org[75.126.89.28] said: 550-Verification failed for <me@localhost.localdomain> 550-Unrouteable address 550 Sender verify failed (in reply to RCPT TO command))
Sep 1 17:24:12 kali postfix/cleanup[2065]: 228598018A: message-id=<20100901072412.228598018A@kali.valid.com>
Sep 1 17:24:12 kali postfix/qmgr[1262]: 228598018A: from=<>, size=3315, nrcpt=1 (queue active)
Sep 1 17:24:12 kali postfix/bounce[2068]: 1B51280162: sender non-delivery notification: 228598018A
Sep 1 17:24:12 kali postfix/qmgr[1262]: 1B51280162: removed
Sep 1 17:24:20 kali postfix/smtp[2066]: 228598018A: to=<me@localhost.localdomain>, relay=none, delay=8.4, delays=0.04/0/8.4/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localhost.localdomain type=AAAA: Host not found)
Sep 1 17:24:20 kali postfix/qmgr[1262]: 228598018A: removed
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 )
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 ?
You are right about using DHCP. For security, my modem is set to provide fixed IP addresses to specific NICs only. It also has the (short form) name for the address, though the linux box in question has a hostname set in /etc/sysconfig/network (see previous post). The eth0 cfg script seems innocuous:
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:
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:
Almost
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
::1 kali.xyzzy.com kali localhost6.localdomain6 localhost6
And /etc/resolv.conf is still being written at boot. On first try, it was all comments saying I needed to set DNS1 and 2 in the ifcfg script. I did this and now it regenerates the resolv.conf without the 192.168.1.1 nameserver line (good).
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.