PostFix and AlterMIME issues?

Issues related to applications and software problems
Post Reply
keith.sieman
Posts: 21
Joined: 2015/06/14 02:06:32

PostFix and AlterMIME issues?

Post by keith.sieman » 2015/07/01 20:45:33

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:

Code: Select all

#!/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_ibservers}` ]; 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: Select all


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? I replaced the actual domains with company-a and company-b for this message's purpose.

keith.sieman
Posts: 21
Joined: 2015/06/14 02:06:32

Re: PostFix and AlterMIME issues?

Post by keith.sieman » 2015/07/03 00:33:00

Bumping.


I tried setting all files to the ownership of the filter user as well as changing the variables to capital letters. Also did a chmod of the files to 750. Still getting the same error.

Post Reply