[Dovecot] PATCH: Deliver looses mail and DSN if Return-Path is missing
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, Dovecot v1.0.0 if there is no Return-Path in the message and Deliver cannot deliver the message, no DSN is sent _and_ the MTA is returned 0 (aka success) return code, which leads to mail loss. This is not the case, when the message actually finds a Return-Path, but fails to invoke the MTA. - --- src/deliver/mail-send.c (revision 47) +++ src/deliver/mail-send.c (working copy) @@ -42,7 +42,7 @@ i_info("msgid=%s: Return-Path missing, rejection reason: %s", orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80), str_sanitize(reason, 512)); - - return 0; + return EX_TEMPFAIL; } smtp_client = smtp_client_open(return_addr, NULL, &f); Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRkGA0S9SORjhbDpvAQIh0Qf/RUkmWnK+LhB3/ZwY+AnyTAYGBPB7qTCp bVchn4F7zL+W2fIYZGz6YG1bKUtHE3qMQAY3gYijspNZBejS0Z8cTI983ZMwJFP+ ygMAicyEDFSWrFWYnzBnpvHYZEK9VjQ4HnDIkojDQx+pQH0LS/Ve0/JbiaNuwMRQ g0ay3puas8xiyktRHVHslDfbanrfzwpbO7qtNpFrF9aCKo3RLIhFCKSjaXD75BfQ K7XrmOjFECkB1bLeaFJrVzm/DoayRn1HusKQjtwKCRx4YBgOP0d5OQGQTvqRLx33 agHXdNxFN6vYB/QbIMcoI6xyWw6POHpiRjLJ5maWsdhlMFIrRVNOJg== =xshk -----END PGP SIGNATURE-----
On Wed, 2007-05-09 at 10:05 +0200, Steffen Kaiser wrote:
- --- src/deliver/mail-send.c (revision 47) +++ src/deliver/mail-send.c (working copy) @@ -42,7 +42,7 @@ i_info("msgid=%s: Return-Path missing, rejection reason: %s", orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80), str_sanitize(reason, 512)); - - return 0; + return EX_TEMPFAIL; }
I actually did the exact opposite change a few months ago :)
2007-03-26 00:24 Timo Sirainen
On Wed, 2007-05-09 at 11:40 +0300, Timo Sirainen wrote:
On Wed, 2007-05-09 at 10:05 +0200, Steffen Kaiser wrote:
- --- src/deliver/mail-send.c (revision 47) +++ src/deliver/mail-send.c (working copy) @@ -42,7 +42,7 @@ i_info("msgid=%s: Return-Path missing, rejection reason: %s", orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80), str_sanitize(reason, 512)); - - return 0; + return EX_TEMPFAIL; }
I actually did the exact opposite change a few months ago :)
2007-03-26 00:24 Timo Sirainen
* src/deliver/mail-send.c: If we couldn't send a bounce because of a missing Return-Path header, just return success instead of failing with EX_TEMPFAIL.
I'm not sure why I changed that. I think this is a problem only if the SMTP server is misconfigured not to add the Return-Path header? In that case I'll change the above i_info() to i_error() also..
Oh, right, return_address = NULL also if the address isn't valid. In those cases I think it should return 0, because there just isn't anything to be done. So EX_TEMPFAIL should only be returned if the whole Return-Path: is missing I think.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 9 May 2007, Timo Sirainen wrote:
Oh, right, return_address = NULL also if the address isn't valid. In those cases I think it should return 0, because there just isn't anything to be done. So EX_TEMPFAIL should only be returned if the whole Return-Path: is missing I think.
I don't. Some Postmasters may want to inspect failed DSNs and have set the MTA to do something with bounces. When you return "0" here, the MTA believes that the delivery is _successful_ although it is not. Hence, both the mail and the DSN is lost.
BTW: Would it be possible to return the errno of the failed system call to the MTA via the main() return value? I believe that any MTA will act upon these codes and the postmaster can setup the preferred way handling bounces.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBRkGhkS9SORjhbDpvAQKj/ggAxVC1AG8X70+tzFNleWpzpAUd6s7vA6I6 G+A0yWSZt8MUATLqrtLd+kRtvpz3NDb1NhJQrHEd1+ThKBzdiUMPM118/O9sNPku r9BQ4l4Dza51tpexuOVrGxmjyyEC/OJZYaX6f0h/Mbvcsg5Sx7/6wRr8msmjqApi RYR1/CEavfZBroLh5Oa+OT1921Hx8ARDm/k6N2lssUUiC4b6aLx7fhS9RSe9xHUU SLHDAC4Dy/g5A7l0oVTdubwqxC9amft4UofW8XUowBm2zrgBCtwwyaISZhiXHfyu N4GMdbxSsIpNBjkYMfdTemiOwhL/Qhpx/nI/aKMkT7INI/MaHz1xyw== =TiiS -----END PGP SIGNATURE-----
Steffen Kaiser schrieb:
BTW: Would it be possible to return the errno of the failed system call to the MTA via the main() return value? I believe that any MTA will act upon these codes and the postmaster can setup the preferred way handling bounces.
No, the "any" MTA - excluding qmail and other incompatible stuff(*) - will act upon sysexits.h values, not errno values (which are often outside the range for exit codes anyway).
(*) at least it treats EX_TEMPFAIL (75) as temporary failure.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 9 May 2007, Matthias Andree wrote:
No, the "any" MTA - excluding qmail and other incompatible stuff(*) - will act upon sysexits.h values, not errno values (which are often
OK, no objection -> sysexit.h.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBRkG2tC9SORjhbDpvAQK1JggAnwcpu2s59Tda2Rn9wC/WxijERCofrxQ7 nIJi8jQ0Hoo8/lhJrEfMC6Ekgz7DVdgsvhujGKZ8GY5S5pxBrs2MHI9x5FegqhPq Rvb6K723kSMiuVf+Xn0NX7zoAbsEjgVy7ltd9G8M4qCAmSFKs7/ATKL5ith8vM01 Ifngi8xjZgdiuWfB5YpCCLVDus4J371cQjZeDOSwAG5ZPD2D6uib9JS4MdZQ/RAm 3C4j4igGYjGc1eRFyXjVe+5ZOrsOycHqA/l+FqJQ9SZA3oIZFlDrqjSA/xpCEmA3 F+lW0+i7sgCooe+T5BNiV3s7XawZeNe3HL1WsfGUiOW0AQlNsM9/9g== =wiif -----END PGP SIGNATURE-----
participants (3)
-
Matthias Andree
-
Steffen Kaiser
-
Timo Sirainen