diff options
author | tabthorpe <tabthorpe@FreeBSD.org> | 2008-04-04 23:48:28 +0800 |
---|---|---|
committer | tabthorpe <tabthorpe@FreeBSD.org> | 2008-04-04 23:48:28 +0800 |
commit | b0eea36232265fbdaf7db7350e86a751d3810d4b (patch) | |
tree | 041d7a4bb9bc410a857eba2e0da3c7e8ae9ca41c /mail | |
parent | cdf33ec435eb3e69ab9f7fd31842e0927c39ead4 (diff) | |
download | freebsd-ports-gnome-b0eea36232265fbdaf7db7350e86a751d3810d4b.tar.gz freebsd-ports-gnome-b0eea36232265fbdaf7db7350e86a751d3810d4b.tar.zst freebsd-ports-gnome-b0eea36232265fbdaf7db7350e86a751d3810d4b.zip |
- Add customizable reject text
- Bump PORTREVISION
- Fix IGNORE message, pet portlint
PR: ports/122313
Submitted by: Frank Fenor <frank fenor.de>
Obtained from: http://savannah.nongnu.org/patch/?5189
Diffstat (limited to 'mail')
-rw-r--r-- | mail/spamass-milter/Makefile | 20 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-rejecttext1 | 60 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-rejecttext2 | 11 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-rejecttext2a | 11 |
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; |