Chat
chat US Cluster chat chat Malaysia chat chat Singapore chat chat Backup chat
Internet Chat
chat Home chat chat Chat Help chat chat Chat Rules chat chat Members chat chat Games chat chat About Us chat  
"Fun & Friendly Chat & Games since 1995"
About Us
Alamak Offices
Contact Us
Free Speech & Privacy
What's Happening
Alamak News
Vpopmail smtpd-chkusr with TMDA Python

 Filtering with maildrop

I get mail from several sources which I don't like to read but I do want to save. The aim is to automatically filter these into special mailfolders but vpopmail installation breaks the usual qmail condredirect method to other dot-qmail files. One alternative is to use maildrop.

As usual what seems easy initially can take you all day! The end result was pretty simple if you happen to know the snaffoos. br>
Just add this to your dot-qmail file in ~vpopmail/domains/mydomain.com/myuser/.qmail.
| maildrop mailfilter
| preline tmda-filter -S ~vpopmail/bin/vpopmail-vdir.sh
./Maildir/


This allows me to filter off some stuff with maildrop and exit 99 which will stop execution of the rest of the dot-qmail file. If there is no match the dot-qmail is processed as usual which means those that don't match my maildrop filters I can block with TMDA.

Make a ~vpopmail/domains/mydomain.com/myuser/mailfilter like...
VHOME=`/d/vpopmail/bin/vuserinfo -d $EXT@$HOST`
if (/junk\.com/:h)
{
        exception {
                EXITCODE=99
                to "$VHOME/Maildir/.JUNK/"
        }
}
else
{
        if (/1rez/:h)
        {
                exception {
                        EXITCODE=99
                        to "$VHOME/Maildir/.1REZ/"
                }
        }
}


Make sure the "if (condition)" and the bracket "{" are not on the same line, it is significant! Sometimes the stupidest things wastes hours of your time!
Make sure you chmod 600 .qmail mailfilter. If you tail -f /var/log/maillog the debug complains about being world readable but Maildrop will fail with this error if the files are group or world readable, see the maildrop man page!

Don't forget to make your folders with your mail agent, I used sqwebmail but I think you can also use /usr/local/bin/maildirmake. Then test by sending emails from a normal email and then one that will match your maildrop filter, I used sqwebmail.

chat
chat
chat