gen_smtp: be notified on failed delivery message
Wed Jan 13 20:59:42 CET 2021
There are basically 2 classes of errors.
1. Errors which are derived from the delivery process. These would include
a) network errors (nxdomain etc)
b) mailboxes not existing/disabled etc (response to RCPT TO command.
Be aware that many servers do *not* follow the RFC and will lie)
c) the dreaded 'blocking' of you connection for whatever reason the
remote server decides to use
2. 'soft bounce' errors:
These occur when certain servers, eg outlook, will accept an email
for delivery, and then email you back to tell you about some type of
You'd need to have a server receiving mail to receive the 'soft'
errors since they are email back to you and not part of the SMTP
There is a 3rd class of error (Yahoo/AOL and friends):
Their servers will say that the mailbox exists (in response to RCPT
TO:) and then tell you a mailbox does not exist _after you send your
On Wed, Jan 13, 2021 at 1:31 PM Frank Muller <frank.muller.erl@REDACTED> wrote:
> Thanks for the pointers Marc.
> Do I need to implement the server part to check for errors? Can’t the gen_smtp “client” be notified in case of misspelled address (or unresolved domain, MX, etc.)?
> Wed. 13 jan 2021 10:25, Marc Worrell <marc@REDACTED> wrote :
>> Hi Frank,
>> Yes, gen_smtp can report failures that happen during communication with the remote smtp server.
>> Will also report failures if it can’t resolve the domain or find a MX server.
>> Late bounces (sent by the remote mail agent) must be handled by your own code.
>> In Zotonic we have an example of handling such bounces.
>> Check for our mail sending code (which also uses mnesia for queueing):
>> And for receiving email, including parsing and handling of bounce messages:
>> On 13 Jan 2021, at 09:18, Frank Muller <frank.muller.erl@REDACTED> wrote:
>> Hi everyone
>> I’m considering using gen_smtp (https://github.com/gen-smtp/gen_smtp) in one of my apps.
>> Question: is there a way to be notified on failed delivery message if for example the destination email address was misspelled?
More information about the erlang-questions