On Mon, Nov 21, 2022 at 12:08:31PM +0100, natan wrote:

> one of client have external spam fileter (like
> barracuda/sophos/others) and I need a filter all his outgoing e-mail
> (only one client vdomain or two vdomain)
> 
> I thinking:
> 
> cat /etc/postfix/senders.pcre
> /vdomain1.com/ relay:[smtp.private.fileter.barracuda]
> /cdomain2.com/ relay:[smtp2.private.fileter.sophos]
>
> main.cf
> transport_maps = regexp:/etc/postfix/senders.pcre
>
> Is a correct ?

No.

* Transport lookup is by recipient address, using "sender"
  in the file name does not magically change this.

* Do not use regular expressions for transport lookups. 

* On what basis are barracuda or sophos willing to be an
  open relay for mail from this customer?  I would expect
  some form of authentication to be required.  Though
  perhaps your IP addresses are pinned at the provider
  as allowed to relay through the service.

  Do you understand how the filters are supposed to work?

You'd have to use sender_dependent_default_transport_maps, avoid regular
expressions (they are too fragile to be used correctly by most users,
you included).

To avoid potential loops, the settings in question should be configured
only for an outbound MSA.  DO NOT also process inbound mail on the same
system.  (Loops should not happen so long as the domains in question are
not in the "default" address class, i.e. are delivered locally or are
listed in "relay_domains", but best to be sure).

-- 
    VIktor.

Reply via email to