From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Mar 31 22:40:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89ADE1065673 for ; Mon, 31 Mar 2008 22:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE2A8FC18 for ; Mon, 31 Mar 2008 22:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2VMe1JE045341 for ; Mon, 31 Mar 2008 22:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2VMe1Mh045340; Mon, 31 Mar 2008 22:40:01 GMT (envelope-from gnats) Resent-Date: Mon, 31 Mar 2008 22:40:01 GMT Resent-Message-Id: <200803312240.m2VMe1Mh045340@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Frank Fenor Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04D4C1065674 for ; Mon, 31 Mar 2008 22:34:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id EBF928FC18 for ; Mon, 31 Mar 2008 22:34:24 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m2VMXxSw030415 for ; Mon, 31 Mar 2008 22:33:59 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m2VMXxvg030414; Mon, 31 Mar 2008 22:33:59 GMT (envelope-from nobody) Message-Id: <200803312233.m2VMXxvg030414@www.freebsd.org> Date: Mon, 31 Mar 2008 22:33:59 GMT From: Frank Fenor To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/122313: Patch to make rejecttext in mail/spamass-milter configurable X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 22:40:01 -0000 >Number: 122313 >Category: ports >Synopsis: Patch to make rejecttext in mail/spamass-milter configurable >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Mar 31 22:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Frank Fenor >Release: FreeBSD 7.0-PRERELEASE >Organization: >Environment: FreeBSD konzentrisch.de 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #5: Tue Feb 5 00:33:58 CET 2008 >Description: I found this patch at http://savannah.nongnu.org/patch/?5189 and since I didn't like the default reject message of spamass-milter, I included it into the port. >How-To-Repeat: >Fix: cd /usr/ports/mail/spamass-milter && patch -p1 < patch.txt Patch attached with submission follows: Source: http://savannah.nongnu.org/patch/?5189 diff -Nru spamass-milter.vanilla/Makefile spamass-milter/Makefile --- spamass-milter.vanilla/Makefile 2007-08-23 05:59:58.000000000 +0200 +++ spamass-milter/Makefile 2008-01-22 22:08:57.000000000 +0100 @@ -34,6 +34,15 @@ 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 @@ -98,6 +107,13 @@ @${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 -Nru spamass-milter.vanilla/files/extra-patch-rejecttext1 spamass-milter/files/extra-patch-rejecttext1 --- spamass-milter.vanilla/files/extra-patch-rejecttext1 1970-01-01 01:00:00.000000000 +0100 +++ spamass-milter/files/extra-patch-rejecttext1 2008-01-22 22:07:32.000000000 +0100 @@ -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= 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 -Nru spamass-milter.vanilla/files/extra-patch-rejecttext2 spamass-milter/files/extra-patch-rejecttext2 --- spamass-milter.vanilla/files/extra-patch-rejecttext2 1970-01-01 01:00:00.000000000 +0100 +++ spamass-milter/files/extra-patch-rejecttext2 2008-01-22 22:07:52.000000000 +0100 @@ -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 -Nru spamass-milter.vanilla/files/extra-patch-rejecttext2a spamass-milter/files/extra-patch-rejecttext2a --- spamass-milter.vanilla/files/extra-patch-rejecttext2a 1970-01-01 01:00:00.000000000 +0100 +++ spamass-milter/files/extra-patch-rejecttext2a 2008-01-22 22:08:10.000000000 +0100 @@ -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; >Release-Note: >Audit-Trail: >Unformatted: