Hi
Auto added footer is very bad but nn one of server i have:

smtp      inet  n       -       n       -       -       smtpd -o content_filter=stopka

stopka     unix    -       n       n       -       -       pipe
    flags=Rq user=filter argv=/home/filter/add_filter.sh -f ${sender} -- ${recipient}


#!/bin/sh
INSPECT_DIR=/home/filter/filter
SENDMAIL=/usr/sbin/sendmail

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; }

/usr/bin/altermime --input=in.$$ \
                   --disclaimer=/home/filter/stopka.txt \
                   --disclaimer-html=/home/filter/stopka.html \

$SENDMAIL "$@" <in.$$

exit $?

W dniu 27.02.2023 o 15:08, Rafael Azevedo pisze:
Hi there,

I was doing a research about how to implement an outgoing email filter.

For every sent message we want to add a footer with a counter.

I've tried to add the "content_filter" tag as shown:

    smtp      inet  n       -       n       -       50       smtpd
        -o content_filter=footer


    footer unix - n n - - pipe
      flags=Rq user=myuser argv=/home/postfix/tag.sh ${sender}
    ${recipient}

But the messages doesn't seem to be filtered.

    $ postconf | grep content_filter
    content_filter = (empty)


Is this supposed to work? Is there a workaround for this?

Huge thanks.

R


--

Reply via email to