Content Filter only for incoming mails

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Content Filter only for incoming mails

BP20
Hello,

i am new to this.
I am trying to set up a content filter for incoming postfix mails.
I am using this instruction: http://www.postfix.org/FILTER_README.html#simple_filter

------- master.cf snippet -------
smtp      inet  n       -       -       -       -       smtpd
     -o content_filter=filter:dummy
filter    unix  -       n       n       -       10      pipe
  flags=Rq user=filter null_sender=
  argv=/var/spool/filter/afterqueue.sh -f ${sender} -- ${recipient}


The problem is, that the filter is also applied to outgoing mails.
I don't really understand that "-o content_filter=filter:dummy" line. Should "filter:dummy" be replaced?

So how can i set it up, so that it is only used for incoming mails?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Content Filter only for incoming mails

Patrick Ben Koetter-2
* BP20 <[hidden email]>:

> Hello,
>
> i am new to this.
> I am trying to set up a content filter for incoming postfix mails.
> I am using this instruction:
> http://www.postfix.org/FILTER_README.html#simple_filter
> <http://www.postfix.org/FILTER_README.html#simple_filter>  
>
> ------- master.cf snippet -------
> smtp      inet  n       -       -       -       -       smtpd
>      -o content_filter=filter:dummy
> filter    unix  -       n       n       -       10      pipe
>   flags=Rq user=filter null_sender=
>   argv=/var/spool/filter/afterqueue.sh -f ${sender} -- ${recipient}
>
>
> The problem is, that the filter is also applied to outgoing mails.
> I don't really understand that "-o content_filter=filter:dummy" line. Should
> "filter:dummy" be replaced?

Nope.

Your problem very likely is that your Postfix server currently is unaware of
directions. It can't tell what is incoming nor can it tell what is outgoing.

> So how can i set it up, so that it is only used for incoming mails?

Use a dedicated submission instance (master.cf) to submit outbound mail.

p@rick


--
[*] sys4 AG
 
https://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
 
Reply | Threaded
Open this post in threaded view
|

Re: Content Filter only for incoming mails

BP20
Thank you, can you please explain it a bit more with an example?
What do you mean with "dedicated submission instance"?
Reply | Threaded
Open this post in threaded view
|

Re: Content Filter only for incoming mails

Thomas Leuxner
* BP20 <[hidden email]> 2016.04.18 10:41:

> Thank you, can you please explain it a bit more with an example?
> What do you mean with "dedicated submission instance"?

1.2.3.4:submission inet n       -       -       -       -       smtpd
    -o syslog_name=postfix/submission
...

signature.asc (188 bytes) Download Attachment