https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7909

--- Comment #10 from Andrey L <[email protected]> ---
Ok, I've greatly underestimated the uglyness of sendmail design. 

Just to record all this crap for the history:

This is sort of complex posfix config / milter issue and the way variables from
MTA to milter are propagated. 
The page http://www.postfix.org/MILTER_README.html#send-macros list macros that
postfix passes to milter. The "always available" status for macro {client_addr}
means that in theory postfix can calculate its value at any stage. IF, and only
if the name of this variable is specified in corresponding milter_macro config
setting, set in config or by default (from postfix sources). Neither "_" or
"{client_addr}" is set in sources, so milter does not get this info.

For years, postfix and milter library support API that let the milter send a
list of requested variables to MTA, instead of forcing the user to read sources
for postfix and milter, and specify these vars in config. 

Also, even if no macro variable with client IP is available, the client ip
address is still presented to milter during the hello callback and can be used
as a fallback instead of "unknown".

Attached patch does exactly these 3 things:
1 - calls new API (if available) to request necessary variables
2 - falls back to client address from hello
3 - uses postfix variables (when present) to assemble a full received header.

hopefully someone would find this useful...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to