[2026-09-09 16:32] Stuart D Gathman <[email protected]> > On Wed, 9 Sep 2026, Mark Hills wrote: > > > This is "all"(!) > > > > A bunch of state, a persistent process, and due care around field > > splitting, escaping and buffer handling. > > > > This is "and now draw the rest of the owl" > > Sounds like the filter API needs something like pymilter. A nice C > extension for python makes sendmail filters ("milter" API) easy peasy. > Is it practical for the filter to talk to a separate python process?
The filter API doesn't care what language you use, it can be implemented in python, erlang, asm, ... The API is also not hard to implement in most languages (expect maybe C and asm). Each line is a '|' seperated tuple of stings. The length of the tuple depend on the filter phase (which is always at the same specific location). The most parts elements are just for bookkeping and are used the same for every phase. The response is a similar tuple with the bookkeeping strings and the filter result. I have once written a python filter to filter out specific header fields in about an hour. Someone on irc asked if there is already such a filter so I wrote one based on the smtpd-filters manpage[0]. So I generaly don't get the problem which is discoused in this thread. For C there is already libopensmtpd[1] and for most other languages implementing the filter API is so simple that noboy bothered to write a lib for it. Whene someone thinks there is need for such a lib or for a wrapper, go ahead and write one. satanist [0] https://man.openbsd.org/smtpd-filters [1] https://src.imperialat.at/?action=summary&headref=callback-error-code&path=libopensmtpd.git
