分类: BSD
2007-11-21 01:30:46
This document outlines how to properly integrate the Maildrop filtering mail delivery agent with the Postfix mail transfer agent.
These instructions are given without any warranty. Use at your own risk. Consult your software documentation if in doubt.
The legal status of this document is given in the Appendix below.
The Maildrop installation is described in the INSTALL document that ships with the maildrop tarball.
./configure
Added 2002-04-23: As maildrop does not currently report "Invalid user" as permanent error, I made a against maildrop that lets it exit with EX_NOUSER rather than EX_TEMPFAIL when an invalid user is specified to the -d option. Download the patch, unpack maildrop, cd to maildrop's top source directory and apply with
patch -p1
– of course, change the path to the .diff file according to where you saved the patch.
Then proceed as instructed in the maildrop INSTALL document.
This patch isn't needed for mailbox_command setups, but as this document will add more methods to call maildrop that will need the patch, the description is here. And correctness doesn't hurt.
You may want to create a /etc/maildroprc file that contains lines like these (missing Maildir/s can be created with maildirmake(1)):
For Maildir delivery:
import SENDER
DEFAULT=$HOME/Maildir/
For home mbox delivery (untested!):
import SENDER
DEFAULT=$HOME/mbox
For system mbox delivery (untested!):
import SENDER
DEFAULT=/var/mail/$LOGNAME
I recommend importing the SENDER environment variable as in my installation, the FROM variable was not set properly, for reasons unknown yet.
Remember: Postfix folds the local part of addresses to lower case when delivering, that includes the address extension. Keep that in mind when writing your .mailfilter files.
It is assumed that you already have a running installation of Postfix.
Edit /etc/postfix/main.cf as follows:
mailbox_command = /usr/bin/maildrop -d "$USER" -f "$SENDER" "$EXTENSION"you may need to adjust the path to maildrop, e. g. to /usr/local/bin/maildrop.
If you are migrating from procmail to maildrop, some of your users may still have .procmailrc files in use. This section shows how your users can call their .procmailrc from their .mailfilter files.
On my system, the variable $FROM within maildrop does not have the right envelope sender, for reasons unknown yet. If your /etc/maildroprc contains the import SENDER line as written above, this will work to pass the control to procmail:
to "|/usr/bin/procmail -t -o -f \"$SENDER\" -a \"$1\" -d \"$LOGNAME\""Remember, the SENDER variable is available only after import SENDER!
Maildrop home page | |
Postfix home page |
Copyright © 2002—2003 Matthias Andree.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover and no Back-Cover Texts.
The GNU Free Documentation License is available at .
$Id: HOWTO-maildrop.html,v 0.6 2003/06/17 00:36:54 emma Exp emma $
$Log: HOWTO-maildrop.html,v $
Revision 0.6 2003/06/17 00:36:54 emma
Revive maildrop NO_USER patch, as Postfix still lets sendmail(1)-injected
mail near maildrop when maildrop is used as {local,mailbox}_transport.
Revision 0.5 2003/05/20 13:10:34 emma
Change mail address to gmx.de.
Revision 0.4 2003/05/20 13:09:12 emma
Comment out link to maildrop patch.
Revision 0.3 2002/04/23 15:24:36 emma
Add patch instructions and reference to maildrop EX_NOUSER patch.
Revision 0.2 2002/04/12 13:54:30 emma
minor cleanups, now proper HTML.
Revision 0.1 2002/04/12 13:47:53 emma
initial release.