aboutsummaryrefslogtreecommitdiff
path: root/mail/spamass-milter
diff options
context:
space:
mode:
authorThomas Abthorpe <tabthorpe@FreeBSD.org>2008-04-04 15:48:28 +0000
committerThomas Abthorpe <tabthorpe@FreeBSD.org>2008-04-04 15:48:28 +0000
commit61896c838654bcba446f29b9c74543098cc02009 (patch)
tree988659fabab1a4e3f0f954b68e96b526d11ea7c6 /mail/spamass-milter
parent4d1add55bb5123255c41e852ee5e6ea66a805316 (diff)
downloadports-61896c838654bcba446f29b9c74543098cc02009.tar.gz
ports-61896c838654bcba446f29b9c74543098cc02009.zip
Notes
Diffstat (limited to 'mail/spamass-milter')
-rw-r--r--mail/spamass-milter/Makefile20
-rw-r--r--mail/spamass-milter/files/extra-patch-rejecttext160
-rw-r--r--mail/spamass-milter/files/extra-patch-rejecttext211
-rw-r--r--mail/spamass-milter/files/extra-patch-rejecttext2a11
4 files changed, 100 insertions, 2 deletions
diff --git a/mail/spamass-milter/Makefile b/mail/spamass-milter/Makefile
index 2ba2b906cfb7..9f512af7684d 100644
--- a/mail/spamass-milter/Makefile
+++ b/mail/spamass-milter/Makefile
@@ -7,7 +7,7 @@
PORTNAME= spamass-milter
PORTVERSION= 0.3.1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= spamass-milt
@@ -34,6 +34,15 @@ RUN_DEPENDS= ${BUILD_DEPENDS}
EXTRA_PATCHES= ${FILESDIR}/extra-patch-addauth
.endif
+.if defined(WITH_REJECTTEXT_PATCH)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext1
+.if defined(WITH_ADDAUTH_PATCH)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext2a
+.else
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext2
+.endif
+.endif
+
.if exists(${LOCALBASE}/lib/libldap.so)
WITH_LDAP=yes
.endif
@@ -53,7 +62,7 @@ WITH_SENDMAIL_BASE=yes
.if exists(/usr/lib/libmilter.a)
MILTERBASE= /usr
.else
-IGNORE= Base system sendmail not found or too old, rebuild with WITH_SENDMAIL_PORT=yes
+IGNORE= base system sendmail not found or too old, rebuild with WITH_SENDMAIL_PORT=yes
.endif
.endif
@@ -98,6 +107,13 @@ pre-patch:
@${ECHO_CMD} ""
.endif
+.if !defined(WITH_REJECTTEXT_PATCH)
+ @${ECHO_CMD} ""
+ @${ECHO_CMD} "You may set environment variable WITH_REJECTTEXT_PATCH to be"
+ @${ECHO_CMD} "able to customize the SMTP reject message."
+ @${ECHO_CMD} ""
+.endif
+
post-patch:
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/spamass-milter.in > ${WRKDIR}/spamass-milter
diff --git a/mail/spamass-milter/files/extra-patch-rejecttext1 b/mail/spamass-milter/files/extra-patch-rejecttext1
new file mode 100644
index 000000000000..22365bda9f16
--- /dev/null
+++ b/mail/spamass-milter/files/extra-patch-rejecttext1
@@ -0,0 +1,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)
diff --git a/mail/spamass-milter/files/extra-patch-rejecttext2 b/mail/spamass-milter/files/extra-patch-rejecttext2
new file mode 100644
index 000000000000..569156e3e71a
--- /dev/null
+++ b/mail/spamass-milter/files/extra-patch-rejecttext2
@@ -0,0 +1,11 @@
+--- spamass-milter.cpp.ORIG 2006-06-17 11:06:30.000000000 +0200
++++ spamass-milter.cpp 2006-06-17 11:10:11.000000000 +0200
+@@ -181,7 +182,7 @@
+ main(int argc, char* argv[])
+ {
+ int c, err = 0;
+- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
++ const char *args = "fd:mMp:P:r:R:u:D:i:b:B:e:x";
+ char *sock = NULL;
+ bool dofork = false;
+ char *pidfilename = NULL;
diff --git a/mail/spamass-milter/files/extra-patch-rejecttext2a b/mail/spamass-milter/files/extra-patch-rejecttext2a
new file mode 100644
index 000000000000..eb0bd7a25311
--- /dev/null
+++ b/mail/spamass-milter/files/extra-patch-rejecttext2a
@@ -0,0 +1,11 @@
+--- spamass-milter.cpp.ORIG 2006-06-17 11:06:30.000000000 +0200
++++ spamass-milter.cpp 2006-06-17 11:10:11.000000000 +0200
+@@ -181,7 +182,7 @@
+ main(int argc, char* argv[])
+ {
+ int c, err = 0;
+- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xa";
++ const char *args = "fd:mMp:P:r:R:u:D:i:b:B:e:xa";
+ char *sock = NULL;
+ bool dofork = false;
+ char *pidfilename = NULL;