On Mon, Feb 27, 2023 at 11:08:47AM -0300, Rafael Azevedo wrote:

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

Whatever...

> I've tried to add the "content_filter" tag as shown:
> 
> smtp      inet  n       -       n       -       50       smtpd
>     -o content_filter=footer

This will add a content filter to messages that arriva via SMTP on port 25.

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

This will pass the message to the "tag.sh" program (which has to be very
careful with its untrusted arguments, non-experts generally get this
wrong).

> But the messages doesn't seem to be filtered.
> 
> $ postconf | grep content_filter
> content_filter = (empty)

Why do you expect the output of "postconf" (main.cf) to reflect the
service-specific override in master.cf?  To master.cf settings,
try "postconf -M" or "postconf -P".

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

Content filters work as documented.  Shell scripts used as content
filters should go through security review.

-- 
    Viktor.

Reply via email to