[SOLVED] - Never any mail messsages
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
[SOLVED] - Never any mail messsages
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.
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
War
Re: Never any mail messsages
Have you checked /etc/aliases? Typically the bottom two lines of the default file read:
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:
Which will send all of root's mail to the big boss.
Code: Select all
# Person who should get root's mail
#root: marc
Code: Select all
bigboss@main.server.home
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Never any mail messsages
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.
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
War
Re: Never any mail messsages
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.
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Never any mail messsages
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
War
Re: Never any mail messsages
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: and then as root:?
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?
Can you try as an ordinary user:
Code: Select all
$mail root
Subject: test
test
EOT
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?
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Never any mail messsages
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:
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:
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!
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
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
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
War