[Tickets #5816] Added more tests to maildrop Script and fixed REJECT action

bugs at bugs.horde.org bugs at bugs.horde.org
Thu Oct 18 12:38:16 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=5816
-----------------------------------------------------------------------
 Ticket             | 5816
 Created By         | horde at nospam.obeliks.de
 Summary            | Added more tests to maildrop Script and fixed REJECT action
 Queue              | Ingo
 Version            | 1.1.2
 Type               | Enhancement
 State              | New
 Priority           | 1. Low
 Owners             | 
+New Attachment     | horde-ingo_maildrop-support.diff
-----------------------------------------------------------------------


horde at nospam.obeliks.de (2007-10-18 05:38) wrote:

This patch addresses three issues (all are still relevant in cvs, but the
patch was generated against 1.1.2):

1. It adds the "is" test, as well as all negated versions of the currently
available tests (i.e. 'not contain', 'is', 'not is', 'not begins with',
'not ends with') by prefixing the patterns with "! ".

2. It fixes the REJECT action for maildrop scripts. The current version
uses "EXITCODE=reject reason", which is bogus, because maildrop needs a
numerical exit code value. In order to pass a reject reason to the MTA, the
latter must support reading it from the program output (e.g. postfix >=
2.3).
My code sets EXITCODE=77 (EX_NOPERM) and echoes "5.7.1 Reject Reason" to
stdout before exiting. This way, if the MTA supports reading RFC3463 Status
Codes from program output, it will provide the intended error message,
otherwise it should still reject the message permanently.
fyi: 5.7.1 is the status code Postfix uses to reject messages (if no other
code is given)

3. The current Maildrop script strips a leading "INBOX." from path names,
which might be correct if INBOX is used as the root of the Maildir.
However, IMAP servers like Dovecot support having root folders next to the
INBOX. In such setups, the current code fails completely. 
Therefore, I introduced another backend-parameter, strip_inbox, which
let's the admin configure this behaviour. Maybe a more elegant approach
would be to introduce a third mailbox format ("mbox", "maildir",
"maildir-inbox" or similar).


The code has been tested briefly, and has so far created no problems on my
system (postfix+dovecot+custom maildrop script).

hth, Bernhard Frauendienst



More information about the bugs mailing list