aboutsummaryrefslogtreecommitdiff
path: root/mail/spamass-milter/files/extra-patch-rejecttext1
blob: 22365bda9f163549aa46f6a6371b1fa4fcbf73ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- spamass-milter.cpp.ORIG	2006-06-17 11:06:30.000000000 +0200
+++ spamass-milter.cpp	2006-06-17 11:10:11.000000000 +0200
@@ -161,6 +161,7 @@
 char *defaultuser;				/* Username to send to spamc if there are multiple recipients */
 char *defaultdomain;			/* Domain to append if incoming address has none */
 char *spamdhost;
+char *rejecttext = NULL;				/* If we reject a mail, then use this text */
 struct networklist ignorenets;
 int spamc_argc;
 char **spamc_argv;
@@ -193,6 +194,11 @@
 
    openlog("spamass-milter", LOG_PID, LOG_MAIL);
 
+
+    syslog(LOG_ERR, "argc: %d", argc);
+	for (int xy=0; xy<argc; xy++) {
+			syslog(LOG_ERR, "argv[%d]: %s", xy, argv[xy]);
+	}
 	/* Process command line options */
 	while ((c = getopt(argc, argv, args)) != -1) {
 		switch (c) {
@@ -232,6 +238,8 @@
 				flag_reject = true;
 				reject_score = atoi(optarg);
 				break;
+			case 'R':
+				rejecttext = strdup (optarg);
 			case 'u':
 				flag_sniffuser = true;
 				defaultuser = strdup(optarg);
@@ -299,6 +307,7 @@
       cout << "   -P pidfile: Put processid in pidfile" << endl;
       cout << "   -r nn: reject messages with a score >= nn with an SMTP error.\n"
               "          use -1 to reject any messages tagged by SA." << endl;
+      cout << "   -R RejectText: using this Reject Text." << endl;
       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;
@@ -307,6 +316,11 @@
       exit(EX_USAGE);
    }
 
+    /* Set standard reject text */
+    if (rejecttext == NULL) {
+		rejecttext = strdup ("Blocked by SpamAssassin");
+	}
+
 	if (pidfilename)
 	{
 		unlink(pidfilename);
@@ -452,7 +466,7 @@
 	if (do_reject)
 	{
 		debug(D_MISC, "Rejecting");
-		smfi_setreply(ctx, "550", "5.7.1", "Blocked by SpamAssassin");
+		smfi_setreply(ctx, "550", "5.7.1", rejecttext);
 
 
 		if (flag_bucket)