Read and put INBOUND_MAIL through SES - amazon-web-services

I tried to get the INBOUND_MAIL and put it in S3 then call a custom Lambda function in AWS. But it's not working. Here is what I have done.
Verified my domain and my email address in SES
Created and a rule set to read mail and put it in s3 bucket
created group policy in s3 [GiveSESPermissionToWriteEmail]
Still it's not working. I'm receiving lot mails but none of them in s3 bucket. Any suggestion please.

After the few days recharge I finally figured out the problem.
I did everything correct but I didn't put MX record for Amazon endpoint. Even after the MX record I didn't got emails because I already have another MX record in my DNS Server. So removed previous one. now it's working perfectly.

Related

AWS SES set up in a different region than the domain/EC2...email failure to verify after domain is verified

I have had an EC2 server set up for a while in the Ohio region. Later, I went to set up email for it, and SES is not available for that region. So I fired up another server in N. Virginia, where SES is available. I go into SES, enter my domain (of the original EC2 over in Ohio), and verify it.
The verification of the domain worked, but now I cannot verify an email address, and I cannot receive email at that domain (I'm trying to dump it into an S3 bucket, if that matters). Is this impossible, to have SES trying to deal with email in another region from the original EC2? What would be the best solution for this situation here?
Any help is appreciated. I'm pretty new AWS in general, and still trying to figure out a lot of how it works.
UPDATE: Several days later, the email address has failed the verification. So as of right now, the domain is verified and enabled for sending, but an email address at that domain is failed. How does that happen, and what can I do?

AWS SES save email to s3 bucket

I have configured AWS SES for saving emails to AWS S3 bucket. Followed All Steps.
When i try to send verified email at first, it is saved into S3 bucket named as "AMAZON_SES_SETUP_NOTIFICATION".
It does not generate a real email file. Please help me to resolve this issue.
Thanks.
Jacob
From the docs
The bucket may also contain a file named AMAZON_SES_SETUP_NOTIFICATION. You can ignore or delete this file.
This file has nothing to do with the emails you receive, you can delete the file if you want. If you have done all the configurations correctly, whenever you receive an email, you should see a new file getting created in your S3 bucket.
To setup email receiving, you need to publish an MX record as well.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-mx-record.html
Reference:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-getting-started-view.html

How do I track down what went wrong when an email to AWS-SES goes missing?

I ran every step in
Getting Started Receiving Email with Amazon SES
and all went smoothly. I left the receipt rule
open so that any email address is accepted.
But when I send an email to joe#example.com (for my own example.com), no files are created in the S3 bucket.
The file AMAZON_SES_SETUP_NOTIFICATION is there all right, but nothing else.
How do I go about debugging this issue? Where does one track down what went wrong?
I assume you have a rule for "domain.com" as a recipient which will match for all emails for this domain email addresses.
Couple of things you can check:
MX record for your domain should point to SES inbound endpoint (changing MX may break your incoming emails if you're using it somewhere else already)
Is the rule-set where you have created the rule active ? There can only be one rule-set active.
S3 permission, S3 bucket requires a bucket policy to allow put object from SES.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html
To debug , check if you have received any bounce back.

Email receiving in AWS S3 bucket

I tried configuring AWS SES for receiving emails into my AWS S3 bucket, but I couldn't find any
Step performed -
Domain verified
Added TXT value (BigRock.in)
Added MX value in Domain's DNS (BigRock.in)
Email address verified
Created an active rule set
In S3 action bucket named(xyz-emails), AMAZON_SES_SETUP_NOTIFICATION has received.
But when I tried emailing self (using verified email address), email does not reach my S3 bucket.
Please help in case I'm missing out any step during configuration.
Regards,
Sushant
Look at your ARNs, it may be an error somewhere, or at a policy level
Just take a careful read at the documentation https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-s3.html

Receiving Email is not working in Amazon SES

I tried to access the email and tried to store email in S3 bucket but it is not working.
SES configuration:
domain verified
email address verified
created rule set in rule set Recipient has provided
In S3 action bucket name given
AMAZON_SES_SETUP_NOTIFICATION has received.
After that if I receive any email from particular recipient it is not stored in S3.
If you are using Route53 for your domain management, you may have forgotten to set up MX record for it.
Here is an instruction of how to do it.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-mx-record.html
TL;DR
Don't add AWS's MX record to an existing MX record; you need to create a new MX record with a domain that you're not currently using for emails.
Background
I wasn't entirely familiar with MX records and SES, and I already had an MX Record-Set in AWS Route53, I'm using GMAIL (G Suite).
So I followed all the necessary steps - SES-Receive-Inbound-Emails AWS Blog Post - and I still didn't understand why I don't see new emails in my S3 bucket; I could only see AMAZON_SES_SETUP_NOTIFICATION in the bucket.
As already mentioned in previous answers, you must add the AWS's MX record to receive emails, that will eventually be stored in your S3 bucket.
Lesson learned
Having multiple MX records in the same Record-Set is for backup purposes only. If the server is unreachable, it moves on to the next record on the list. Do not expect the email to be received by all the MX records, that will never happen.
Bad Solution
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM
10 inbound-smtp.eu-west-1.amazonaws.com # <-- added this one
I also tried changing the priority of AWS MX from 10 to 1, which is silly, since I still want to receive emails to my mailbox via GMAIL.
Good Solution
Create a new aliased-subdomain and use it for SES.
Here's how:
Assuming I own mydomain.com, and my email address is willy#mydomain.com, I want to use the aliased-subdomain ses.mydomain.com
Add the aliased domain in your GSuite - Login with Admin account and go to Admin Console > Domains > Follow the steps - Add a domain alias > verify and confirm ownership > Domain Name provider = Other
Create a TXT record in AWS Route53 according to the guide in the previous step; this will verify that you own the aliased-subdomain
Back to AWS, Create a new Record-Set in Route53
- Name: ses.mydomain.com # replace 'ses' if necessary
- Type: MX
- Value: # this is temporary, we'll change it in the next steps
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM
Setup SES to S3 - Follow the steps - SES-Receive-Inbound-Emails AWS Blog Post
Verify the aliased-subdomain ses.mydomain.com
Verify an email address - willy#ses.mydomain.com - check your regular inbox willy#mydomain.com open the email from AWS and verify this email address by clicking the verification link
Create a rule and add willy#ses.mydomain.com as a recipient
Edit the previously created MX Record-Set in Route53
- Name: ses.mydomain.com
- Type: MX
- Value: 10 inbound-smtp.${AWS_REGION}.amazonaws.com # replace ${AWS_REGION}
Send an email (from any mailbox) to willy#ses.mydomain.com - you'll see the email in your S3 bucket! Object name is hashed, you need to download and change its extension to .eml
I hope this helps. I was banging my head for a few hours about this one.
In case anyone else's registrar has a confusing settings menu:
I the SES setup menu they show MX record name = your domain, value = 10 inbound-smtp.us-east-1.amazonaws.com. The "10" is meant to be the priority, I just copy/pasted it directly into the server field with my registrar, which was causing the record to be invalid.
Just make sure that your rule set is shown in "Active rule set". Once you create the rule, it is by default goes into "inactive rule set" and you need to mark it is a "Set as a active rule set" and once you do that, it will go in the "Active rule set" section and it will be visible by clicking on "View Active Rule set" button.
If anyone else is still having trouble with this, here are things to check:
All of your 'pieces' are on the same region (S3 bucket, Route53 hosted zone, SES configuration)
SES has the permission to write to the S3 bucket (see this tutorial)
Bucket name is the same name as your domain name
Route53 hosted zone has MX records, which are injected automatically by SES configuration. You just have to pay attention when you do the setup
You will want to verify the rule set you are working with is active. Go to SES and click "Rule Sets" under the email receiving section in the sidebar. Click the "View Active Rule Set" button. Make sure this is the rule set you are currently expecting to be used. To activate the rule set from the "Rule Sets" screen, click on the checkbox next to the rule set and click "Set as Active Rule Set".
The MX record's hostname must end with "." like so:
10 inbound-smtp.us-east-1.amazonaws.com.
Otherwise the record's hostname will be suffixed by your domain name, which is not intended here.
The issue for me was that I had not made the rule set Active. Was losing my mind on the details of the setup but they were all correct.
Make sure you go to "View Active Rule Set" and ensure the inbound rule you created is listed there.
I had the same problem at first. But I notice that the "access denied" was not a configuration question, but something related to access this information directly in the Browser. After downloading the file with "Aws Cli" through the Terminal in Visual Studio Code, I could read the data. Pay attention to activate the rule - in the SES Panel - because NOTIFICATION MESSAGE is something wrong there. ;)
I'm not a expert, but in my expirience probably you have to assing privilegies to the bucket before SES can write elements, i was have similar problems at the begining, so i chose the option create Bucket in the action selection when configurating the rules, then the bucket is created automated with the permisions configured in correct way.