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.


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.

  • And also serverfault.com/q/48326/546643 – Bob Apr 13 at 7: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 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.