1 Description: Include Auth information in the received line
2 Origin: https://www.linuxhacker.at/opensource-projects/spamass-milter
4 Author: Herbert Straub, Knut Arne Bjørndal <knut.arne.bjorndal@easyconnect.no>
6 --- a/spamass-milter.cpp
7 +++ b/spamass-milter.cpp
11 const char *macro_b, *macro_i, *macro_j, *macro_r,
12 - *macro_s, *macro_v, *macro_Z, *macro__;
13 + *macro_s, *macro_v, *macro_Z, *macro__,
14 + *macro_auth_type, *macro_auth_ssf;
20 warnmacro("r", "ENVRCPT");
24 + /* Authenticated bits Information */
25 + macro_auth_type = smfi_getsymval(ctx, "{auth_type}");
26 + if (!macro_auth_type)
28 + macro_auth_type = "";
29 + warnmacro("auth_type", "ENVRCPT");
32 + macro_auth_ssf = smfi_getsymval(ctx, "{auth_ssf}");
33 + if (!macro_auth_ssf)
35 + macro_auth_ssf = "";
36 + warnmacro("auth_ssf", "ENVRCPT");
39 /* Sendmail currently cannot pass us the {s} macro, but
40 I do not know why. Leave this in for the day sendmail is
41 fixed. Until that day, use the value remembered by
42 @@ -1016,11 +1032,22 @@
43 assassin->output((string)"X-Envelope-From: "+assassin->from()+"\r\n");
44 assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");
46 - assassin->output((string)
47 - "Received: from "+macro_s+" ("+macro__+")\r\n\t"+
48 - "by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+
50 + rec_header=(string)"Received: from "+macro_s+" ("+macro__+")\r\n\t";
51 + if (strlen(macro_auth_type)!=0) {
52 + rec_header+=(string)"(authenticated";
53 + if (strlen(macro_auth_ssf)!=0) {
54 + rec_header+=(string)" bits="+macro_auth_ssf;
56 + rec_header+=(string)")\r\n\t";
58 + rec_header+=(string)"by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+
59 + macro_r+" id "+macro_i+"\r\n\t"+
61 - "(envelope-from "+assassin->from()+")\r\n");
62 + "(envelope-from "+assassin->from()+");\r\n";
64 + debug(D_SPAMC, "Received header for spamc: %s", rec_header.c_str());
65 + assassin->output(rec_header);
68 assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");