Yes, a bounce message is an email, so it won't be on stdout or stderr. Either way, Martijn's answer probably points out a better approach for your case, anyways.

On Sat, Oct 15, 2022 at 02:34:52PM +0100, Simon Harrison wrote:
On Sat, 15 Oct 2022 14:44:01 +0200
Tassilo Philipp <tphil...@potion-studios.com> wrote:

I guess your python subprocess is the submission agent? In that case you get the error in theory automatically, but it would be in form of a bounce message. If your submission agent cannot receive bounces they will be lost (probably hanging in the next MTA's queue for a while until they hit a timeout).

On Sat, Oct 15, 2022 at 01:21:15PM +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=<some...@outlook.com> 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



stdout and stderr are both empty strings unfortunately.

Thanks,

Simon


Reply via email to