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) .
Asked
Active
Viewed 2,710 times
2 Answers
2
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
.

AnFi
- 6,103
- 1
- 14
- 27
1
In your /etc/mail/sendmail.mc
add the following lines at the end:
LOCAL_CONFIG
DjReal.Host.Name
Where 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
.

adamo
- 6,925
- 3
- 30
- 58
-
2The cleaner way is to define confDOMAIN_NAME as described in file cf/README section "who Am I". – AnFi May 09 '13 at 19:11
-
Oh some times you can't teach an old dog new tricks :) – adamo May 10 '13 at 08:28
-
@AndrzejA.Filip Please submit this as a separate answer for better visibility and sweet, sweet, delicious upvotes! – Aaron Copley Sep 29 '14 at 23:48
-
@AaronCopley done – AnFi Sep 30 '14 at 13:56