On 19/06/15 15:50, Kevin A. McGrail wrote:
On 6/19/2015 10:43 AM, Reindl Harald wrote:
if you only have one user=sa-milter then you're screwed

and how does a "user=rcpt" give you any useful information to grep for
the sender of the mail in the case above?
We need to agree to disagree because you don't need to convince people
that your interest in logging changes is "right".

Instead, recommend you spend the energy working up a patch on the code
that does what you want.  That's the brilliance of OSS and as a
committer on the project, I will give you my word that I will look
seriously at the patch and consider it for inclusion ESPECIALLY if you
have a CLA on file, it is documented and uses a command switch so that
it's "yet another option" that people can choose to use or not.

We need people contributing code much much more than ideas.  If you
can't code, perhaps you know someone at your firm, in your dorm, down
the road, etc. who can!  Get them helping the project!


See attached. Modify it as per your requirements and it will improve the spamd log lines to include whatever you want it to.

I use it to add the calculated last-external IP address and to add the UUID (Transaction ID) from Haraka which is the glue that I use here; the data is passed to SpamAssassin via a header, which is then added to the spamd log line via the API. That allows me to link the SMTP session to the spamd log and vice-versa regardless as to whether a Message-ID header is present or not.

spamd will already log the envfrom= line provided it has this information passed through from whatever calls it. I send it over via a X-Envelope-From: (see 'envelope_sender_header' in man Mail::SpamAssassin::Conf).

Jun 14 12:30:20 mail1-ec2 spamd[6418]: spamd: result: . -5 - DI_MX_IMPLICIT,HARAKA_DNSWL,HARAKA_DSPAM_00,HARAKA_FCRDNS,HARAKA_RELAYING,HARAKA_SENDER_AUTH,HTML_MESSAGE,RP_MATCHES_RCVD scantime=0.8,size=8464,user=***@***.com,uid=500,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=37784,mid=<WM!44f21c66bf985efa445526f7e5426264e223ecff488eaa8bff906b038bd86b39d466c13d9b768944b8a292c509c16656!@***.**.org>,autolearn=disabled,lastexternal=198.246.200.77,envfrom=****@*******.**.org,haraka-uuid=13C5EA99-2D43-4D08-B813-7A6889C6D8D0.1

Kind regards,
Steve.

Attachment: Haraka.pm
Description: Perl program

loadplugin Mail::SpamAssassin::Plugin::Haraka   Haraka.pm

ifplugin Mail::SpamAssassin::Plugin::Haraka
    header   __HARAKA           eval:get_haraka_uuid()
endif

Reply via email to