Date: Wed, 15 Nov 2006 14:03:39 GMT From: Thomas Abthorpe<thomas@goodking.ca> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/105571: [MAINTAINER] mail/spamass-milter: add patch to bypass authenticated users Message-ID: <200611151403.kAFE3dod057999@www.freebsd.org> Resent-Message-ID: <200611151410.kAFEADus001461@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 105571 >Category: ports >Synopsis: [MAINTAINER] mail/spamass-milter: add patch to bypass authenticated users >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Nov 15 14:10:12 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Thomas Abthorpe >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: Goodking.Ca >Environment: FreeBSD goodking.goodking.ca 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #1: Wed Nov 8 12:36:28 EST 2006 root@goodking.goodking.ca:/usr/obj/usr/src/sys/GKSMP i386 >Description: - add patch to skip spam checks on SMTP authenticated users by setting WITH_ADDAUTH_PATCH environment variable at build time - thanks to Steve Watt <steve_AT_watt.com> for providing the patch - bump PORTREVISION >How-To-Repeat: >Fix: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/mail/spamass-milter/Makefile,v retrieving revision 1.22 diff -u -r1.22 Makefile --- Makefile 9 Jun 2006 21:16:02 -0000 1.22 +++ Makefile 15 Nov 2006 13:46:26 -0000 @@ -7,6 +7,7 @@ PORTNAME= spamass-milter PORTVERSION= 0.3.1 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SAVANNAH} MASTER_SITE_SUBDIR= spamass-milt @@ -15,7 +16,7 @@ COMMENT= Sendmail Milter (mail filter) plugin for SpamAssassin BUILD_DEPENDS= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin -RUN_DEPENDS= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin +RUN_DEPENDS= ${BUILD_DEPENDS} ## # Use the following quirks to choose which sendmail to use (ports or system): @@ -30,6 +31,10 @@ .include <bsd.port.pre.mk> +.if defined(WITH_ADDAUTH_PATCH) +EXTRA_PATCHES= ${FILESDIR}/extra-patch-addauth +.endif + .if exists(${LOCALBASE}/lib/libldap.so) WITH_LDAP=yes .endif @@ -76,6 +81,12 @@ MAN1= spamass-milter.1 +pre-fetch: + @${ECHO_CMD} "" + @${ECHO_CMD} "You may set environment variable WITH_ADDAUTH_PATCH to bypass" + @${ECHO_CMD} "checks if a connection authenticated via SMTP." + @${ECHO_CMD} "" + post-patch: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/spamass-milter.in > ${WRKDIR}/spamass-milter Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # files/extra-patch-addauth # echo x - files/extra-patch-addauth sed 's/^X//' >files/extra-patch-addauth << 'END-of-files/extra-patch-addauth' Xdiff -u orig/spamass-milter.1.in spamass-milter.1.in X--- orig/spamass-milter.1.in Thu Mar 18 10:37:08 2004 X+++ spamass-milter.1.in Wed Oct 18 18:06:23 2006 X@@ -199,6 +199,9 @@ X Requires the X .Fl u X flag. X+.It Fl a X+Causes spamass-milter to pass through unchecked any messages from connections X+established using SMTP authentication. This is useful for sites with remote users. X .It Fl - Ar spamc flags ... X Pass all remaining options to spamc. X This allows you to connect to a remote spamd with Xdiff -u orig/spamass-milter.cpp spamass-milter.cpp X--- orig/spamass-milter.cpp Thu Mar 23 13:41:36 2006 X+++ spamass-milter.cpp Wed Oct 18 21:13:25 2006 X@@ -170,6 +170,7 @@ X bool flag_full_email = false; /* pass full email address to spamc */ X bool flag_expand = false; /* alias/virtusertable expansion */ X bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */ X+bool auth = false; /* don't scan authenticated users */ X X #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ X static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; X@@ -181,7 +182,7 @@ X main(int argc, char* argv[]) X { X int c, err = 0; X- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; X+ const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xa"; X char *sock = NULL; X bool dofork = false; X char *pidfilename = NULL; X@@ -196,6 +197,9 @@ X /* Process command line options */ X while ((c = getopt(argc, argv, args)) != -1) { X switch (c) { X+ case 'a': X+ auth = true; X+ break; X case 'f': X dofork = true; X break; X@@ -281,7 +285,7 @@ X cout << "SpamAssassin Sendmail Milter Plugin" << endl; X cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl; X cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl; X- cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl; X+ cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x] [-a]" << endl; X cout << " [-- spamc args ]" << endl; X cout << " -p socket: path to create socket" << endl; X cout << " -b bucket: redirect spam to this mail address. The orignal" << endl; X@@ -302,6 +306,7 @@ X cout << " -u defaultuser: pass the recipient's username to spamc.\n" X " Uses 'defaultuser' if there are multiple recipients." << endl; X cout << " -x: pass email address through alias and virtusertable expansion." << endl; X+ cout << " -a: don't scan messages over an authenticated connection." << endl; X cout << " -- spamc args: pass the remaining flags to spamc." << endl; X X exit(EX_USAGE); X@@ -782,6 +787,15 @@ X return SMFIS_TEMPFAIL; X } X /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */ X+ X+ if (auth) { X+ const char *auth_type = smfi_getsymval(ctx, "{auth_type}"); X+ X+ if (auth_type) { X+ debug(D_MISC, "auth_type=%s", auth_type); X+ return SMFIS_ACCEPT; X+ } X+ } X X debug(D_FUNC, "mlfi_envfrom: enter"); X try { X END-of-files/extra-patch-addauth exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611151403.kAFE3dod057999>