[Troy and Mitch were discussing usage of maildroprcs and .mailfilter with includes
maildroprcs ...]
Pardon me, what's wrong using just a /etc/courier/maildroprc like this:
--- snip ---
[EMAIL PROTECTED] mirko]$ cat /etc/courier/maildroprc
import SENDER
import RECIPIENT
import HOME
import USER
PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/courier/bin/
INBOX="Maildir/"
DEFAULT="$INBOX"
SPAMFLD="$INBOX.Trash/"
SHELL=/bin/ash
xfilter "reformail -A 'X-Maildrop-HOME: $HOME' -A 'X-Maildrop-SENDER: $SENDER'
-A 'X-Maildrop-RECIPIENT: $RECIPIENT' -A 'X-Maildrop-USER: $USER'"
# create some needed directories
`test -d "$SPAMFLD"`
if( $RETURNCODE == 1 )
{
`maildirmake "$SPAMFLD"`
}
# filter message
if ( $SIZE < 512000 )
{
xfilter "/usr/bin/spamc -U /var/run/spamassassin.sock -u $USER"
}
if ( /^X-Spam-Status: Yes,/ )
{
DEFAULT="$SPAMFLD"
}
--- snap ---
The trick is to supply a value for SHELL, otherwise this snippet will not work.
I use ash because it is much smaller than bash and starts much faster:
--- snip ---
[EMAIL PROTECTED] mirko]$ ash
$ ps u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mirko 26397 2.4 0.7 4896 1940 pts/6 S 13:45 0:00 /bin/bash
mirko 26443 0.0 0.1 1448 436 pts/6 S 13:45 0:00 ash
mirko 26444 0.0 0.2 2632 688 pts/6 R 13:45 0:00 ps u
[EMAIL PROTECTED] mirko]$ time bash ls
ls: /bin/ls: cannot execute binary file
real 0m0.044s
user 0m0.010s
sys 0m0.030s
[EMAIL PROTECTED] mirko]$ time ash ls
ash: Can't open ls
real 0m0.005s
user 0m0.000s
sys 0m0.000s
[EMAIL PROTECTED] mirko]$
--- snap ---
For interactive usage I wouldn't recommand ash, as it does not offer bash's
whistles and bells (no completions, no history, no startup files), but for
simple scripts running often it's just perfect.
I am running spamd with the following options:
[EMAIL PROTECTED] mirko]$ cat /etc/sysconfig/spamassassin
# Options to spamd
SPAMDOPTIONS="-d -c -a -x -u vmail --virtual-config-dir=/home/vmail/domains/%d/%l
--socketpath=/var/run/spamassassin.sock"
as I do not deliver mail locally, using userdb to administer my virtual
domains.
You need spamassassin >= 2.6 to use the virtual-config-dir option like above.
Regards
Mirko
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users