Skip to content

Instantly share code, notes, and snippets.

@mrkschan
Created September 17, 2011 04:23
Show Gist options
  • Save mrkschan/1223622 to your computer and use it in GitHub Desktop.
Save mrkschan/1223622 to your computer and use it in GitHub Desktop.
originally a forum post to CiviCRM, but the forum keeps saying ... "Sorry, you are not allowed to post external links.". WTF.
[b]NOTE: This is not a perfect solution and I just checked the bounce case for non-existing email address.[/b]
Dude, here is a workaround to let CiviCRM uses Amazon SES . A patch can be found here -
[url]https://gist.github.com/1223565[/url]. Let me explain the intention of the patch first.
Amazon SES has a set of restricted email headers
(see [url]http://docs.amazonwebservices.com/ses/2010-12-01/DeveloperGuide/index.html?AppendixHeaders.html[/url]),
thus the "Precedence" header has to be removed. And, Amazon SES may rewrite the envelope From, Bounces-To, and
Return-Path headers. As a result, the Return-Path header is no longer reliable for bounce checking in
EmailProcessor (see sample bounce notification from Amazon [url]https://gist.github.com/1223583[/url]).
In order to use this patch and let CiviCRM works with Amazon SES, all "From Email Addresses" in CiviMail MUST first
verified by Amazon SES. And, all emails sent with CiviMail MUST share a single envelope From email address. This is
because Amazon SES requires the verification of the "From" email address of the envelope and the "From" email
address of the email itself. In CiviMail, the envelope "From" address is a generated VERP address
([email protected]) that cannot be used with Amazon SES unless Amazon SES allows verification of the entire
domain (which is not yet available). Thus, I make an enforcement in my Postfix configuration
(/etc/postfix/master.cf) so that all messages share a single envelope "From".
[code]
aws-email unix - n n - - pipe
flags=R user=ubuntu argv=/usr/local/bin/postman send -f [email protected] ${recipient}
[/code]
/usr/local/bin/postman is a Amazon SES client written in Python
(find here - [url]https://github.com/gpoulter/postman[/url]).
I don't know the drawbacks of using a single envelope "From" address yet. BTW, here is my working configuration:
[list]
[li]Amazon EC2 micro instance[/li]
[li]Ubuntu 10.04[/li]
[li]Apache 2[/li]
[li]PHP 5[/li]
[li]Postfix[/li]
[li]Drupal 7[/li]
[li]CiviCRM 4[/li]
[li]Mail Account for Bounce processing: a Gmail account with IMAP enabled[/li]
[/list]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment