On Sat, 2022-10-15 at 13:21 +0100, Simon Harrison wrote:
> Hello. I'm using Python subprocess to send mails on a linux server. For
> outlook.com addresses I get the following error in /var/log/mail.log:
> 
> Oct 14 11:41:22 myhost smtpd[1846073]: f01b467faa967988 mta delivery
> evpid=d9b3ae9518ff979a from=<me@server> to=<[email protected]>
> rcpt=<-> source="server.ip.address" relay="104.47.56.161
> (104.47.56.161)" delay=2s result="PermFail" stat="550 5.7.1
> Unfortunately, messages from [server.ip.address] weren't sent. Please
> contact your Internet service provider since part of their network is
> on our block list (S3140). You can also refer your provider to
> http://mail.live.com/mail/troubleshooting.aspx#errors.
> [CO1NAM11FT072.eop-nam11.prod.protection.outlook.com]"
> 
> So my question is, is there any way to get that output rather than
> ssh-ing into the server and checking the log? Can opensmtpd return that
> output as well as logging it? Python subprocess.stdout suggests that
> opensmtpd does not return anything over than 0 or 1.
> 
> Cheers,
> 
> Simon
> 
It's send over syslog. So you can do whatever your syslog daemon
supports. If you use rsyslog one option could be to write it to a
named pipe:
https://www.rsyslog.com/doc/v8-stable/configuration/modules/ompipe.html

martijn@

Reply via email to