Since a couple of months ago I’m getting a mail error everyday form the NS server:
/etc/cron.daily/0yum-daily.cron:
Failed to send an email to localhost: {'root@ns.mydomain.myltd': (450, '4.1.8 <root@mydomain.myltd>: Sender address rejected: Domain not found')}
Note: ‘ns.mydomain.myltd’ is NS’s fully qualified domain name.
I think that is related to yum failing to report about automatic updates. This is my configuration in ‘Software Center’:
I have mail server installed in NS, but just to receive mail from the internet and transmit it to my internal Zimbra server (‘Relay to another server’).
Also if I try to send a test mail to root from command line:
echo 'Subject: test' | grep sendmail root
I receive the mail in inbox as it would happen to any other of my internal servers.
I would like to get properly notified when there are updates available and when they are applied.
Sorry, I am out of ideas, in /etc/yum/yum-cron.conf I can see the same mail from and mail to, with sendmail it works, with yum-cron it doesn’t. @stephdl, do you have an idea?
[email]
# The address to send email messages from.
# NOTE: 'localhost' will be replaced with the value of system_name.
email_from = root@domain.local
# List of addresses to send messages to.
email_to = root@hostname.domain.local
# Name of the host to connect to to send email messages.
email_host = localhost
The error suggests the mail server is unable to resolve senders domain (DNS), if I’m not mistaken.
Maybe you can get some hint from this postfix rejection rule (the one yum-cron message message hits, I guess):
reject_unknown_sender_domain
Reject the request when Postfix is not final destination for the sender address, and the MAIL FROM domain has 1) no DNS MX and no DNS A record…
Edit /etc/yum/yum-cron.conf, commenting the line: random_sleep = 360 (this is just to avoid waiting many time, once test is done you can undo the change or expand template).
and run:
[root@ns cron.daily]# yum-cron
Not using downloaded nethforge/repomd.xml because it is older than what we have:
Current : Thu Sep 6 13:51:06 2018
Downloaded: Mon Aug 27 13:17:09 2018
Failed to send an email to localhost: {'root@ns.mydomain.myltd': (450, '4.1.8 <root@mydomain.myltd>: Sender address rejected: Domain not found')}
But nothing shows up in my zimbra server. So as I suspected is the NS server which is failing to send it.
I had the local system domain “mydomain.myltd” as part of the email domains (Email > Domains) configured to be relayed to my zimbra server, together with my external domains (mydomain.com, mydomain.net, etc).
I did this some time ago (by mistake I think), but there was no warning. Now I try to add the local domain again and it just wont let me:
The local mailbox domain cannot be relayed
yum-cron was trying to send me an email to report upgrades couldn’t be applied because ‘perl-Proc-ProcessTable’ package was not installed. I installed the package and ran yum-cron again.
Now yum-cron runs with no problem and it sends me an email reporting the upgrades.
Thank you all for your help.
Funny note: one of the upgraded packages was nethserver-mail2-server. So the file /etc/yum/yum-cron.conf that I edited as a suggestion of dnutan was reverted.