[csw-devel] SF.net SVN: gar:[19209] csw/mgar/pkg/spamass-milter/trunk

guengel at users.sourceforge.net guengel at users.sourceforge.net
Sat Sep 15 16:51:10 CEST 2012


Revision: 19209
          http://gar.svn.sourceforge.net/gar/?rev=19209&view=rev
Author:   guengel
Date:     2012-09-15 14:51:09 +0000 (Sat, 15 Sep 2012)
Log Message:
-----------
spamass-milter/trunk: Added patch in order to allow bypassing checks for authenticated users when using with postfix

Modified Paths:
--------------
    csw/mgar/pkg/spamass-milter/trunk/Makefile
    csw/mgar/pkg/spamass-milter/trunk/files/README.CSW
    csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW
    csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter
    csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW

Added Paths:
-----------
    csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter-0.3.1-authuser.patch

Modified: csw/mgar/pkg/spamass-milter/trunk/Makefile
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/Makefile	2012-09-15 14:41:51 UTC (rev 19208)
+++ csw/mgar/pkg/spamass-milter/trunk/Makefile	2012-09-15 14:51:09 UTC (rev 19209)
@@ -3,11 +3,15 @@
 CATEGORIES = net
 GARTYPE = v2
 
+PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386
+
 DESCRIPTION = Plugin for the Sendmail Milter library for SpamAssassin
 define BLURB
   Plugin for the Sendmail Milter library for SpamAssassin
 endef
 
+
+
 MASTER_SITES = http://download.savannah.gnu.org/releases/spamass-milt/
 DISTFILES  = $(NAME)-$(VERSION).tar.gz
 DISTFILES += cswspamass-milter
@@ -18,6 +22,12 @@
 DISTFILES += spamass-milter.m4
 
 PATCHFILES  = 0000-Workaround-for-missing-paths.h.patch
+# This patch has been extracted from
+#
+#  http://download.fedoraproject.org/pub/fedora/linux/releases/17/Everything/source/SRPMS/spamass-milter-0.3.2-6.fc17.src.rpm
+#
+# retrieved on 2012-09-14.
+PATCHFILES += spamass-milter-0.3.1-authuser.patch
 
 INITSMF = $(sysconfdir)/init.d/cswspamass-milter
 PRESERVECONF = $(sysconfdir)/spamass-milter

Modified: csw/mgar/pkg/spamass-milter/trunk/files/README.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/README.CSW	2012-09-15 14:41:51 UTC (rev 19208)
+++ csw/mgar/pkg/spamass-milter/trunk/files/README.CSW	2012-09-15 14:51:09 UTC (rev 19209)
@@ -75,4 +75,22 @@
 
 In any case, the filter will be called `spamass-milter'.
 
+
+Postfix
+-------
+
+This release of spamass-milter has been patched in order to support
+bypassing checks for authenticated users. To enable the bypass, edit
+
+ /etc/opt/csw/spamass-milter
+
+or 
+
+ /opt/csw/etc/spamass-milter
+
+and set 
+
+ POSTFIX_IGNORE_AUTH_USER=yes
+
+
 Direct comments and/or suggestions to raos at opencsw.org.

Modified: csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW	2012-09-15 14:41:51 UTC (rev 19208)
+++ csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW	2012-09-15 14:51:09 UTC (rev 19209)
@@ -1,3 +1,13 @@
+spamass-milter (0.3.2,REV=2012.09.15)
+
+  * Dropped support for Solaris 9
+
+  * Added command line option to bypass checks for authenticated users
+    when using postfix
+
+ -- Rafael Ostertag <raos at opencsw.org>  Sat, 15 Sep 2012 14:58:7 +0200
+
+
 spamass-milter (0.3.2,REV=2012.06.16)
 
   * Fixed comments spamass-milter.m4 in order to avoid recursive

Modified: csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter	2012-09-15 14:41:51 UTC (rev 19208)
+++ csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter	2012-09-15 14:51:09 UTC (rev 19209)
@@ -218,6 +218,20 @@
 	    ;;
     esac
 fi
+if [ -n "${POSTFIX_IGNORE_AUTH_USER}" ]
+then
+    case "${POSTFIX_IGNORE_AUTH_USER}" in
+	'yes')
+	    ARGS="${ARGS} -I"
+	    ;;
+	'no')
+	    :
+	    ;;
+	*)
+	    warning "${POSTFIX_IGNORE_AUTH_USER} is not a valid value for POSTFIX_IGNORE_AUTH_USER. Assuming 'no'."
+	    ;;
+    esac
+fi
 if [ -n "${SPAMC_FLAGS}" ]
 then
     ARGS="${ARGS} -- ${SPAMC_FLAGS}"

Added: csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter-0.3.1-authuser.patch
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter-0.3.1-authuser.patch	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter-0.3.1-authuser.patch	2012-09-15 14:51:09 UTC (rev 19209)
@@ -0,0 +1,91 @@
+diff -up spamass-milter-0.3.1/spamass-milter.cpp.authuser spamass-milter-0.3.1/spamass-milter.cpp
+--- spamass-milter-0.3.1/spamass-milter.cpp.authuser	2010-03-23 21:04:56.976920217 +0000
++++ spamass-milter-0.3.1/spamass-milter.cpp	2010-03-23 21:07:12.508020535 +0000
+@@ -172,6 +172,7 @@ char *spambucket;
+ bool flag_full_email = false;		/* pass full email address to spamc */
+ bool flag_expand = false;	/* alias/virtusertable expansion */
+ bool warnedmacro = false;	/* have we logged that we couldn't fetch a macro? */
++bool ignore_authenticated_senders = false;	/* authenticated users bypass spam checks */
+ 
+ // {{{ main()
+ 
+@@ -179,7 +180,7 @@ int
+ 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:u:D:i:Ib:B:e:x";
+    char *sock = NULL;
+    bool dofork = false;
+    char *pidfilename = NULL;
+@@ -211,6 +212,10 @@ main(int argc, char* argv[])
+ 				debug(D_MISC, "Parsing ignore list");
+ 				parse_networklist(optarg, &ignorenets);
+ 				break;
++			case 'I':
++				debug(D_MISC, "Ignore authenticated senders");
++				ignore_authenticated_senders = true;
++				break;
+ 			case 'm':
+ 				dontmodifyspam = true;
+ 				smfilter.xxfi_flags &= ~SMFIF_CHGBODY;
+@@ -278,7 +283,7 @@ main(int argc, char* argv[])
+       cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl;
+       cout << "SpamAssassin Sendmail Milter Plugin" << endl;
+       cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
+-      cout << "                      [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
++      cout << "                      [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl;
+       cout << "                      [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl;
+       cout << "                      [-- spamc args ]" << endl;
+       cout << "   -p socket: path to create socket" << endl;
+@@ -292,6 +297,7 @@ main(int argc, char* argv[])
+       cout << "   -f: fork into background" << endl;
+       cout << "   -i: skip (ignore) checks from these IPs or netblocks" << endl;
+       cout << "          example: -i 192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0" << endl;
++      cout << "   -I: skip (ignore) checks if sender is authenticated" << endl;
+       cout << "   -m: don't modify body, Content-type: or Subject:" << endl;
+       cout << "   -M: don't modify the message at all" << endl;
+       cout << "   -P pidfile: Put processid in pidfile" << endl;
+@@ -746,6 +752,22 @@ mlfi_envfrom(SMFICTX* ctx, char** envfro
+   }
+   /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
+ 
++  if (ignore_authenticated_senders)
++  {
++    char *auth_authen;
++
++    auth_authen = smfi_getsymval(ctx, const_cast<char *>("{auth_authen}"));
++    debug(D_MISC, "auth_authen=%s", auth_authen ? auth_authen : "<unauthenticated>");
++
++    if (auth_authen)
++    {
++      debug(D_MISC, "sender authenticated (%s) - accepting message",
++	    auth_authen);
++      debug(D_FUNC, "mlfi_envfrom: exit ignore");
++      return SMFIS_ACCEPT;
++    }
++  }
++
+   debug(D_FUNC, "mlfi_envfrom: enter");
+   try {
+     // launch new SpamAssassin
+diff -up spamass-milter-0.3.1/spamass-milter.1.in.authuser spamass-milter-0.3.1/spamass-milter.1.in
+--- spamass-milter-0.3.1/spamass-milter.1.in.authuser	2004-03-18 18:37:08.000000000 +0000
++++ spamass-milter-0.3.1/spamass-milter.1.in	2010-03-23 21:06:27.148897685 +0000
+@@ -14,6 +14,7 @@
+ .Op Fl e Ar defaultdomain
+ .Op Fl f
+ .Op Fl i Ar networks
++.Op Fl I
+ .Op Fl m
+ .Op Fl M
+ .Op Fl P Ar pidfile
+@@ -119,6 +120,8 @@ Multiple
+ flags will append to the list.
+ For example, if you list all your internal networks, no outgoing emails
+ will be filtered.
++.It Fl I
++Ignores messages if the sender has authenticated via SMTP AUTH.
+ .It Fl m
+ Disables modification of the 
+ .Ql Subject: 

Modified: csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW	2012-09-15 14:41:51 UTC (rev 19208)
+++ csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW	2012-09-15 14:51:09 UTC (rev 19209)
@@ -1,3 +1,4 @@
+# -*- sh -*-*
 # This is a shell script fragment. It will be sourced by
 # /etc/opt/csw/init.d/cswspamass-milter.
 #
@@ -89,9 +90,19 @@
 # Default: no
 #MAILADDR_EXPANSION=no
 
+# This is mainly for postfix users. It instructs spamass-milter to NOT
+# check mails from authenticated users.
+#
+# This is switch is not available in the stock spamass-milter.
+#
+# Values: yes,no (yes: -I)
+#
+# Default: no
+#POSTFIX_IGNORE_AUTH_USER=yes
+
 # Pass flags to spamc.
 #
 # Equivalent to: --
 #
 # Default: none
-#SPAMC_FLAGS=
\ No newline at end of file
+#SPAMC_FLAGS=

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list