Amazon SES for CiviCRM » History » Version 15
Jon Goldberg, 05/06/2015 05:59 PM
1 | 1 | Jon Goldberg | h1. Amazon SES for CiviCRM |
---|---|---|---|
2 | |||
3 | 2 | Jon Goldberg | _Pre-requisites: DNS access_ |
4 | |||
5 | * Have client sign up for Amazon AWS, which involves credit cards, identity verification, etc. |
||
6 | * Ideally, have them click on "SES" at the AWS console, to do the phone verification. |
||
7 | * Log onto AWS, select SES. Note that you only have sandbox access at this time. |
||
8 | * Click on "SMTP Settings" on the left, record the server info, generate SMTP credentials and record those too. |
||
9 | * Click on "Verified Senders: Domains". Click "Verify a new Domain". Enter the client's domain name; also click "Generate DKIM settings". |
||
10 | * Download these credentials, don't just copy/paste from the screen, because they tend to get cut off. |
||
11 | * Update the DNS with the verification credentials. |
||
12 | 5 | Jon Goldberg | ** *NOTE: This will take several hours (3-4?), even after DNS has propagated.* |
13 | 3 | Jon Goldberg | * Also add your own e-mail address the the verified sender - email address list. This just requires receiving a verification email. You need this because while you're still in sandbox mode, you can only send to verified addresses. Note that if your normal mail account has greylisting, you'll probably want to use an alternate account here, like GMail. |
14 | 4 | Jon Goldberg | |
15 | You now have two options for SMTP setup: |
||
16 | 10 | Jon Goldberg | |
17 | h3. SMTP direct from CiviCRM |
||
18 | |||
19 | 4 | Jon Goldberg | * Set up the SMTP Outbound settings in CiviCRM to use the Amazon SMTP server. If you do this, know that STARTTLS isn't supported, so prefix the SMTP server with @ssl://@ and select a port of @465@. |
20 | 1 | Jon Goldberg | * Click "Save and Test". |
21 | 4 | Jon Goldberg | * You may not see an error on the page - so check the ConfigAndLog log for error messages if necessary. |
22 | 1 | Jon Goldberg | |
23 | 10 | Jon Goldberg | h3. SMTP relayed through Postfix (recommended) |
24 | 4 | Jon Goldberg | |
25 | 14 | Jon Goldberg | See also here: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html |
26 | |||
27 | 10 | Jon Goldberg | Postfix will give higher performance on large mailings, and also does a much better job of handling resends, greylisting, etc. This should be implemented wherever possible. |
28 | 1 | Jon Goldberg | |
29 | 11 | Jon Goldberg | |
30 | 1 | Jon Goldberg | * Install Postfix. |
31 | 11 | Jon Goldberg | * Paste this at the bottom of @/etc/postfix/main.cf@: |
32 | 12 | Jon Goldberg | <pre> |
33 | 11 | Jon Goldberg | #jon@palantetech.coop SES setup |
34 | relayhost = email-smtp.us-west-1.amazonaws.com:25 |
||
35 | smtp_sasl_auth_enable = yes |
||
36 | smtp_sasl_security_options = noanonymous |
||
37 | smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd |
||
38 | smtp_use_tls = yes |
||
39 | smtp_tls_security_level = encrypt |
||
40 | 1 | Jon Goldberg | smtp_tls_note_starttls_offer = yes |
41 | 14 | Jon Goldberg | #This last line isn't needed, I'm pretty sure |
42 | #smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt |
||
43 | 11 | Jon Goldberg | |
44 | #jon@palantetech.coop rate limiting to 4 messages/second for now |
||
45 | smtp_destination_rate_delay = 1s |
||
46 | smtp_destination_concurrency_limit = 4 |
||
47 | 12 | Jon Goldberg | </pre> |
48 | |||
49 | * Create a file with credentials at @/etc/postfix/sasl_passwd@ in the format: |
||
50 | <pre> |
||
51 | email-smtp.us-east-1.amazonaws.com:25 username:password |
||
52 | </pre> |
||
53 | 13 | Jon Goldberg | * Run @postmap /etc/postfix/sasl_passwd@. |
54 | 15 | Jon Goldberg | * Configure CiviCRM's SMTP settings to either a) point to localhost, or b) use mail(). |
55 | 10 | Jon Goldberg | |
56 | h2. Bounce processing setup |
||
57 | |||
58 | See [[Set up local bounce processing]]. |
||
59 | |||
60 | |||
61 | h2. Testing |
||
62 | |||
63 | 7 | Jon Goldberg | * To test bounce processing, set up a test group made up of at least one verified address and a test contact with the e-mail address "bounce@simulator.amazonses.com". |
64 | 1 | Jon Goldberg | * Send a mailing to that group. You can speed up testing by manually running the "Send Scheduled Mailings" and "Fetch Bounces" scheduled jobs. |
65 | * Don't forget to request production access when you're done! |
||
66 | 6 | Jon Goldberg | |
67 | 10 | Jon Goldberg | h3. SPECIAL NOTE FOR EC2 INSTANCES |
68 | |||
69 | 9 | Jon Goldberg | EC2 severely throttles outgoing mail on ports 25/465/587. You need to submit a request to Amazon to have this throttle lifted. This is separate from any user-configurable firewalling! You can do that (and set up PTR) here: https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request |