]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/patches/10_dont_handle_authenticated_users.diff
Load spamass-milter-0.3.0 into spamass-milter/trunk.
[deb_pkgs/spamass-milter.git] / debian / patches / 10_dont_handle_authenticated_users.diff
1
2 --- spamass-milter.cpp  2005-02-04 23:03:22.000000000 -0800
3 +++ spamass-milter.cpp  2005-03-27 17:13:50.595882304 -0800
4 @@ -169,6 +169,7 @@
5  char *spambucket;
6  bool flag_full_email = false;          /* pass full email address to spamc */
7  bool flag_expand = false;      /* alias/virtusertable expansion */
8 +bool ignore_authenticated_senders = false;
9  
10  #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */
11  static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER;
12 @@ -180,7 +181,7 @@
13  main(int argc, char* argv[])
14  {
15     int c, err = 0;
16 -   const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
17 +   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:x";
18     char *sock = NULL;
19     bool dofork = false;
20     char *pidfilename = NULL;
21 @@ -212,6 +213,10 @@
22                                 debug(D_MISC, "Parsing ignore list");
23                                 parse_networklist(optarg, &ignorenets);
24                                 break;
25 +                       case 'I':
26 +                               debug(D_MISC, "Ignore authenticated senders");
27 +                               ignore_authenticated_senders = true;
28 +                               break;
29                         case 'm':
30                                 dontmodifyspam = true;
31                                 smfilter.xxfi_flags &= ~SMFIF_CHGBODY;
32 @@ -279,7 +284,7 @@
33        cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl;
34        cout << "SpamAssassin Sendmail Milter Plugin" << endl;
35        cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
36 -      cout << "                      [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
37 +      cout << "                      [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl;
38        cout << "                      [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl;
39        cout << "                      [-- spamc args ]" << endl;
40        cout << "   -p socket: path to create socket" << endl;
41 @@ -293,6 +298,7 @@
42        cout << "   -f: fork into background" << endl;
43        cout << "   -i: skip (ignore) checks from these IPs or netblocks" << endl;
44        cout << "          example: -i 192.168.12.5,10.0.0.0/8,172.16/255.255.0.0" << endl;
45 +      cout << "   -I: skip (ignore) checks if sender is authenticated" << endl;
46        cout << "   -m: don't modify body, Content-type: or Subject:" << endl;
47        cout << "   -M: don't modify the message at all" << endl;
48        cout << "   -P pidfile: Put processid in pidfile" << endl;
49 @@ -761,6 +767,22 @@
50    struct context *sctx = (struct context *)smfi_getpriv(ctx);
51    char *queueid;
52  
53 +  if (ignore_authenticated_senders)
54 +  {
55 +    char *auth_authen;
56 +
57 +    auth_authen = smfi_getsymval(ctx, "{auth_authen}");
58 +    debug(D_MISC, "auth_authen=%s", auth_authen ?: "<unauthenticated>");
59 +
60 +    if (auth_authen)
61 +    {
62 +      debug(D_MISC, "sender authenticated (%s) - accepting message",
63 +           auth_authen);
64 +      debug(D_FUNC, "mlfi_envfrom: exit ignore");
65 +      return SMFIS_ACCEPT;
66 +    }
67 +  }
68 +
69    debug(D_FUNC, "mlfi_envfrom: enter");
70    try {
71      // launch new SpamAssassin
72
73 --- spamass-milter.1.in 2004-03-18 10:37:08.000000000 -0800
74 +++ spamass-milter.1.in 2005-03-27 20:23:09.552408021 -0800
75 @@ -14,6 +14,7 @@
76  .Op Fl e Ar defaultdomain
77  .Op Fl f
78  .Op Fl i Ar networks
79 +.Op Fl I
80  .Op Fl m
81  .Op Fl M
82  .Op Fl P Ar pidfile
83 @@ -119,6 +120,8 @@
84  flags will append to the list.
85  For example, if you list all your internal networks, no outgoing emails
86  will be filtered.
87 +.It Fl I
88 +Ignores messages if the sender has authenticated via SMTP AUTH.
89  .It Fl m
90  Disables modification of the 
91  .Ql Subject: