Sooo ... I'll start off with "I thought I had a good understanding of how to setup SES or Mandrill", but apparently I'm missing something here.
So to preface my setup is > AWS (EC2, Redis, postgres) > because of the constraints of my organization.
SCENARIO 1:
When setting up the Discourse server I used SES and my @gmail.com account (let's call it admin@gmail.com for simplicity), which was added using the 'Verify a New Email Address' process for individual email addresses.
The SMTP settings within app.yml look like the following:
DISCOURSE_SMTP_ADDRESS: email-smtp.us-east-1.amazonaws.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: [AWS SES USERNAME]
DISCOURSE_SMTP_PASSWORD: [AWS SES PASSWORD]
Using the admin@gmail.com account, I am able to successfully:
- send an email to other @gmail.com email addresses
- send emails to my @custom.com domain email addresses
I then use my @custom.com (successfully verified by SES) with Discourse and here's what happens:
- I can send emails to @gmail.com accounts
-
BUT not to @custom.com email addresses (including the one I'm sending it with).
NOTE: Neither @gmail.com or @custom.com are verified domains within SES.
SCENARIO 2:
My organization also has a Mandrill account used across the organization by several different domains (successfully). I have done the following:
- added @custom.com to the list of sending domains
- have verified the domain and DKIM but receive an SPIF error because it's not a top 10 record)
- created an API key and added the updated SMTP info into the app.yml file, which looks like the following
DISCOURSE_SMTP_ADDRESS: smtp.mandrillapp.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: [Mandrill user email address]
DISCOURSE_SMTP_PASSWORD: [Mandrill API key]
When attempting to send emails via @custom.com while using Mandrill I can't send an email from Discourse to @custom.com OR @gmail.com email addresses, BUT I receive confirmed delivery via the Mandrill API logs ...
Method: messages/send-raw.json
Time: May 11, 2015 3:47 pm
Call time: 69.4ms
IP: [Discourse server EC2 elastic IP address]
User Agent: Mandrill-Python/1.0.56
Full Request
{
"send_at": null,
"from_name": null,
"raw_message": "Received: from localhost.localdomain (unknown [EC2 Elastic IP address])\n\t(Authenticated sender: MI0xXUE4xIA5TTfSyziQcg@custom.com)\n\tby ip-10-187-29-39 (Postfix) with ESMTPSA id 2AC4DC0736\n\tfor <admin@custom.com>; Mon, 11 May 2015 19:47:08 +0000 (UTC)\nDate: Mon, 11 May 2015 19:47:37 +0000\nFrom: admin@custom.com\nReply-To: admin@custom.com\nTo: admin@custom.com\nMessage-ID: <8d5c1004-4d64-4722-8f50-5fc1cde5c535@discourse.custom.com>\nSubject: [Custom Discourse] Email Deliverability Test\nMime-Version: 1.0\nContent-Type: multipart/alternative;\n boundary=\"--==_mimepart_55510759a2805_6a3ff1b5cd7e7c285b2\";\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\nAuto-Submitted: auto-generated\n\n\n----==_mimepart_55510759a2805_6a3ff1b5cd7e7c285b2\nContent-Type: text/plain;\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\nThis is a test email from\n\n[**http://discourse.custom.com**][0]\n\nEmail deliverability is complicated. Here are .."
"ip_pool": null,
"from_email": null,
"return_path_domain": null,
"to": [
"admin@gmail.com"
],
"key": "MI0xXUE4xIA5TTfSyziQcg",
"async": false
}
Full Response
[
{
"email": "admin@gmail.com",
"status": "sent",
"_id": "2312b8907c184e1985e046c1c2e57f0a",
"reject_reason": null
}
]
So there's obviously multiple problems going on here, which from what I understand is ...
- there's something preventing me from delivering an email from @custom.com to my own (or other) @custom.com email addresses via SES
- I'm completely unable to successfully deliver any emails (to @gmail.com or @custom.com) from Mandrill, even with a domain and DKIM verified and SPF record added (not verified due to not Top 10) for @custom.com
The only thing I can think of is that in the "raw_message" there's the following ...
"Received: from localhost.localdomain (unknown [Discourse EC2 elastic IP address])\n..."
where the actual EC2 elastic IP address is used. Could this be the cause and any idea on how to resolve?
The other thought is that the @custom.com spam or whitelist filter is blocking me from successfully delivering emails, BUT this doesn't make sense because I'm using a verified email from the same exact @custom.com domain.
Thoughts? Thanks so much!