Linux – Change the sender email of logwatch on RH Linux

linuxlogwatchsendmail

Im running logwatch on red hat 7
it sends mails using root@localhost.localdomain
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 myname@registereddomain.com instead of root@localhost.localdomain.
Can anyone help me?
I have already tried changing logwatch.conf with MailFrom = myname@registereddomain.com but did not work.
Logwatch is using mail (not sendmail) .

Best Answer

cf/README - Who Am I?

You may define confDOMAIN_NAME in sendmail.mc:

define(`confDOMAIN_NAME', `Real.Host.Name')dnl 

P.S. After changing sendmail.mc generate new sendmail.cf.