0yum-daily.cron Failed to send an email

v7
yum-cron

(Carlos Estrada) #1

Hi.

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.


(Markus Neuberger) #2

You may check /var/log/maillog for errors.

Does the following mailing work?

echo 'Subject: domainonly' | sendmail root@domain.tld
echo 'Subject: fqdn' | sendmail root@ns.domain.tld


(Carlos Estrada) #3

In /var/log/maillog I found this a the same timestamp as the error mail:

Sep  5 04:43:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:44:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:44:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:45:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:45:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:46:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:46:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:47:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:47:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:47:55 ns rspamd[2830]: <pr5857>; map; http_map_finish: data is not modified for server updates.rspamd.com, next check at Wed, 05 Sep 2018 10:52:55 GMT
Sep  5 04:47:57 ns postfix/smtpd[849]: connect from localhost[127.0.0.1]
Sep  5 04:47:57 ns rspamd[2829]: <5af5bc>; proxy; proxy_accept_socket: accepted milter connection from /var/run/rspamd/worker-proxy port 0
Sep  5 04:47:57 ns postfix/smtpd[849]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 450 4.1.8 <root@mydomain.myltd>: Sender address rejected: Domain not found; from=<root@mydomain.myltd> to=<root@ns.mydomain.myltd> proto=ESMTP helo=<ns.mydomain.myltd>
Sep  5 04:47:57 ns postfix/smtpd[849]: lost connection after RSET from localhost[127.0.0.1]
Sep  5 04:47:57 ns postfix/smtpd[849]: disconnect from localhost[127.0.0.1]
Sep  5 04:47:57 ns rspamd[2829]: <5af5bc>; milter; rspamd_milter_process_command: got connection from 127.0.0.1:42718
Sep  5 04:47:57 ns rspamd[2829]: <5af5bc>; proxy; proxy_milter_finish_handler: finished milter connection
Sep  5 04:48:40 ns clamd[2779]: SelfCheck: Database modification detected. Forcing reload.
Sep  5 04:48:41 ns clamd[2779]: Reading databases from /var/lib/clamav
Sep  5 04:48:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:48:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:48:53 ns postfix/pickup[31759]: 9940A20082780: uid=0 from=<root>
Sep  5 04:48:53 ns postfix/cleanup[2993]: 9940A20082780: message-id=<20180905104853.9940A20082780@ns.mydomain.myltd>
Sep  5 04:48:53 ns opendkim[2628]: 9940A20082780: no signing table match for 'root@ns.mydomain.myltd'
Sep  5 04:48:53 ns postfix/qmgr[2414]: 9940A20082780: from=<root@ns.mydomain.myltd>, size=621, nrcpt=1 (queue active)
Sep  5 04:48:53 ns postfix/smtp[2998]: Untrusted TLS connection established to 192.168.1.47[192.168.1.47]:25: TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)
Sep  5 04:48:53 ns postfix/smtp[2998]: 9940A20082780: to=<root@ns.mydomain.myltd>, orig_to=<root>, relay=192.168.1.47[192.168.1.47]:25, delay=0.08, delays=0.02/0.01/0.03/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as E8ACA24)
Sep  5 04:48:53 ns postfix/qmgr[2414]: 9940A20082780: removed
Sep  5 04:48:59 ns clamd[2779]: Database correctly reloaded (6899679 signatures)
Sep  5 04:49:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:49:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:50:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:50:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:51:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:51:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:52:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:52:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)
Sep  5 04:53:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:810: check ANN tRFANNFAB687239314075A260
Sep  5 04:53:49 ns rspamd[2830]: <jm7gtg>; lua; neural.lua:822: no need to learn ANN tRFANNFAB687239314075A260 94 learn vectors (1000 required)

I already tried this, but I did it again. The mail goes fine to my inbox.


(Markus Neuberger) #4

Can you reproduce the error with:

echo 'Subject: test' | sendmail -f root@domain.tld root@ns.domain.tld

yum-cron sends mails from root@domainname and as you are relaying maybe zimbra doesn’t accept the sender domain.


(Carlos Estrada) #5

No errors. Even if I use anything as ‘domainname’ in -f:

echo 'Subject: test' | sendmail -f root@dfsdgsg.wwer root@ns.domain.tld

The mail goes to my inbox with no errors.


(Markus Neuberger) #6

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

Maybe a problem with relaying and yum-cron?


(Stéphane de Labrusse) #7

not much idea it is workable on my servers :-?


(Marc) #8

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…


(Carlos Estrada) #9

If I run:

run-parts /etc/cron.daily

should that trigger ther error message?

I’m trying to find a way to reproduce the error manually or at demand, and not just wait until the next cron.daily run.


(Marc) #10

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:

/etc/cron.daily/0yum-daily.cron

or

yum-cron

(Carlos Estrada) #11

Thanks. I was wondering why it took so long. :grin:

I get the same error in terminal:

[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.


(Carlos Estrada) #12

I think I found the problem.

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.