Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3270866
  • 博文数量: 815
  • 博客积分: 12898
  • 博客等级: 上将
  • 技术积分: 7883
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-25 09:57
文章分类

全部博文(815)

文章存档

2014年(1)

2011年(46)

2010年(192)

2009年(121)

2008年(70)

2007年(385)

分类: BSD

2007-11-21 01:30:46

1. Introduction

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.

2. Installing and Configuring Maildrop

2.1 Install Maildrop

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.

2.2 Configure Maildrop

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.

3. Configuring Postfix

It is assumed that you already have a running installation of Postfix.

3.1 The Compatible and Easy Way

Edit /etc/postfix/main.cf as follows:

  1. add an appropriate local_recipient_maps entry. See LOCAL_RECIPIENT_README for details.
  2. comment out all mailbox_command lines.
  3. add a line
    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.
  4. Run the command postfix reload from a root shell.

4. Migration hints

4.1 How to call procmail from 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!

Appendix

A. References

Maildrop home page
Postfix home page

B. License

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 .

C. History

    $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.

阅读(2708) | 评论(0) | 转发(0) |
0

上一篇:maildrop

下一篇:Postfix + Maildrop Howto

给主人留下些什么吧!~~