5 ms·
Trap and test AWS SES emails locally
- isuckatcoding 3y agoYou should get this merged into awslocal Edit: uh never mind https://docs.localstack.cloud/user-guide/aws/ses/ https://docs.localstack.cloud/user-guide/aws/ses/
- hardwaresofton 3y agoDoes anyone have a good reason they normally fall back on for using the AWS SDK vs the provided SMTP bridge? Rate limits or anything of the sort? I find that basically every transnational email service supports SMTP so I normally code to that and call it a day…
- rzzzt 3y agoIf you want to test SMTP mail delivery, there's MailCatcher: https://mailcatcher.me/ https://mailcatcher.me/
- imankulov 3y agoThere are several alternatives. Most of them, including mailcatcher, seem to be unmaintained. Mailpit is an alternative that has regular updates: https://mailpit.axllent.org/ https://mailpit.axllent.org/
- nickcotter 3y agoThanks for the link - we’ve been using mailhog for local smtp testing and it still works ok for basic tasks, but it’s not maintained any more.
- nickjj 3y ago> Most of them, including mailcatcher, seem to be unmaintained. MailCatcher is great. It "just works" and has Docker images for both AMD64 and ARM64 CPUs.
- hardwaresofton 3y agoYeah thanks for this, I’ve been using it for years! Recently switched to mailslurper: https://github.com/mailslurper/mailslurper https://github.com/mailslurper/mailslurper
- mjl- 3y agoPitching my own: https://github.com/mjl-/mox https://github.com/mjl-/mox has a "mox localserve" subcommand that runs a mail server on localhost for testing, including a pedantic mode and special addresses that cause failure conditions you may want to test for. This is actually a full mail server (SMTP, IMAP and much more) and it comes with a webmail client. The "localserve" mode was just so easy to implement that I couldn't resist.
- dharmab 3y agoNot for production stuff, but for quick hacks I'll wire it up to SNS and send emails via SNS queue.
- meroje 3y agoCan’t use an IAM role to auth to the bridge, it only works with user’s keys.
- jjice 3y agoThat's a really great point. I was wondering the same thing as the comment root but this is enough for it to make sense. At the end of the day, having a wrapper email/notification class with an SMTP and moving to a specific SES implementation seems like it'll always be a safe dev path.
- chrizel 3y agoWe switched from using SMTP to the AWS SDK for SES because when sending an e-mail the SDK returns the unique message ID of the e-mail. This allowed us to have a special process for handling bounces in our software by using an SNS HTTP endpoint. So the SDK makes sense for use cases where the SMTP protocol doesn't provide enough information.
- wiml 3y agoHm, many MTAs do return a unique queue ID when they accept a message over SMTP. Does SES not implement that?
- sethammons 3y agoAny examples? Curious how they do it. Just extra info in the 250 OK response to the DATA command?
- meepmorp 3y agoRFC 822 defines a Messsge-id header that the client can set, and most MTAs can be configured to add one if not set by the client. IIRC, they're supposed to be globally unique, but like so many things in email, ymmv. Edit: oh, yeah, there's also a queue id returned in the 250 response (in postfix, at least)
- wiml 3y agoYeah, just in the text of the OK response. So I guess it isn't really very structured. Seems like it would be a useful ESMTP capability to add though - queue identifier and MTA-assigned message-ID.
- amberss 3y ago[flagged]
- hardwaresofton 3y agoThanks for noting this, this is a pretty solid reason — I thought most people tried to correlate other fields on the incoming email but this also makes sense
- stephenr 3y agoIn theory you get higher effective sending rates, however I've not actually proven how much faster in practice.
- traceroute66 3y agoWhy would I use this instead of the AWS SES Simulator ? [1] [1] https://docs.aws.amazon.com/ses/latest/dg/send-an-email-from-console.html https://docs.aws.amazon.com/ses/latest/dg/send-an-email-from...
- deleted 3y ago[deleted]
- stephenr 3y ago> For billing purposes, emails that you send to the Amazon SES mailbox simulator are the same as any other email you send using Amazon SES. In other words, we bill you the same amount for messages that you send to the mailbox simulator as for those that you send to regular recipients.
- traceroute66 3y agoFair enough, I didn't know SES simulator was only zero-affecting for stats and quotas. However then surely this thing is just re-inventing the wheel that LocalStack already invented ?
- ac2u 3y agoSomeone needs to invent a protocol for transferring mail and make it simple.
- navigate8310 3y agoSimple Email Service
- oblio 3y agoSomewhat offtopic, but is there a simple email service in the sense of SMTP + IMAP/POP + simple email web interface to use AWS as a end-user email service?
- petercooper 3y agoI suspect you meant something more independent, but technically yes, AWS provides this: https://aws.amazon.com/workmail/ https://aws.amazon.com/workmail/ While SES can handle both inbound and outbound mail, I think Workmail is the only way to get IMAP and actual hosting of email. I imagine you could set up https://mailinabox.email/ https://mailinabox.email/ on the cheapest EC2 instance and use SES for outbound, though.