Hacker News new | ask | show | jobs
by chrizel 944 days ago
We 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.
3 comments

Hm, many MTAs do return a unique queue ID when they accept a message over SMTP. Does SES not implement that?
Any examples? Curious how they do it. Just extra info in the 250 OK response to the DATA command?
RFC 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)

Yeah, 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.
Why would the Message-ID (that you assign) not work for this purpose? Perhaps the SNS notification doesn't include the message-id?
SES does not allow the caller to set the id of the message and instead assigns one when you make the call.

It is a bit painful for idempotency.

Interesting thanks. I can imagine that an email sending service wants to be in control of message-id's (would still be interesting to hear the actual rationale).

Perhaps SMTP could use an extension with a new (pipelined) command after DATA, so a client can retrieve the assigned message-id.

I wonder how common it is for message-id's to be overwritten. I must have run into this SES behaviour (along with other problems) when trying to use it as backup for outgoing mail for my mail server: My DKIM signatures include the message-id header, overwriting the header will invalidate them.

Thanks 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