AWS SES handle doesn't exist mailbox with Lambda - amazon-web-services

I try to use AWS SES for handle some app data on get email.
I've verified mydomain.com with AWS SES. I want handle dynamic email to addresses 1#mydomain.com 2#mydoamin.com, where 1,2 id from database.
I want handle it with AWS lambda, but I can not do it because I get:
550 5.1.1 Requested action not taken: mailbox unavailable
Is there any way to bypass the creation of mailboxes?
How can I change to email address via SES, for send all emails to one pre existed mailbox?

Make sure your MX records are correctly setup and propagated.
To check, navigate to your domain's Hosted zone in Route 53, and you should have the MX records like:
10 inbound-smtp.us-east-1.amazonaws.com
20 inbound-smtp.eu-west-1.amazonaws.com
30 inbound-smtp.us-west-2.amazonaws.com
See also: Amazon WorkMail account failing to receive email

First of all, you need to make sure you have your email domain verified under Identity Management - Domains in AWS Console.
After that, you have to verify your RuleSet is active. This means under Email Receiving - Rule Sets - View Active Rule Set you have to see your rule using the defined domain.
In your particular case:
Verify domain mydoamin.com
Check if the Active Rule Set really contains the SES rules for 1#mydoamin.com and .2#mydoamin.com

The error
550 5.1.1 Requested action not taken: mailbox unavailable
is not an AWS Lambda or AWS SES issue. It is an issue on the receiving end of the email. The problem is that there is no one on the receiving end of 1#mydomain.com to receive the email.
Lambda and SES cannot avoid the issue. To handle the issue, you must resolve it on the receiving end by:
creating an inbox, or
setting up aliases, or
wild-card the emails to a default inbox
The technical steps to accomplish this will depend on your receiving-end mail server.

I ran into this problem while setting up email forwarding from one address to another, and ultimately realised that when the SES rule set instructions asked for a 'recipient' email address, it was not the address I was forwarding emails to, but actually the initial email address that was receiving the email.

I was getting same error.
My problem was RuleSets.
SES>Email receiving>Rules Sets.
There should be rules here that allows your mail ID or any mail to your domain.

Encountered the same problem. While my domain was verified with SES I needed to create an SES identity. After creating the identity everything on https://aws.amazon.com/premiumsupport/knowledge-center/ses-receive-inbound-emails/ worked as expected.

Related

How to prevent someone from using my domain in Amazon SES -- they are sending emails from my domain with a different email address

So I recived an email from AWS that someone is using my domain for spamming.
I checked the details of the email that was sent and I detected that if my domain is myapp,
and I am usually sending emails from email address office#myapp.com. I noticed that the hacker is using the mail 073office#myapp.com which is very similar to my business email.
This address 073office#myapp.com is not verified in my SES verified emails, but he is still using my ARN somehow.
How can I prevent it? Is there a way to configure SES only from one email?
are you able to see in SES logs if the emails are being sent from your SES? if yes, try creating new SES credentials and disable the existing ones, to avoid them using the current ones. If not, they are probably using external SMTP and spamming using your domain and this is something that you can't do much to avoid.
So apparently one of our access keys was leaked and was included in the frontend's cache. I generated a new Access Key and disabled the old one , I also improved security configurations for the server.
I also configured SNS for bounces and complaint management and reconfigured my SES to use Hard Fail and improved DKIM , SPF and MAIL TO

AWS SES email receiving - 550 mailbox not found

I've been trying to set up AWS Simple Email Service as a way to forward emails received to my custom domain on to my Gmail account, without any email hosting service required.
I have set up and verified my custom domain (mycustomdomain.com) as well as verified the email address they'll be forwarded to (myemail#gmail.com) as I'm still in Sandbox mode.
Under Email Receiving -> Rule Sets, I have an active / enabled rule set (forward-to-myemail-gmail) which is enabled, doesn't require TLS and has spam/virus scanning on.
There are no recipients specified, which I believe should allow this rule to be triggered for ALL recipients under my custom domain.
I have a single SNS action specified, which is to publish to the SNS topic (sns-forward-to-myemail-gmail) using base64 encoding
I have also set up my SNS topic as above and associated subscription, and have tested sending a notification to this topic manually using the console, so have confirmed it works.
However if I try sending an email to, for example, test#mycustomdomain.com, I get a bounce message back saying:
Address not found
Your message wasn't delivered to test#mycustomdomain.com because the address couldn't be found or is unable to receive email.
The response was:
550 Mailbox does not exist!
I've also confirmed that the MX records have been set up correctly using mxtoolbox.com, which says the domain records point to feedback-smtp.us-west-2.amazonses.com
Any suggestions for what I'm doing wrong? Many thanks!
Ok I figured it out... User error, as expected!
I had two MX records, one for the "mail" subdomain and another for "#" meaning the base domain. Both were set to the feedback endpoint, which was the problem. I think I was misunderstanding the two MX records.
The "mail from" configuration that used the SES feedback endpoint needed to be set for the sending subdomain (mail.mycustomdomain.com) while the SES inbound SMTP endpoint should have been used for the receiving domain (#, which means mycustomdomain.com).
Before when I was setting both to the same value I found either get a verified MAIL FROM or received email but not both. Obvious in hindsight! Hope this helps someone else.
For anyone else that had some trouble understanding ChrisC's answer, here is more detail on what I needed to do. I setup my domain using Route53, but other domain providers is similar.
TL;DR
Create a custom MAIL FROM domain
Add the following records to Route53 or your DNS provider:
Record name
Type
Value/Route traffic to
mail.customdomain.com
MX
10 feedback-smtp.[region].amazonaws.com
customdomain.com
TXT
"v=spf1 include:amazonses.com ~all"
customdomain.com
MX
10 inbound-smtp.[region].amazonaws.com
Outbound mail
Go to the Amazon SES AWS console. Under "Configuration," go to "Verified Identities." Under "Custom MAIL FROM domain," provide a custom subdomain (e.g., mail.customdomain.com). Select the option to add the DNS records (an MX record and a TXT record) to Route53 (or just add them manually). See this page in the AWS docs regarding custom MAIL FROM domains.
Inbound mail
Go to the Route53 AWS console. Under "Hosted zones," click on the domain you want to enable for receiving emails. Add an MX record for the base domain (e.g., customdomain.com) with the following value [priority] inbound-smtp.[region].amazonaws.com, where [region] can be us-east-1, us-west-2, or eu-west 1 (see this page for full details). Do NOT use email-smtp.[region].amazonaws.com for receiving inbound mail. I received a 530 Authentication required error in the bounce email when attempting to do so.
See this page in the AWS docs regarding publishing an MX record for receiving SES email.
Thanks for the answers above. For anyone else working through this, in my case the feedback value (for the mail.xxx.com had to be:
10 feedback-smtp.[region].amazonses.com
While the root domain value had to be:
10 inbound-smtp.[region].amazonaws.com
note that the feedback domain is AMAZONSES while the inbound domain is AMAZONAWS.

AWS SES Identity "pending verification" for DKIM config

Brand new to AWS & Simple Email Service (SES) and have an app that needs to generate some email using SES. All I'm trying to do is set things up so that my app's service user (called, say, myapp-dev) has Access & Secret Keys that have permission to use SES APIs for generating emails. Furthermore I need these SES-generated emails to be sent from either no-reply#myapp.example.com which is not a valid email address, as well as hello#myapp.example.com which is a valid email address. This is because some SES emails will be alerts/notifications that end users should not respond to, and other emails will be emails that they may very well want/need to reply to.
I've already created a myapp-dev user that has AmazonSESFullAccess permissions.
Not knowing any better, I then went to the SES dashboard and clicked Manage Identities and started creating a new "SES Identity". I'm not sure if I need to do this or not (given my needs) or whether my myapp-dev user is ready to use the SES APIs as-is. Adding this new SES identity, it asked me to enter my domain and gave me the option to generate DKIM configurations for that domain. I read up quickly on DKIM and it sounds like its a way to authenticate that emails did in fact come from my domain, so it sounds like its something I'd like leverage. So I generated DKIM configs and now SES says that my new identity has a status of "pending verification".
Main concern is bolded above: with AmazonSESFullAccess permission, is my myapp-dev user ready to rock n' roll? Or will SES APIs fail/refuse to send emails until my SES identity (for my domain) is "verified"?
What do I actually need to do to change the SES identity from "pending" to "verified"? I did see a note that I needed to modify TXT and CNAME DNS records to configure DKIM with my domain, is that it? Or do I need to do something else?
Thank in advance for any and all clarification!
Found an alternate answer in this thread:
https://forums.aws.amazon.com/thread.jspa?threadID=125362
Here's what might have happened: Some domain name providers will automatically add example.com on to the end of the name/host field. So if you enter _xx.example.com, they'll "silently" change it to _xx.example.com.example.com
This is currently the case with namecheap, as I've painfully learned.....
It turned out this was my issue. Make sure to double check!
You need to wait for dns verification, can take a while.
You also need to take the Sandbox into account and open a ticket to move out from it.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
To help protect our customers from fraud and abuse and to help you
establish your trustworthiness to ISPs and email recipients, we do not
immediately grant unlimited Amazon SES usage to new users. New users
are initially placed in the Amazon SES sandbox. In the sandbox, you
have full access to all Amazon SES email-sending methods and features
so that you can test and evaluate the service; however, the following
restrictions are in effect:
You can only send mail to the Amazon SES mailbox simulator and to
verified email addresses and domains.
You can only send mail from verified email addresses and domains.
You can send a maximum of 200 messages per 24-hour period.
Amazon SES can accept a maximum of one message from your account per
second.

Hosting Google Domain on AWS EC2

I'm not sure if this is the place to ask this.
I recently bought a domain from Google and setup email forwarding so that emails sent to 'me#domain.com' get sent to the gmail of the account that owns the domain, then I stared an ec2 instance on AWS. I changed my nameservers in Google domains so that when I go to my domain, I get my ec2 instance and this works correctly.
However, now my email forwarding no longer works, so I tried setting up a MX in route 53 on AWS using
5 gmr-smtp-in.l.google.com.
10 alt1.gmr-smtp-in.l.google.com.
20 alt2.gmr-smtp-in.l.google.com.
30 alt3.gmr-smtp-in.l.google.com.
40 alt4.gmr-smtp-in.l.google.com.
with no name as I have read online. I am still not recieving emails like i used to and am unsure what to do. Thanks in advance
Have you considered using AWS SES and AWS Lambda to forward your emails?
First, you need to verify your domain - Amazon SES Domain Verification TXT Records
Second, create an S3 bucket with a unique and meaningful name. This will be used to store emails, for example ascisolutions.com-emails . Create a folder inside this bucket to store emails.
Third, create a Lambda function to forward the emails. See AWS Lambda SES Email Forwarder for files needed for AWS Lambda and instructions how to set it up as it requires to modify a config file.
Next, you need to create a rule set - Creating a Receipt Rule Set for Amazon SES Email Receiving
After that, you need to create a rule in the new rule set to let SES know what to do with the email that it received - Creating Receipt Rules for Amazon SES Email Receiving
Next, you want to update your MX records - Publishing an MX Record for Amazon SES Email Receiving
When you're done, wait a few minutes for DNS to update and then test to see if email forwarding is working.
Hope this was helpful.

Changing MAIL FROM Domain in Amazon AWS SES

I'm using a marketing email application called Mautic to use AWS SES to send emails. I'm receiving the emails successfully but they're all from the domain amazonses.com. I followed the AWS SES documentation to verify ownership of my domain, I enabled SPF and DKIM successfully, and I put the proper MX records into my GoDaddy DNS. Everything is 'verified' in the AWS Console, but I'm not sure how to get it to use the "MAIL FROM" domain I've setup. Mautic has no settings with respect to the "MAIL FROM" domain so I'm pretty sure I'm just missing the last step on the SES in order to get it to actually use the 'from' domain I've setup.
Please let me know if I can provide any more details that might be helpful. Thanks for your time in advance!
I had the same issue, but it was because I had verified my email address before I set up the MAIL FROM domain. In this case, if you look at the details for the verified email address, you will see the MAIL FROM domain set to amazonses.com. It appears that SES uses this value when sending from this email regardless of the MAIL FROM domain setting.
Since my domain is verified, my solution was to simply delete the verified email. Now when I send emails, it uses the domain default which is my MAIL FROM domain setting.
If you are using verified email addresses, check that it shows the MAIL FROM domain that you want to use in the details.
Ah, I figured it out. In Step 8 of this document it says "You can now use Amazon SES to send email that is signed using a DKIM signature from any valid address in the verified domain." I didn't realize I had to have a verified email from this domain under the "Email Addresses" section of the SES console. I created an email address in my domain, verified it using SES, and now my application can use SES to send email on behalf of my own domain!
AWS also has a Custom Mail From domain setup option. Here is the doc:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from.html
Follow the directions very carefully and don't forget you need an SPF record for the new subdomain you create for the Mail From - otherwise SES won't pass it in the header.