Steffen Kaiser
2007-May-09 13:31 UTC
[Dovecot] PATCH: sendmail-like DSNs in Dovecot deliver (EX_TEMPFAIL always)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've put together an always tempfail & sendmail-like DSN report back patch. Because I don't know how to transform the rejection reason into sysexit.h codes, it always tempfails. The hooks are so that: a) config file setting: lda_mode = mode b) command line: deliver --mode mode where mode is default or sendmail. When no mode is specified, it defaults to "default", which is the current behaviour. In sendmail mode, mail_send_rejection() simply prints the rejection reason to stdout, logs it and returns EX_TEMPFAIL. Ideally, the return value would be specific to the reason. I haven't poked into this deeply, but it doesn't look straight forward. Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRkHNQS9SORjhbDpvAQIhdggAq79RHKa1gIUTFwAu7Gd2maIUkDTgbNu6 8+MEQHujOPkV6wcF+5ih/hkht5BnuBUiIbnp2dvKGaUcHY8avzYD6BEc6gIAyJjM YIKDANI5+BVnQWUdiQMlQrSrRIZBqFziL8v/LvICJUsiOqCKT7se37KuUOK14gXO FSghuPta0rorogJ8kh+VGdmnqNVzKb6eKrnFQUggiezTmTcHY6/DRsLbsKV//fyW cybualj+THF9cj+EajwCMsYypc9KOdVg6lhcCD87oskDmMqcG5lwF2HU9nclnMxE 6pOnaLGNfKmWyeAKOLgvMimjhkU74+NBwQ+b4h61JzZ6lbiZKWX7wA==gE8Z -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: deliver_sendmail.patch.gz Type: application/octet-stream Size: 1319 bytes Desc: URL: <http://dovecot.org/pipermail/dovecot/attachments/20070509/9c45fcf3/attachment-0002.obj>
Matthias Andree
2007-May-09 13:46 UTC
[Dovecot] PATCH: sendmail-like DSNs in Dovecot deliver (EX_TEMPFAIL always)
Steffen Kaiser schrieb:> Hello, > > I've put together an always tempfail & sendmail-like DSN report back patch. > > Because I don't know how to transform the rejection reason into > sysexit.h codes, it always tempfails.Just read /usr/include/sysexits.h and pick the best fit, such as EX_NOPERM. 8-)
Timo Sirainen
2007-May-13 15:16 UTC
[Dovecot] PATCH: sendmail-like DSNs in Dovecot deliver (EX_TEMPFAIL always)
On Wed, 2007-05-09 at 15:31 +0200, Steffen Kaiser wrote:> The hooks are so that: > > a) config file setting: > > lda_mode = mode > > b) command line: > > deliver --mode mode > > where mode is default or sendmail. > > When no mode is specified, it defaults to "default", which is the current > behaviour.Since I can't think of any other modes, how about just a simple -e parameter which means that rejections are done by writing the error to stderr and exiting with EX_NOPERM.> In sendmail mode, mail_send_rejection() simply prints the rejection reason > to stdout, logs it and returns EX_TEMPFAIL.Shouldn't it be stderr, not stdout? Although I guess both might work.> Ideally, the return value would be specific to the reason. I haven't poked > into this deeply, but it doesn't look straight forward.I don't think there are any useful exit codes in sysexits.h. Hmm. Deliver fallbacks always trying to write mail to INBOX if it couldn't write it elsewhere. So INBOX writes can fail only with: 1. permission problems 2. out of quota In INBOX cause 1. is probably a configuration problem. In this case it should be treated as temporary problem. 2. should probably be configurable, as some people want it to be a temporary failure and others want it to be a permanent failure. I guess I'll have to go and fix Dovecot's error handling a bit. For now I added the -e parameter. Currently it only works if the delivery actually fails. I'm not sure how I should handle rejections in Sieve scripts. http://dovecot.org/list/dovecot-cvs/2007-May/008761.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070513/5bbf96a0/attachment.bin>
Steffen Kaiser
2007-May-14 08:48 UTC
[Dovecot] PATCH: sendmail-like DSNs in Dovecot deliver (EX_TEMPFAIL always)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 13 May 2007, Timo Sirainen wrote:> Since I can't think of any other modes,I'm going to look into adding LMTP to deliver ;-) sendmail supports LMTP even for a spawned LDA rather than a LMTP deamon. However, I don't know what to prefer.> Shouldn't it be stderr, not stdout? Although I guess both might work.Well, I'm not sure. But as far as I know sendmail communicates primarily with stdin/stdout with the LDA (as inetd). However, for permanent failures both stdout and stderr are joint together. I haven't read the sendmail sources well enough to find the actual piece of code, though.> For now I added the -e parameter. Currently it only works if the > delivery actually fails. I'm not sure how I should handle rejections in > Sieve scripts. http://dovecot.org/list/dovecot-cvs/2007-May/008761.htmlI think Dovecot should. Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRkgiTy9SORjhbDpvAQJQXwgAvqA59iy/9iIbbyq5QxK+or0aslb1oBvf oLmnEsafskweYr0zUMnyKmV3UEWFn5Oh/oX/5azLA8TFeDfqf8lFwu1VfByngIW0 zzkDmA3+ldWgjqLVRegNMF94dChCdktMy7q1CWo0hBnLAtVIM+4X0u+OKZqKqEM0 F2bd2LYbeSeBGnTp6LkMi5y28r4u8+T6xJXrmn0TzDSiW3BAlLIgp11rlnn6UgoB 1LC0amTV9uaTzJTU0HB2u9p+DbCnfyLVeK3AQt7bNpIsVfE4AHMe6MClrt8W7ZBB AiU3P1h/p29oWT9EDsaclDTJMCJEmn995Eg/+jq6YTDFnk3WfbscLw==hL0g -----END PGP SIGNATURE-----