Posted: 19 Mar 2018 1:26 EDT Last activity: 4 Apr 2018 7:26 EDT
SMTP error handling
We have a button where user can send an e-mail that attaches all files attached to the work object to external e-mail address. This SMTP process is asynchronous with work object and it may get errors afterwards; file size is over limit, e-mail address does not exist, etc. Though, this e-mail is very important and user wants to know if it gets any kind of errors. What would be the best approach to implement this requirement?
One way to do it is monitor inbound e-mail from MAILER-DAEMON but there are a couple of hurdles for this - One, I don't know how easy it is to map which work object the incoming error e-mail is related to, or which error code it is. Two, I am not even sure if all kinds of errors can be received from MAILER-DAEMON by e-mail. Anyways, it is asynchronous and it is a lot to build.
Is this the only approach? If so, any tips from anyone who built this?
Thanks for the comment. I have actually built out some PoC which listens DSN (Delivery Status Notification) for SMTP and process it. Just for the record, I have documented how to do it as attached. Hope this helps someone who may have similar questions.