Set-Up for postfix + procmail sans local users

The goal in my setup is to remove the local users from the local delivery for email. This enables me to have many more users than I do local users in the linux passwd file. But I also want to use the flexibility of procmail to improve the filtering of spam and other stuff.

Ordinarily procmail is used via the postfix mailbox_command= statement. But this only applies to local users. Instead you need to edit postfix main.cf with

#/etc/postfix/main.cf
mailbox_transport=procmail

This sets up a procmail transport that you need to identify in master.cf:

#/etc/postfix/master.cf
procmail  unix  -       n       n       -       4       pipe
        flags=DRhu user=mail argv=/usr/bin/procmail -a ${recipient}

(NOTE: I stole this from a reference for maildrop…) This puts all the email from postfix into procmail using only the rules in /etc/procmailrc

#/etc/procmailrc
LOGFILE=/var/log/procmail.log
DEFAULT="| /usr/sbin/dbmail-smtp -d $1"
LASTFOLDER="| /usr/sbin/dbmail-smap -d $1"
LOGABSTRACT=yes
VERBOSE=yes
COMSAT=no

# remove duplicated emails - ie: mailing list replies.
:0 Wh: msgid.lock
| formail -D 2048 msgid.cache

:0
| /usr/sbin/dbmail-smtp -d $1

:0e
{ EXITCODE=75 HOST }

At this point, the actual procmail script processes all email delivered to dbmail. With the exception of the formail statement above, this code actually doesn't really do anything. But if you want to insert something like spam filters or other custom goodies that aren't available from postfix content_filters – this is the place to put it.

Enjoy!!


If you call procmail as /usr/bin/procmail -p then it will keep the environment postfix provides; the procmailrc will then have access to the variables DOMAIN, EXTENSION, LOCAL, LOGNAME, RECIPIENT, SENDER et cetera (cf “man 8 local” for the full list).

This of course does not preclude also adding ”-a” options (as done above) to pass additional arguments to the procmailrc. 新しい出会いと大金を儲けることが可能です http://see.jk98r.cn 家出少女が泊まるところを探して家出サイトに集まっています http://see.3rg3.cn カワイイあの子をエッチ診断してそのままHしちゃおう! http://see.gh384g.cn 女性のオナニーを見るだけで大金を得ることが出来てしまうのです http://see.fg83q4.cn 少しの時間だけでもいいのでお話しませんか?kyun—v0v-iine@docomo.ne.jp 容姿や年齢、経験は一切不問!期間限定恋人がほしい方はこのサイト! http://see.34yq34y.cn ゲーマーチェッカーであなたのゲーマー度数を測定しよう http://see.g3qgb.cn/ 癒してほしいセレブ達が集まる、セレブラブ http://see.gfh45.cn 家出娘のメッセージが多数書き込みされています http://see.he456j.cn HちぇっくでH度を測定しちゃおう http://see.jetnbg.cn 話題の逆円助サイトで女を抱いて報酬をもらおう http://see.3g3wj.cn 簡単に家出少女と会えちゃう掲示板 http://see.berbn45.cn あなたも不貞行為の刺激を試してみませんか http://see.j7kek.cn SM度をチェックして最高のパートナーをGETしよう http://see.5hw3.cn 簡単な登録制のバイトで好きな時に稼げます http://see.6j46j.cn 誰か割り切りでアタシを満足させてもらえませんか? c.dior_l-3-l_la.al@docomo.ne.jp チェッカーサイトで一番人気、Hチェッカー http://see.2qev2.cn 誰か割り切りでアタシを満足させてもらえませんか? c.dior_l-3-l_la.al@docomo.ne.jp 誰も試したことの無いような一人エッチで快楽を楽しもう http://see.34g46h.cn mixiでの楽しい思い出を再び感じたい方はコチラ http://mixi.050522o.net/ 毎日投稿ムービーが更新されている人気SNSはここ http://nice.k56hy.cn 誰か割り切りでアタシを満足させてもらえませんかlo3ol_jv.vj_favorite-cartier@docomo.ne.jp

 
postfix/procmail.txt · Last modified: 2009/05/22 04:21 (external edit)