Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Patches to use localaddr if there is no if_addr, and some more SPF verbosity

2013-08-11 by Jim Klimov

On 2013-08-11 17:42, Jim Klimov wrote:
> Given your reply above, I think for many intents and purposes
> the single value defined by admin in a config file would do.
> It just has to become not only defined for POSIX, and used in

-POSIX
+Postfix
:)

> place of missing {if_addr} in those two spots. And also it
> should become documented, at all and for such use in particular :)
>
> I cannot promise I'd look into this anytime soon, there are some
> quests at $work to do with higher priority... Then again, I thought
> so about several of the features I've committed this weekend ;)

So here is a couple of patches: one allows use of "localaddr" by
local_ipstr() for '%V' format string parsing, I believe; its result
can be seen in the X-Greylist headers; and also for p0f which I did
not yet test.

Given that our mail relay is on a "virtual" IP address behind NAT,
it might be reasonable to actually use two separate variables here
(IP on this host's NIC for p0f, and public IP on NAT for "spf self")...
but so far so much.

This change also removes the ifdef's which limited the logic for
Postfix at compile-time, and now similar decisions are made run-time
based on availability of either if_addr or localaddr.

Also introduced is a conf.c_localaddr_string character array to only
generate the string once (via conf_lex).

A follow-up idea might be to add format strings for local host's
address and name...



Another patch deals with some more verbosity in SPF lookup progress
in the debug logs (which result are we testing for, and did we hit
it, in human-readable terms - taking result={0,1} as readable).

BTW, I believe that these SPF lookups are needlessly done for each
invokation of the keyword? While they may be cached by DNS, there is
still an overhead of processing. Can't (or don't already?) we cache
the first SPF test's result in this SMTP dialog and later on just
match it to the currently tested expected result (pass, fail, etc.)?



HTH,
//Jim Klimov

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.