[mdlug] forward files

Drew drew4096 at gmail.com
Mon Aug 25 14:52:52 EDT 2008


     I once had a mail handler on grex and m-net that was activated 
by a .forward file, and would like
to set one up again to dump spam. However, when testing it on my own 
system I'm running into a
snag. When I first set it up, mail behaved normally, ie, the .forward 
file was ignored; and with .forward's
execute bits turned on, mail is now just disappearing.

     The .forward file reads as follows:

"|/home/drew/spamtrap"

(I've tried both with and without the quotes.)

     And the script:

#!/bin/bash

LOGFILE='/home/drew/spamlog'
MAIL_DESTINATION='/home/drew/spam'

read -r FIRSTLINE
echo $FIRSTLINE >> $LOGFILE

for ENTRY in `cat /home/drew/.whitelist`
do
     if ( echo $FIRSTLINE | grep -i $ENTRY > /dev/null )
     then
         MAIL_DESTINATION='/var/spool/mail/drew'
         echo Approved for delivery >> $LOGFILE
     fi
done

echo $FIRSTLINE >> $MAIL_DESTINATION

while read -r NEXTLINE
do
     echo $NEXTLINE >> $MAIL_DESTINATION
done


Both files are chmodded 755.
What am I missing?

----

- Drew.




More information about the mdlug mailing list