0

I'm currently investigating switching from direct SMTP to Amazon SES to using postfix (configured to talk to Amazon SES) as I gather this is a more robust approach.

I'm slightly confused as to how CiviMail picks up failures, or retries from postfix.

For example, if halfway through a mailing Amazon SES becomes unavailable, what would happen? If postfix tries to send them again later how will these deliveries be recorded in CiviCRM?

1
  • Afaik there's no notification from postfix -> civi in this way. Civi hands it over and marks it as sent, and that's all. Mar 22, 2017 at 17:33

1 Answer 1

1

Postfix is a Mail Transfer Agent (MTA), and the task of an MTA is to ensure that the mail gets through if at all possible.

If the remote site stops accepting connections for any reason, then your MTA will keep those mails on disk and retry them periodically. In the case where your SES becomes unavailable, your Postfix will just sit tight and keep trying.

Barring a severe SES outage, a local MTA + SES should be more robust than SES alone, because you have a local agent able to handle short SES outages. For even better handling, you may configure your MTA to "fail over" to a secondary mail provider, or attempt direct delivery over SMTP when the preferred provider is unavailable.

When a mail can't be delivered - whether or not this involves an outage at SES or elsewhere - the MTA currently holding the email should return it as a bounce message to the sender. This is the feedback loop which will return the failed delivery information to CiviCRM's Bounce Processor task.

6
  • Typically the delay between retries increases, so if it's not accepted the first time, the email might be held for 5 minutes, then 15, and so forth. Once the MTA decides this just isn't working out (maybe 48H, configurable), you'd see a bounce message - but that would require a long period where the email can't be delivered, or a "hard" rejection from the receiving site (eg "nope, this mailbox doesn't exist"). Mar 22, 2017 at 22:17
  • Providers sometimes "throttle" connections too. They might detect you're emailing a lot of people at once, and limit your deliveries to (say) 100/hr. An MTA will handle this by retrying the emails to deliver at intervals, so eventually they all get through. The MTA's job is to patiently handle this for you. Mar 22, 2017 at 22:17
  • Thanks Chris. Does this mean that Civi would interpret every email as 'successfully delivered' - provided postfix doesn't reject the message due to an invalid 'to' address or something ridiculous - until they bounce? And how does postfix tell Civi about bounces?
    – John
    Mar 23, 2017 at 16:16
  • Every email is treated as delivered unless it is returned (bounces). It's either accepted for delivery, or returned. Like normal mail! Postfix tells Civi about bounces by generating a bounce message addressed to the bounce mailbox (final paragraph of answer). Mar 24, 2017 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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