packages: spamass-milter/spamass-milter-rejectmsg.patch (NEW) - allow setti...

hawk hawk at pld-linux.org
Thu Jul 14 21:38:03 CEST 2011


Author: hawk                         Date: Thu Jul 14 19:38:03 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- allow setting custom reject message

---- Files affected:
packages/spamass-milter:
   spamass-milter-rejectmsg.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/spamass-milter/spamass-milter-rejectmsg.patch
diff -u /dev/null packages/spamass-milter/spamass-milter-rejectmsg.patch:1.1
--- /dev/null	Thu Jul 14 21:38:03 2011
+++ packages/spamass-milter/spamass-milter-rejectmsg.patch	Thu Jul 14 21:37:58 2011
@@ -0,0 +1,58 @@
+--- spamass-milter.cpp.orig	2011-07-14 21:30:24.147827542 +0200
++++ spamass-milter.cpp	2011-07-14 21:35:35.195373664 +0200
+@@ -176,6 +176,8 @@
+ bool flag_expand = false;	/* alias/virtusertable expansion */
+ bool warnedmacro = false;	/* have we logged that we couldn't fetch a macro? */
+ bool ignore_authenticated_senders = false;	/* authenticated users bypass spam checks */
++bool flag_customreject = false;
++char *reject_message;
+ 
+ // {{{ main()
+ 
+@@ -183,7 +185,7 @@
+ main(int argc, char* argv[])
+ {
+    int c, err = 0;
+-   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:";
++   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:c:";
+    char *sock = NULL;
+    char *group = NULL;
+    bool dofork = false;
+@@ -270,6 +272,10 @@
+ 			case 'x':
+ 				flag_expand = true;
+ 				break;
++			case 'c':
++				flag_customreject = true;
++				reject_message = strdup(optarg);
++				break;
+ 			case '?':
+ 				err = 1;
+ 				break;
+@@ -314,6 +320,7 @@
+       cout << "   -u defaultuser: pass the recipient's username to spamc.\n"
+               "          Uses 'defaultuser' if there are multiple recipients." << endl;
+       cout << "   -x: pass email address through alias and virtusertable expansion." << endl;
++      cout << "   -c: custom reject message." << endl;
+       cout << "   -- spamc args: pass the remaining flags to spamc." << endl;
+               
+       exit(EX_USAGE);
+@@ -487,8 +494,16 @@
+ 	}
+ 	if (do_reject)
+ 	{
+-		debug(D_MISC, "Rejecting");
+-		smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
++		if (flag_customreject)
++		{
++			debug(D_MISC, "Rejecting with custom message");
++			smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>(reject_message));
++		}
++		else
++		{
++			debug(D_MISC, "Rejecting");
++			smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
++		}
+ 
+ 
+ 		if (flag_bucket)
================================================================


More information about the pld-cvs-commit mailing list