Yahoo Groups archive

Milter-greylist

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

Message

Toggle to not log failure to fetch {if_addr}

2013-08-11 by Jim Klimov

My MTA (Sun/Oracle CommSuite Messaging Server) does not have an
{if_addr} macro to designate which IP address of the MTA received
the SMTP connection. This value, if available, is used in two
places in the code so far:

1) To build the X-Greylist string part "(my_hostname [my_ip])"
Failure to fetch just fills in the IPv4 or IPv6 localhost.

2) To match destinations for P0F fingerprinting
Failure to fetch the macro essentially disables p0f

In an earlier episode I had a go at replacing this macro with
another, but that was a rather foolish attempt :)

Now I've added a toggle "nolog_missing_if_addr" that can be set
in the config file to simply disable the logging of the string
"smfi_getsymval failed for {if_addr}" if debug logging is on.
In my case, this line carries no informative meaning and just
pollutes the logs.

Now, a separate question is if we can (or should) try to detect
a "reasonable" value ourselves, in the milter, in case the macro
value is not provided - i.e. try the only non-loopback IP address
if there is only one, or review the system's SMTP connections
like "netstat -an | grep ESTABLISHED" to find one(s) with that
remote host and see which local IP address is used, if any?..
As a possible aid for the latter technique, is there any macro that
would pass us the remote relay's port number - just like we can have
its host name and/or IP address?

Thanks,
//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.