Answers.Body: <p>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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-22T22:17:46.993Z
Answers.Text: 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").
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-22T22:17:58.437Z
Answers.Text: 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.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-23T16:16:47.580Z
Answers.Text: 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?
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-24T02:20:49.393Z
Answers.Text: 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).
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-24T02:23:38.437Z
Answers.Text: [Bounce processing - short version](https://docs.civicrm.org/user/en/4.6/advanced-configuration/email-system-configuration/#bounce-processing) and [long version](https://wiki.civicrm.org/confluence/display/CRMDOC/Bounce+Handling)
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-24T11:34:31.800Z
Answers.Text: Thanks sorry, I missed that bit the first time. Thanks for the very detailed answer.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-22T22:16:51.950Z
Answers.LastActivityDate: 2017-03-22T22:16:51.950Z
Answers.UserDisplayName: Chris Burgess
Body: <p>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.</p>
  
  <p>I'm slightly confused as to how CiviMail picks up failures, or retries from postfix.</p>
  
  <p>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?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-22T17:33:00.997Z
Comments.Text: Afaik there's no notification from postfix -> civi in this way. Civi hands it over and marks it as sent, and that's all.
Comments.UserDisplayName: Andrew West
Tags: <civimail><smtp>
Title: CiviMail with postfix, handling retries
ThreadText: # CiviMail with postfix, handling retries
  
  (Asked by: username_0 on 2017-03-22)
  
  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?
  
  **Tags:** civimail, smtp
  
  > **Comments:**
  > **username_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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-03-22. Score: 1 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_2**: 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").  
  > **username_2**: 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.  
  > **username_0**: 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?  
  > **username_2**: 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).  
  > **username_2**: [Bounce processing - short version](https://docs.civicrm.org/user/en/4.6/advanced-configuration/email-system-configuration/#bounce-processing) and [long version](https://wiki.civicrm.org/confluence/display/CRMDOC/Bounce+Handling)  
  > **username_0**: Thanks sorry, I missed that bit the first time. Thanks for the very detailed answer.  
  
  ---
  
  