Question : mails from sendmail not being sent until sendmail is restarted

I have a strange problem with sendmail on my Debian Lenny server:

Mails are not being sent until sendmail is restarted using /etc/init.d/sendmail reload

If I use verbose mode (mail -v [email protected]) to debug the conversation with the remote mail server, I see the following line:

050 450 4.1.8 : Sender address rejected: Domain not found

where xxx is the machine name.

I sort of know the reason of the rejection: the sender address is not valid. It should actually be [email protected].

The question is then, how do I configure sendmail to use this address instead?

1. I have inserted the domain in /etc/mail/local-host-names
2. I have inserted the line MASQUERADE_AS(`mydomain.com')dnl in /etc/mail/sendmail.cf

But it still does not work.

As I wrote initially, if I restart sendmail, all the unsent mails are suddenly being sent correctly, but new mails are again not sent until I restart the mail server.

Hopefully some of you can lead me on the right track!

Answer : mails from sendmail not being sent until sendmail is restarted

These messages that have the wrong domain, are they sent from another machine and relayed through this one, or are they generated locally on this machine? If they're generated locally (like you using the 'mail' command or from a script), the only way to change the domain is to edit the /etc/hosts file and change the hostname of the machine to just the domain you want.
Random Solutions  
 
programming4us programming4us