rpms/spamass-milter/F-11 spamass-milter-0.3.1-authuser.patch, NONE, 1.1 spamass-milter-0.3.1-bits.patch, NONE, 1.1 spamass-milter-0.3.1-rcvd.patch, NONE, 1.1 spamass-milter.spec, 1.19, 1.20

Paul Howarth pghmcfc at fedoraproject.org
Fri Apr 24 16:01:55 UTC 2009


Author: pghmcfc

Update of /cvs/pkgs/rpms/spamass-milter/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12882/F-11

Modified Files:
	spamass-milter.spec 
Added Files:
	spamass-milter-0.3.1-authuser.patch 
	spamass-milter-0.3.1-bits.patch 
	spamass-milter-0.3.1-rcvd.patch 
Log Message:
* Fri Apr 24 2009 Paul Howarth <paul at city-fan.org> 0.3.1-14
- Fix Received-header generation (#496763)
- Add authentication info to dummy Received-header (#496769)
- Add option to skip checks for authenticated senders (#437506, #496767)
  (thanks to Habeeb J. Dihu for the reports and patches)


spamass-milter-0.3.1-authuser.patch:

--- NEW FILE spamass-milter-0.3.1-authuser.patch ---
--- spamass-milter-0.3.1/spamass-milter.cpp.ori	2009-04-20 21:11:55.000000000 -0500
+++ spamass-milter-0.3.1/spamass-milter.cpp	2009-04-20 21:14:20.000000000 -0500
@@ -172,6 +172,7 @@
 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 */
 
 #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */
 static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -183,7 +184,7 @@
 main(int argc, char* argv[])
 {
    int c, err = 0;
-   const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xg:";
+   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:";
    char *sock = NULL;
    char *group = NULL;
    bool dofork = false;
@@ -216,6 +217,10 @@
 				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;
@@ -286,7 +291,7 @@
       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;
@@ -301,6 +306,7 @@
       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;
@@ -812,6 +818,22 @@
   }
   /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
 
+  if (ignore_authenticated_senders)
+  {
+    char *auth_authen;
+
+    auth_authen = smfi_getsymval(ctx, "{auth_authen}");
+    debug(D_MISC, "auth_authen=%s", 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

--- spamass-milter-0.3.1/spamass-milter.1.in.ori	2009-04-20 21:11:55.000000000 -0500
+++ spamass-milter-0.3.1/spamass-milter.1.in	2009-04-20 21:17:36.000000000 -0500
@@ -15,6 +15,7 @@
 .Op Fl f
 .Op Fl g Ar group
 .Op Fl i Ar networks
+.Op Fl I
 .Op Fl m
 .Op Fl M
 .Op Fl P Ar pidfile
@@ -126,6 +127,8 @@
 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: 

spamass-milter-0.3.1-bits.patch:

--- NEW FILE spamass-milter-0.3.1-bits.patch ---
--- spamass-milter-0.3.1/spamass-milter.cpp.orig	2009-04-20 21:29:57.000000000 -0500
+++ spamass-milter-0.3.1/spamass-milter.cpp	2009-04-20 22:07:51.000000000 -0500
@@ -975,7 +975,9 @@
 		   
 		*/
 		const char *macro_b, *macro_i, *macro_j, *macro_r,
-		           *macro_s, *macro_v, *macro_Z, *macro__;
+		           *macro_s, *macro_v, *macro_Z, *macro__,
+			   *macro_auth_ssf, *macro_auth_authen, *macro_auth_author,
+			   *macro_auth_type;
 		char date[32];
 
 		/* RFC 822 date. */
@@ -1013,6 +1015,36 @@
 			warnmacro("r", "ENVRCPT");
 		}
 			
+		/* Authenticated bits Information */
+		macro_auth_ssf = smfi_getsymval(ctx, "{auth_ssf}");
+		if (!macro_auth_ssf)
+		{
+			macro_auth_ssf = "";
+			warnmacro("auth_ssf", "ENVRCPT");
+		}
+			
+		macro_auth_authen = smfi_getsymval(ctx, "{auth_authen}");
+		if (!macro_auth_authen)
+		{
+			macro_auth_authen = "";
+			warnmacro("auth_authen", "ENVRCPT");
+		}
+			
+		macro_auth_author = smfi_getsymval(ctx, "{auth_author}");
+		if (!macro_auth_author)
+		{
+			macro_auth_author = "";
+			warnmacro("auth_author", "ENVRCPT");
+		}
+			
+		macro_auth_type = smfi_getsymval(ctx, "{auth_type}");
+		if (!macro_auth_type)
+		{
+			macro_auth_type = "";
+			warnmacro("auth_type", "ENVRCPT");
+		}
+			
+			
 		/* Sendmail currently cannot pass us the {s} macro, but
 		   I do not know why.  Leave this in for the day sendmail is
 		   fixed.  Until that day, use the value remembered by
@@ -1051,11 +1083,21 @@
 		assassin->output((string)"X-Envelope-From: "+assassin->from()+"\r\n");
 		assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");
 
-		assassin->output((string)
-			"Received: from "+macro_s+" ("+macro__+")\r\n\t"+
-			"by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+
-			macro_b+"\r\n\t"+
-			"(envelope-from "+assassin->from()+")\r\n");
+		string rec_header;
+
+		rec_header = (string) "Received: from " + macro_s + " (" + macro__ + ")\r\n\t";
+
+		if (strlen(macro_auth_ssf)) {
+			rec_header += (string) "(authenticated bits=" + macro_auth_ssf + ")\r\n\t";
+		}
+
+		rec_header += (string) "by " + macro_j + " (" + macro_v + "/" + macro_Z + ") with " +
+			macro_r + " id " + macro_i + "\r\n\t" +
+			macro_b + "\r\n\t" +
+			"(envelope-from " + assassin->from() + ")\r\n";
+
+		debug(D_SPAMC, "Received header for spamc: %s", rec_header.c_str());
+		assassin->output(rec_header);
 
 	} else
 		assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");

spamass-milter-0.3.1-rcvd.patch:

--- NEW FILE spamass-milter-0.3.1-rcvd.patch ---
--- spamass-milter-0.3.1/spamass-milter.cpp.ori	2006-03-23 15:41:36.000000000 -0600
+++ spamass-milter-0.3.1/spamass-milter.cpp	2009-04-20 20:03:31.000000000 -0500
@@ -1002,9 +1002,9 @@
 
 		assassin->output((string)
 			"Received: from "+macro_s+" ("+macro__+")\r\n\t"+
-			"by "+macro_j+"("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+
+			"by "+macro_j+" ("+macro_v+"/"+macro_Z+") with "+macro_r+" id "+macro_i+"\r\n\t"+
 			macro_b+"\r\n\t"+
-			"(envelope-from "+assassin->from()+"\r\n");
+			"(envelope-from "+assassin->from()+")\r\n");
 
 	} else
 		assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n");


Index: spamass-milter.spec
===================================================================
RCS file: /cvs/pkgs/rpms/spamass-milter/F-11/spamass-milter.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- spamass-milter.spec	18 Mar 2009 16:11:19 -0000	1.19
+++ spamass-milter.spec	24 Apr 2009 16:01:24 -0000	1.20
@@ -1,7 +1,7 @@
 Summary:	Milter (mail filter) for spamassassin
 Name:		spamass-milter
 Version:	0.3.1
-Release:	13%{?dist}
+Release:	14%{?dist}
 License:	GPLv2+
 Group:		System Environment/Daemons
 URL:		http://savannah.nongnu.org/projects/spamass-milt/
@@ -13,6 +13,9 @@
 Patch0:		spamass-milter-0.3.1-pathnames.patch
 Patch1:		spamass-milter-0.3.1-macros.patch
 Patch2:		spamass-milter-0.3.1-group.patch
+Patch3:		spamass-milter-0.3.1-rcvd.patch
+Patch4:		spamass-milter-0.3.1-bits.patch
+Patch5:		spamass-milter-0.3.1-authuser.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	spamassassin, sendmail-devel
 Requires:	spamassassin, /usr/sbin/sendmail
@@ -46,6 +49,9 @@
 %patch0 -p1 -b .pathnames
 %patch1 -p1 -b .macros
 %patch2 -p1 -b .group
+%patch3 -p1 -b .rcvd
+%patch4 -p1 -b .bits
+%patch5 -p1 -b .authuser
 %{__cp} -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .
 %{__sed} -i -e 's|%%{_localstatedir}|%{_localstatedir}|g;
 		s|%%{_initrddir}|%{_initrddir}|g;
@@ -117,6 +123,12 @@
 %dir %attr(-,sa-milt,postfix) %{_localstatedir}/run/spamass-milter/postfix/
 
 %changelog
+* Fri Apr 24 2009 Paul Howarth <paul at city-fan.org> 0.3.1-14
+- Fix Received-header generation (#496763)
+- Add authentication info to dummy Received-header (#496769)
+- Add option to skip checks for authenticated senders (#437506, #496767)
+  (thanks to Habeeb J. Dihu for the reports and patches)
+
 * Wed Mar 18 2009 Paul Howarth <paul at city-fan.org> 0.3.1-13
 - Call initscripts directly instead of via /sbin/service and fine-tune scriptlet
   dependencies




More information about the fedora-extras-commits mailing list