> > For envelope sender there is a standard header: Return-Path > > Return-Path is supposed to be added when the message is placed in the > mailstore (ie, last hop, after the transfer network). Since I do scanning > at the MTA level before delivery, I don't have Return-Path yet.
If scanning at the MTA level with amavisd-new, a synthetic Return-Path is prepended to a copy of a message that is given to SA for examination. Much like David B Funk says a sendmail-SA-milter does. There is no point using some nonstandard header field like X-Envelope-From, when Return-Path is there for just this purpose. spamc could be doing the same thing when it prepares a copy for spamd. It just needs a command line option to obtain envelope information from a caller (when available). Mark