On Tuesday, March 22 at 08:53 PM, quoth Valerio Granato:
> Hi all!
> 
> I'm having a problem handling .qmail files containing spamassassin
> commands. I need this command:
> 
> |/usr/bin/spamc -f -s 262144 -u [EMAIL PROTECTED] | /usr/bin/maildir 
> %dir%/Maildir
> 
> but everytime I use moduser the file get scrambled.

Because qmailadmin doesn't understand this [EMAIL PROTECTED] and %dir% 
stuff?

Personally, I construct it with procmail. So, my .qmail files contain:

    |/usr/bin/procmail -p /var/lib/vpopmail/procmailrc

...which was set with --enable-spam-command. Then in that procmailrc 
file, I have something like this:

    REALUSER=`echo $EXT | /usr/bin/tr A-Z a-z`
    REALDOMAIN=`echo $USER | /usr/bin/tr A-Z a-z`

    :0 fw: [EMAIL PROTECTED]
    |/usr/bin/spamc -u [EMAIL PROTECTED]

    :0
    /var/lib/vpopmail/domains/${REALDOMAIN}/${REALUSER}/Maildir/

You can do the same with a shell script. For example, you can use 
--enable-spam-command=/usr/local/bin/filtermail.sh and then create 
/usr/local/bin/filtermail.sh to look like this:

    #!/bin/sh
    REALUSER=`echo $EXT | /usr/bin/tr A-Z a-z`
    REALDOMAIN=`echo $USER | /usr/bin/tr A-Z a-z`
    MAILBOX=/var/lib/vpopmail/domains/${REALDOMAIN}/${REALUSER}/Maildir/
    spamc -u [EMAIL PROTECTED] | /usr/bin/maildir $MAILBOX

I'm sure you can do the same with any other MDA, like maildrop or 
something. Use your imagination.

Hope that helps,
~Kyle
-- 
It is not bigotry to be certain we are right; but it is bigotry to be
unable to imagine how we might possibly be wrong.
-- Gilbert Chesterton

Attachment: signature.asc
Description: Digital signature

Reply via email to