edit master.cf
smtp inet n n n - - smtpd
-o content_filter=filter:
filter unix - n n - - pipe
flags=Rq user=filter argv=/path/mailfilter.sh ${sender} ${recipient}
edit /path/mailfilter
# file mailfilter.sh
# this sample script add http://pank.org at the bottom of message
TEMP=/tmp/temp-$$.eml
cat > $TEMP
RCPT=`echo $@ | cut -d' ' -f2-`
{
cat $TEMP
echo -e "\n--\nhttp://pank.org\n"
} | $SENDMAIL -i $RCPT
rm $TEMP
Leave a comment