NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: filtering on From with postfix / postgrey




On 5-Sep-08, at 6:20 AM, Petar Bogdanovic wrote:

I think you could use header_checks(5)

No, unfortunately that won't work.

Postfix processes header/body_checks one line at a time (and with an artificially restricted line length too). I think for headers it might even be so limited as to be one input line, rather than the whole logical header at a time. Postfix header/body_checks are almost useless except for the most trivial matching against input that is not adaptive and which does not try to bypass the matching.

I.e. Postfix can't match across different header lines in one expression.

(I briefly looked once upon a time into how it might be possible to fix the header/body_checks features in Postfix, especially for use with the more powerful features of PCRE, but I think it would require re-engineering a great deal of the internals. Even canonicallizing the headers would be difficult. In Smail-3 I canonicallize the headers for matching, and present the whole whole message body (or at least the first buffer's worth, but that can be megabytes) for matching at once. However Smail still can't match across headers as you suggest. Implementing a full SMTP proxy module would be the only sane way to get this level of functionality with Postfix.)

Of course for this purpose one _should_ be able to do the matching necessary against the SMTP envelope parameters, and in that case the restriction classes that dieter mentioned might work -- I have never used them before myself so I'm not 100% sure of the details. It looks as though the examples in the README would need at least some adaptation to meet the original poster's requirements.

--
                                        Greg A. Woods; Planix, Inc.
                                        <woods%planix.ca@localhost>

Attachment: PGP.sig
Description: This is a digitally signed message part



Home | Main Index | Thread Index | Old Index