On Thu, Jan 27, 2022 at 06:57:12PM +0100, Víctor Rubiella Monfort wrote:

> First of all if someone can provide some links with more info about 
> configuration and architecture on this kind of layered aproach 
> (GW->postfix->dovecot) I will be very grateful :D. (something more than 
> official doc and "postfix the definitive guide book" :D)

I doubt you'll find a high quality how-to specifically tailored to your
needs.  The official docs are in fact reasonably comprehensive,
especially if combined with either of the extant books (the "No Starch
Press" book by Patrick and Ralph is more hands-on IIRC than the O'Reilly
book).

> I'm need help on concepts for "advanced content filter".

These run as resident SMTP services typically on the same machine,
listening on a non-default (not 25) 127.0.0.1 TCP port.

> First of all, documentation referers to Perl sample with broken link 
> (http://bent.latency.net/smtpprox/. )
> I see this related link 
> https://stackoverflow.com/questions/40267168/advanced-content-filter-for-postfix-using-spawn-service

It is/was just a Perl script that is both an SMTP server and a client
(because it is a proxy).  It just echoed most commands and data right
through, but supported some filtering features.

> That links to http://www.postfix.org/spawn.8.html and
> http://www.postfix.org/SMTPD_POLICY_README.html, but this examples
> confusing me because seems related to policy filters not
> content_filter.

Don't use spawn for this.  Run a stand-alone network service.

> I have found quite few samples for Before-Queue filters (Milters), but 
> nothing advanced samples with After-Queue filtering.

They are conceptually simple SMTP-in SMTP-out proxies.

> I'm looking for some code examples and best practices of advanced 
> filters and how to concatenate several advanced content filters: 
> reinjecting from one to another one, etc..

If they have similar latency/throughput just "pipe" one straight
into the next (specify the next filter as the reinjection port
for the previous).

If the latency/concurrency requirements are sufficiently different,
introduce a queue between the two filters by delivering the mail
back into a Postfix "smtpd" that has the next filter as  its
content_filter setting.

-- 
    Viktor.

Reply via email to