]> git.pld-linux.org Git - packages/spamass-milter.git/blob - spamass-milter-rejectmsg.patch
31fec5a7eb181c6ff9fb0480dd2975df0e560590
[packages/spamass-milter.git] / spamass-milter-rejectmsg.patch
1 --- spamass-milter.cpp.orig     2011-07-14 21:30:24.147827542 +0200
2 +++ spamass-milter.cpp  2011-07-14 21:35:35.195373664 +0200
3 @@ -176,6 +176,8 @@
4  bool flag_expand = false;      /* alias/virtusertable expansion */
5  bool warnedmacro = false;      /* have we logged that we couldn't fetch a macro? */
6  bool ignore_authenticated_senders = false;     /* authenticated users bypass spam checks */
7 +bool flag_customreject = false;
8 +char *reject_message;
9  
10  // {{{ main()
11  
12 @@ -183,7 +185,7 @@
13  main(int argc, char* argv[])
14  {
15     int c, err = 0;
16 -   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:";
17 +   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:c:";
18     char *sock = NULL;
19     char *group = NULL;
20     bool dofork = false;
21 @@ -270,6 +272,10 @@
22                         case 'x':
23                                 flag_expand = true;
24                                 break;
25 +                       case 'c':
26 +                               flag_customreject = true;
27 +                               reject_message = strdup(optarg);
28 +                               break;
29                         case '?':
30                                 err = 1;
31                                 break;
32 @@ -314,6 +320,7 @@
33        cout << "   -u defaultuser: pass the recipient's username to spamc.\n"
34                "          Uses 'defaultuser' if there are multiple recipients." << endl;
35        cout << "   -x: pass email address through alias and virtusertable expansion." << endl;
36 +      cout << "   -c: custom reject message." << endl;
37        cout << "   -- spamc args: pass the remaining flags to spamc." << endl;
38                
39        exit(EX_USAGE);
40 @@ -487,8 +494,16 @@
41         }
42         if (do_reject)
43         {
44 -               debug(D_MISC, "Rejecting");
45 -               smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
46 +               if (flag_customreject)
47 +               {
48 +                       debug(D_MISC, "Rejecting with custom message");
49 +                       smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>(reject_message));
50 +               }
51 +               else
52 +               {
53 +                       debug(D_MISC, "Rejecting");
54 +                       smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
55 +               }
56  
57  
58                 if (flag_bucket)
This page took 0.027425 seconds and 2 git commands to generate.