0

I would like to use Postfix as an MTA to deliver emails that I create locally using a Python SMTP client. But I would like to handle the re-sending of emails manually, rather than using Postfix's automatic queues. I also want to get the status codes from the destination server back to Python through my local Postfix. Is this possible?

EDIT: See comment below.

rosstex
  • 133
  • 1
  • 5

1 Answers1

3

It sounds you don't want to rely on a MTA at all, but want to handle everything within your own code. If that is the case, don't use postfix as the MTA...

But I think that if you set bounce_queue_lifetime to 0 only a single delivery attempt will be made.

It might be useful to create your own bounce_service_name to handle delivery failures instead of the using the default postfix bounce daemon, if you don't want to parse the (non-)delivery status log and/or bounce messages.

Bob
  • 5,805
  • 7
  • 25
  • And also https://serverfault.com/q/48326/546643 – Bob Apr 13 '21 at 07:57
  • Thanks for these. I guess what I _really_ want is a simple SMTP implementation that isn't a static proxy, but that uses the email destination to determine the server to contact. It seems so simple, but I can't find any Python repo that does that. Even fancy packages like aiosmtpd don't accomplish this, they include a shell handler that's a static proxy. – rosstex Apr 14 '21 at 01:30