X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpatches%2Fauth_in_received;fp=debian%2Fpatches%2Fauth_in_received;h=8ac1b0917994799dc4b37aad5e800f71a2fc0645;hb=f01e810ec85d4b9927890c7541463bb6612a4cf8;hp=0000000000000000000000000000000000000000;hpb=bba8e08d335a3c0eb8e0308cc471237921c0f92b;p=deb_pkgs%2Fspamass-milter.git diff --git a/debian/patches/auth_in_received b/debian/patches/auth_in_received new file mode 100644 index 0000000..8ac1b09 --- /dev/null +++ b/debian/patches/auth_in_received @@ -0,0 +1,65 @@ +Index: spamass-milter/spamass-milter.cpp +=================================================================== +--- spamass-milter.orig/spamass-milter.cpp 2012-06-21 13:03:42.000000000 -0700 ++++ spamass-milter/spamass-milter.cpp 2012-06-21 14:02:32.000000000 -0700 +@@ -898,7 +898,8 @@ + + */ + const char *macro_b, *macro_i, *macro_j, *macro_r, +- *macro_s, *macro_v, *macro_Z, *macro__; ++ *macro_s, *macro_v, *macro_Z, *macro__, ++ *macro_auth_type, *macro_auth_ssf; + char date[32]; + + /* RFC 822 date. */ +@@ -935,7 +936,22 @@ + macro_r = "SMTP"; + warnmacro("r", "ENVRCPT"); + } +- ++ ++ /* Authenticated bits Information */ ++ macro_auth_type = smfi_getsymval(ctx, "{auth_type}"); ++ if (!macro_auth_type) ++ { ++ macro_auth_type = ""; ++ warnmacro("auth_type", "ENVRCPT"); ++ } ++ ++ macro_auth_ssf = smfi_getsymval(ctx, "{auth_ssf}"); ++ if (!macro_auth_ssf) ++ { ++ macro_auth_ssf = ""; ++ warnmacro("auth_ssf", "ENVRCPT"); ++ } ++ + /* Sendmail currently cannot pass us the {s} macro, but + I do not know why. Leave this in for the day sendmail is + fixed. Until that day, use the value remembered by +@@ -974,11 +990,22 @@ + assassin->output((string)"X-Envelope-From: "+assassin->from()+"\r\n"); + assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n"); + +- assassin->output((string) +- "Received: from "+macro_s+" ("+macro__+")\r\n\t"+ +- "by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+ ++ string rec_header; ++ rec_header=(string)"Received: from "+macro_s+" ("+macro__+")\r\n\t"; ++ if (strlen(macro_auth_type)!=0) { ++ rec_header+=(string)"(authenticated"; ++ if (strlen(macro_auth_ssf)!=0) { ++ rec_header+=(string)" bits="+macro_auth_ssf; ++ } ++ rec_header+=(string)")\r\n\t"; ++ } ++ rec_header+=(string)"by "+macro_j+"("+macro_v+"/"+macro_Z+") with "+ ++ macro_r+" id "+macro_i+"\r\n\t"+ + macro_b+"\r\n\t"+ +- "(envelope-from "+assassin->from()+")\r\n"); ++ "(envelope-from "+assassin->from()+"\r\n"; ++ ++ debug(D_SPAMC, "Received header for spamc: %s", rec_header.c_str()); ++ assassin->output(rec_header); + + } else + assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");