drewr / postal

Clojure email support
MIT License
587 stars 85 forks source link

Return the reply from SMTP server when sending single message #92

Open ljosa opened 6 years ago

ljosa commented 6 years ago

Return the reply because it may contain useful information for logging and tracking. In particular, Amazon SES insists on assigning a new Message ID rather than trusting the one we send them, and they return the assigned Message ID in the reply, after "250 Ok".

Only do this when smtp-send is called with a single message. (This is the common use case, which is documented and supported by postal.core.)

If someone manages to call smtp-send with multiple messages, then return a response without the server replies, as before. (The alternative, which is to complicate the response from smtp-send to incorporate multiple replies while remaining backwards compatible, does not seem worth it---especially because sending multiple messages at a time is not something you should do if you care to know which ones succeeded.)

drewr commented 6 years ago

This is great, thanks @ljosa! Left a question but otherwise looks good.