]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/patches/auth_in_received
* No longer create home directory for spamass-milter; remove on purge if
[deb_pkgs/spamass-milter.git] / debian / patches / auth_in_received
1 Index: spamass-milter/spamass-milter.cpp
2 ===================================================================
3 --- spamass-milter.orig/spamass-milter.cpp      2012-06-21 13:03:42.000000000 -0700
4 +++ spamass-milter/spamass-milter.cpp   2012-06-21 14:02:32.000000000 -0700
5 @@ -898,7 +898,8 @@
6                    
7                 */
8                 const char *macro_b, *macro_i, *macro_j, *macro_r,
9 -                          *macro_s, *macro_v, *macro_Z, *macro__;
10 +                          *macro_s, *macro_v, *macro_Z, *macro__,
11 +                          *macro_auth_type, *macro_auth_ssf;
12                 char date[32];
13  
14                 /* RFC 822 date. */
15 @@ -935,7 +936,22 @@
16                         macro_r = "SMTP";
17                         warnmacro("r", "ENVRCPT");
18                 }
19 -                       
20 +
21 +               /* Authenticated bits Information */
22 +               macro_auth_type = smfi_getsymval(ctx, "{auth_type}");
23 +               if (!macro_auth_type)
24 +               {
25 +                       macro_auth_type = "";
26 +                       warnmacro("auth_type", "ENVRCPT");
27 +               }
28 +
29 +               macro_auth_ssf = smfi_getsymval(ctx, "{auth_ssf}");
30 +               if (!macro_auth_ssf)
31 +               {
32 +                       macro_auth_ssf = "";
33 +                       warnmacro("auth_ssf", "ENVRCPT");
34 +               }
35 +
36                 /* Sendmail currently cannot pass us the {s} macro, but
37                    I do not know why.  Leave this in for the day sendmail is
38                    fixed.  Until that day, use the value remembered by
39 @@ -974,11 +990,22 @@
40                 assassin->output((string)"X-Envelope-From: "+assassin->from()+"\r\n");
41                 assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");
42  
43 -               assassin->output((string)
44 -                       "Received: from "+macro_s+" ("+macro__+")\r\n\t"+
45 -                       "by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+
46 +               string rec_header;
47 +               rec_header=(string)"Received: from "+macro_s+" ("+macro__+")\r\n\t";
48 +               if (strlen(macro_auth_type)!=0) {
49 +                       rec_header+=(string)"(authenticated";
50 +                       if (strlen(macro_auth_ssf)!=0) {
51 +                               rec_header+=(string)" bits="+macro_auth_ssf;
52 +                       }
53 +                       rec_header+=(string)")\r\n\t";
54 +               }
55 +               rec_header+=(string)"by "+macro_j+"("+macro_v+"/"+macro_Z+") with "+
56 +                       macro_r+" id "+macro_i+"\r\n\t"+
57                         macro_b+"\r\n\t"+
58 -                       "(envelope-from "+assassin->from()+")\r\n");
59 +                       "(envelope-from "+assassin->from()+"\r\n";
60 +
61 +               debug(D_SPAMC, "Received header for spamc: %s", rec_header.c_str());
62 +               assassin->output(rec_header);
63  
64         } else
65                 assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");