[email protected]:
> 
> Le 22/02/2023 ? 15:18, Wietse Venema a ?crit?:
> > [email protected]:
> >> Hello,
> >>
> >> we're trying to use content-filter instead of
> >> sender_dependant_relayhost_map.
> > Why?
> Previously, this sender_dependant_relayhost_map was just a call to an 
> api and returns a score based on mailfrom.
> We now add others source that are allowed to spoof mailfrom, so there's 
> logic to parse headers.
> As these headers can have unexpected content, we prefer to use a 
> content-filter in case of encoding issue or other strange behavior.
> So we are after-queue and mails are not bounced if our content-filter 
> panics.
> 
> >
> >> This content-filter sends directly mail, no return to Postfix.
> > When mail is undeliverable, how shall this filter send the
> > non-delivery notification?
> We decide to inject it back to Postfix and Postfix use default transport.
> >
> >> We're facing an issue with bounce and empty From.
> >>
> >> Using sender_dependant_relayhost_map, fails back to a default tranpsort.
> > In fact, you can use empty_address_default_transport_maps_lookup_key
> > for explicit handling of the null sender.
> Thansk a lot, this may be an easier solution.

Note this is a lookup key for sender_dependent_default_transport_maps.

> >> With a content-filter, all mails go to it, precedence
> > That depends on how you specify the filter and how the bounce
> > arrives. If the bounce arrives via SMTP, you can specifiy a different
> > filter for the null sender, or override the content_filter parameter
> > setting.

This would be with check_sender_access:

/etc/postfix/main.cf:
    # Run "postmap hash:/etc/postfix/sender_access" after editing the file.
    smtpd_sender_restrictions = 
        check_sender_access hash:/etc/postfix/sender_access

/etc/postfix/sender_access:
    <> filter transport:nexthop

This assumes the default "smtpd_null_access_lookup_key = <>".

        Wietse

Reply via email to