Re: [Ddclient-support] Specify sender address for email notifications
Brought to you by:
supersandro2000,
wimpunk
From: wimpunk <wi...@us...> - 2020-03-30 11:37:38
|
Hi, On 3/30/20 5:28 AM, ddc...@pl... wrote: > Hi, > > I'm using OpenSMTPD to send emails from my server. This program uses an > external SMTP server to send mail. My SMTP server will only accept mail > from specific sender addresses, and thus using the default sender of > user@hostname fails. Instead, I manually set the sender address by > editing `/etc/mail.rc` and adding: > > set from="Foo Bar <fo...@do...>" > > I have also set up aliases, and hence when I test with the following, it > works perfectly: > > $ echo "body" | mail -s "subject" root > > However, ddclient doesn't seem to respect the sender address. Instead, > it still sends from user@hostname, which is rejected by my SMTP server. > Is there a way to specify the sender address for ddclient? > > Thanks in advance! > > Ddclient uses sendmail as system to send mail. The used syntax is: > pipecmd("sendmail -oi $recipients", > "To: $recipients", > "Subject: status report from $program\@$hostname", > "\r\n", > $msgs, > "", > "regards,", > " $program\@$hostname (version $version)" > ); This prevents issues with different version of mail and mailx. So currently there is no way to set the sender, although it should be handled correctly by sendmail. In my case I use exim which seems to honour the configuration I did to set the from address. You can just edit the ddclient perl script and add a from line to the sendmail routine. That should work, although I never tested it. Kind regards, Wim Vinckier. |