Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: users

Dbmail and per-user procmail configuration

 

 

DBMail users RSS feed   Index | Next | Previous | View Threaded


cww at denterprises

Apr 29, 2008, 7:51 AM

Post #1 of 1 (39 views)
Permalink
Dbmail and per-user procmail configuration

I wasn't able to find much in the way of useful information while
searching for dbmail and per-user procmail configurations. So, I rolled
my own, based on some of the stuff I found, and I'd like to post it here
for the archive. If any of you have comments, they are certainly
welcome. :)

Naturally, this uses Postfix as the MTA. :P

### Begin example ###

# /etc/postfix/master.cf
# This creates a service called procmail which is used to deliver
# the mail. See `man 8postfix pipe` for more information. The
# -a argument passed to procmail sets ${recipient} as the $1
# variable in the procmailrc file. ${recipient} is the fully-
# qualified email address of the recipient, e.g.
# user@[host.]domain.tld. Note there should not necessarily be
# a line break between ${recipient} and /etc/procmailrc.

procmail unix - n n - 4 pipe
flags=DRhu user=dbmail argv=/usr/bin/procmail -a ${recipient}
/etc/procmailrc

# /etc/postfix/main.cf
# This tells Postfix to use the new procmail service to deliver mail.

mailbox_transport = procmail

# /etc/procmailrc
# Note the INCLUDERC line, which includes an RC file based on the
# recipient's fully-qualified email address. If this file does not
# exist, procmail ignores it and continues, which I think is quite
# useful. The LOGFILE line produces per-user logs, which should be
# rotated or otherwise managed in the usual way.

MAIL_DELIVERY="/usr/sbin/dbmail-smtp -d $1"
LOGFILE=/usr/local/var/log/procmail/$1.log
INCLUDERC=/usr/local/etc/procmailrc/$1

:0
| $MAIL_DELIVERY

# /usr/local/etc/procmailrc/cww[at]pony.denterprises.org
# This is an example of what one might put in a per-user procmail
# script. For testing purposes, this one just delivers anything
# with 'foobar' in the subject to a special mailbox called CMUbox.

:0
* ^Subject.*foobar
| $MAIL_DELIVERY -m 'CMUbox'

### End example ###

I've been toying around with the idea of having per-user pre- and post-
procmail scripts, where a global spam filter would be applied to the
incoming email between the pre- and post- stages. I'm not sure whether
that's a good idea or not, based on my requirements.

Colin
_______________________________________________
DBmail mailing list
DBmail[at]dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail

DBMail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.