August 27, 2004

[postfix] add footer or header to every outgoing and incoming message

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

Posted by pank at August 27, 2004 11:02 AM
Comments
Post a comment













Remember personal info?