CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Workaround for CiviCRM to work with Amazon SES
Pages: [1]

Author Topic: Workaround for CiviCRM to work with Amazon SES  (Read 1579 times)

mrkschan

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: civicrm4
  • CMS version: drupal7
  • MySQL version: 5.1
  • PHP version: 5
Workaround for CiviCRM to work with Amazon SES
September 16, 2011, 09:25:10 pm
NOTE: This is not a perfect solution and I just checked the bounce case for non-existing email address.

Dude, here is a workaround to let CiviCRM uses Amazon SES . A patch can be found here -
https://gist.github.com/1223565. Let me explain the intention of the patch first.

Amazon SES has a set of restricted email headers
(see http://docs.amazonwebservices.com/ses/2010-12-01/DeveloperGuide/index.html?AppendixHeaders.html),
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 https://gist.github.com/1223583).

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
(b.xx.xx.xxxxxx@example.com) 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: [Select]
aws-email  unix  -       n       n       -       -       pipe
  flags=R user=ubuntu argv=/usr/local/bin/postman send -f mrkschan@example.com ${recipient}
/usr/local/bin/postman is a Amazon SES client written in Python
(find here - https://github.com/gpoulter/postman).

I don't know the drawbacks of using a single envelope "From" address yet. BTW, here is my working configuration:
  • Amazon EC2 micro instance
  • Ubuntu 10.04
  • Apache 2
  • PHP 5
  • Postfix
  • Drupal 7
  • CiviCRM 4
  • Mail Account for Bounce processing: a Gmail account with IMAP enabled
« Last Edit: September 17, 2011, 07:19:27 am by Donald Lobo »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Workaround for CiviCRM to work with Amazon SES

This forum was archived on 2017-11-26.