Hi,

I'm trying to configure a disclaimer footer using altermime with
postfix-2.7.5, amavisd-new-2.6.4. I've tried to follow the examples
for creating a new filter, but the messages appear to be being
reinjected at the wrong spot and are being delivered multiple times to
the always_bcc recipient.

I thought I could outline my current config, and someone could help me
to find what I'm missing. I have about twenty virtual domains, but it
would be okay to use the same disclaimer footer text for each domain.
I'd also like to be sure SASL authenticated clients are permitted as
well.

I'm not sure this configuration will only work with my domains, and
only on outbound mail. How is this controlled?

smtp      inet  n       -       n       -       -       smtpd
       -o receive_override_options=no_address_mappings
       -o content_filter=filter:dummy

submission inet n       -       n       -       -       smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o receive_override_options=no_address_mappings
  -o content_filter=filter:dummy

filter     unix  -       n       n       -       -       pipe
     flags=Rq  user=filter argv=/etc/postfix/disclaimer.sh -f
${sender} -- ${recipient}

The 'filter' users exists, and disclaimer.sh contains the actual
altermime command:

========================
#!/bin/sh
INSPECT_DIR=/tmp
SENDMAIL=/usr/sbin/sendmail

# 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
from_address=`grep -m 1 "From:" in.$$ | cut -d "<" -f 2 | cut -d ">" -f 1`

  /usr/bin/altermime --input=in.$$ \
                   --disclaimer=/etc/postfix/disclaimer.txt \
                   --disclaimer-html=/etc/postfix/disclaimer.txt \
                   --xheader="X-Copyrighted-Material: Please visit
http://www.mydomain.com/privacy.htm"; || \
                    { echo Message content rejected; exit $EX_UNAVAILABLE; }

$SENDMAIL "$@" <in.$$

exit $?
========================

The intended recipient receives a copy of the message, but the
always_bcc user receives the message multiple times.

Thanks,
Alex

Reply via email to