Im running logwatch on red hat 7 it sends mails using firstname.lastname@example.org however, the email from localhost.localdomain is not received at the recipient because localhost.localdomain is not registered. I want to change logwatch or mail to send from for example email@example.com instead of firstname.lastname@example.org. Can anyone help me? I have already tried changing logwatch.conf with MailFrom = email@example.com but did not work. Logwatch is using mail (not sendmail) .
You may define
P.S. After changing
sendmail.mc generate new
/etc/mail/sendmail.mc add the following lines at the end:
Real.Host.Name is the real host name of the machine.
$j is the macro that holds the hostname. After that rebuild
sendmail.cf and restart sendmail. In Debian you do this by running
sendmailconfig. In CentOS you first run
/etc/mail/mail and then
service sendmail restart.