I'm trying to set up disclaimers for a few different domains, however since trying to setup alterMIME, no e-mails are being sent out.
In /etc/postfix/disclaimer:
In /var/log/maillog:
Appropriate file permissions are set, all files do exist and are spelled right.... anything I else that I should check/verify?
In /etc/postfix/disclaimer:
Code:
#!/bin/sh
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail
# Define our company address lists
DISCLAIMER_ADDRESSES_COMPANY-A=/etc/postfix/disclaimer_addresses_company-a
DISCLAIMER_ADDRESSES_COMPANY-B=/etc/postfix/company-b
DISCLAIMER_ADDRESSES_AUTOMATED_COMPANY-B=/etc/postfix/disclaimer_addresses_automated_company-b
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15
# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit
$EX_TEMPFAIL; }
cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
# Obtain From address domain
from_address=`grep -m 1 "From:" in.$$ | cut -f 2 -d '@' | cut -d ">" -f 1`
# If the from address matches companya then apply the appropiate disclaimed
if [ `grep -wi ^${from_address}$ ${DISCLAIMER_ADDRESSES_COMPANY-A}` ]; then
/usr/bin/altermime --input=in.$$ \
--disclaimer-html=/etc/postfix/disclaimer_company-a.txt || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
# If the from address matches companyb then apply the appropiate disclaimed
if [ `grep -wi ^${from_address}$ ${DISCLAIMER_ADDRESSES_COMPANY-B}` ]; then
/usr/bin/altermime --input=in.$$ \
--disclaimer-html=/etc/postfix/disclaimer_company-b.txt || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
# If the from address matches companyc then apply the appropiate disclaimed
if [ `grep -wi ^${from_address}$ ${DISCLAIMER_ADDRESSES_AUTOMATED_COMPANY-B}` ]; then
/usr/bin/altermime --input=in.$$ \
--disclaimer-html=/etc/postfix/disclaimer_automated_company-b.txt || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
fi
# Send the email on as per the Postfix stack
$SENDMAIL "$@" <in.$$
exit $?
In /var/log/maillog:
Code:
Jul 1 16:38:43 keith-vps postfix/qmgr[10043]: 10E146C40C59: from=<keith@company-b.tk>, size=1033, nrcpt=1 (queue active)
Jul 1 16:38:43 keith-vps postfix/qmgr[10043]: 1885C6C40C63: from=<keith@company-b.tk>, size=1033, nrcpt=1 (queue active)
Jul 1 16:38:43 keith-vps postfix/pipe[32760]: 1885C6C40C63: to=<keith@company-b.tk>, relay=dfilt, delay=94138, delays=94138/0.01/0/0.1, dsn=4.3.0, status=SOFTBOUNCE (Command died with status 2: "/etc/postfix/disclaimer". Command output: /etc/postfix/disclaimer: line 7: disclaimer_addresses_company-a=/etc/postfix/disclaimer_addresses_company-a: No such file or directory /etc/postfix/disclaimer: line 52: syntax error: unexpected end of file )
Jul 1 16:38:43 keith-vps postfix/pipe[32758]: 10E146C40C59: to=<keith@company-b.tk>, relay=dfilt, delay=92774, delays=92774/0.01/0/0.1, dsn=4.3.0, status=SOFTBOUNCE (Command died with status 2: "/etc/postfix/disclaimer". Command output: /etc/postfix/disclaimer: line 7: disclaimer_addresses_company-a=/etc/postfix/disclaimer_addresses_company-a: No such file or directory /etc/postfix/disclaimer: line 52: syntax error: unexpected end of file )
r directory
Appropriate file permissions are set, all files do exist and are spelled right.... anything I else that I should check/verify?