Question
Why are some DSN (Delivery Status Notifications) not working?
Answer
DSN (or Delivery Status Notifications) are handled by the MTA (Exim). It is an option that can be enabled via the Exim Configuration (Basic) Editor under the Mail tab. It's called:
Hosts to which to advertise the SMTP DSN option
This simply indicates that a message was sent by the server. Once enabled, you should get back a message stating it was sent (accepted by the receiving server). However, there are no guarantees that the recipient has actually received or even read the message. They may have discarded it, or it was filtered and routed to trash or another folder. Additionally, the receiving server can still bounce the message back or discard it.
You can also test if DSN is enabled on a server, by using the telnet command (if installed).
# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220-server.hostname.tld ESMTP Exim 4.92 #1 Fri, 6 Nov 2020 14:20:49 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
EHLO
250-server.hostname.tld Hello [::1]
250-SIZE 52428800
250-8BITMIME
250-DSN <<<<---- If you see this, it's enabled.
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
Note: LMTP (Local Mail Transfer Protocol) does not support DSN. RFC-2033
Having the delivery agent communicate status with an exit code has three serious problems.
- The MTA (Mail Transport Agent or Exim) can only return a single exit code to all recipients.
- It isn't easy to extend the interface to deal with ESMTP extensions such as DSN and ENHANCEDSTAUTSCODES.
- Exits performed by the system libraries caused by temporary conditions may get interpreted as permanent errors.