[SOLVED] - Never any mail messsages

Issues related to applications and software problems and general support
Post Reply
User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

[SOLVED] - Never any mail messsages

Post by warron.french » 2021/05/25 13:00:40

I recently installed the mailx package on an already existing server running rhel-7.9.

I have several cronjobs that are configured out of Root's crontab, where I want them to be.
Many of them produce text output, some sporadically, but based on design and others every time, like the auditd.cron file for rolling the audit.log files.

Anyway, on this machine in particular because I do have other machines with similar configurations, the mail command when I execute it never has any mail messages to present -ever.

Is there a configuration file that I need to modify in order to get "system" messages to be sent to Root's mailbox in /var/spool/mail/root?

Trying to do a GoogleSearch for mail is like seeking a single droplet of water out of the entire ocean.
Last edited by warron.french on 2021/05/26 18:44:30, edited 1 time in total.
Thanks,
War

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Never any mail messsages

Post by MartinR » 2021/05/25 13:09:30

Have you checked /etc/aliases? Typically the bottom two lines of the default file read:

Code: Select all

# Person who should get root's mail
#root:		marc
but if that last line has been uncommented then root's mail will be diverted. Likewise look out for /root/.forward (note the dot). It may contain a line similar to:

Code: Select all

bigboss@main.server.home
Which will send all of root's mail to the big boss.

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Never any mail messsages

Post by warron.french » 2021/05/25 15:37:28

Hey MartinR, I did actually check the /etc/aliases file, yes.

The last two lines are precisely as you provided in the code snippet.
Do I need to unhash the root: line and change "marc" to "root"? That seems counter-intuitive.
Thanks,
War

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Never any mail messsages

Post by MartinR » 2021/05/25 15:45:45

No. You only need to unhash it if you are going to use the line to direct root's mail to someone else. whilst on the subject, have a look at the other lines, they should mostly send the various standard system names to root.

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Never any mail messsages

Post by warron.french » 2021/05/26 15:51:32

Yep, they are predominantly set to "root" some are set to ftp, webmaster, news, and also postmaster; which I believe are factory defaults.
Thanks,
War

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Never any mail messsages

Post by MartinR » 2021/05/26 16:46:50

Yes, there are a few of chains, eg: mailer-daemon>postmaster>root, ftpadm>ftp>root and www>webmaster>root, so root should end up with everything unless you make changes.

Can you try as an ordinary user:

Code: Select all

$mail root
Subject: test
test
EOT
and then as root:

Code: Select all

# mail <username>
Subject: test
test
EOT
?

You can try also using -v and it will mail a delivery report back to you. Have a look at /var/log/messages and /var/maillog immediately after the above tests, they are sometimes helpful! come to think of it, you have checked systemctl status postfix haven't you?

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Never any mail messsages

Post by warron.french » 2021/05/26 18:44:13

I found out just now that Postfix was not running, there is an interface problem I need to resolve.

This was the problem I end up seeing while trying to systemctl status -l postfix:

Code: Select all

newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
We are not running IPv6 and do no want to.

So I found this link at access.redhat.com:
https://access.redhat.com/solutions/1591423

Which in the Resolution section of the article indicated to confirm/edit to match the /etc/postfix/main.cf file to have:

Code: Select all

inet_interfaces = localhost
inet_protocols = all
My file already had those lines of syntax.

I have never worked for a company that openly used postfix for corporate email flows so never had the opportunity to research it.

I realized that my /etc/hosts file does have a localhost entry pointing at "::1" so I hashed that line out and attempted again to start the postfix service.

That worked! Thanks MartinR for the nudge in the right direction. Problem solved!
Thanks,
War

Post Reply