[spamass-milter] Add -R option to specify SMTP rejection text (#1131667)

Paul Howarth pghmcfc at fedoraproject.org
Wed Feb 25 15:07:59 UTC 2015


commit 4f77148dfc8215a30532291802455bf8590e5702
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Feb 25 15:07:10 2015 +0000

    Add -R option to specify SMTP rejection text (#1131667)
    
    - Add -R option to specify SMTP rejection text (#1131667)
    - Drop %defattr, redundant since rpm 4.4

 spamass-milter-0.3.2-rejecttext.patch |  58 +++++++++++++++++++
 spamass-milter.spec                   | 105 ++++++++++++++++++----------------
 2 files changed, 114 insertions(+), 49 deletions(-)
---
diff --git a/spamass-milter-0.3.2-rejecttext.patch b/spamass-milter-0.3.2-rejecttext.patch
new file mode 100644
index 0000000..25fc8ab
--- /dev/null
+++ b/spamass-milter-0.3.2-rejecttext.patch
@@ -0,0 +1,58 @@
+--- spamass-milter.cpp
++++ spamass-milter.cpp
+@@ -166,6 +166,7 @@ bool flag_sniffuser = false;
+ 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;
+@@ -183,7 +184,7 @@ int
+ main(int argc, char* argv[])
+ {
+    int c, err = 0;
+-   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:";
++   const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:R:";
+    char *sock = NULL;
+    char *group = NULL;
+    bool dofork = false;
+@@ -242,6 +243,9 @@ main(int argc, char* argv[])
+ 				flag_reject = true;
+ 				reject_score = atoi(optarg);
+ 				break;
++			case 'R':
++				rejecttext = strdup(optarg);
++				break;
+ 			case 'u':
+ 				flag_sniffuser = true;
+ 				defaultuser = strdup(optarg);
+@@ -311,6 +315,7 @@ main(int argc, char* argv[])
+       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: specify RejectText for SMTP reject message." << 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;
+@@ -319,6 +324,11 @@ main(int argc, char* argv[])
+       exit(EX_USAGE);
+    }
+ 
++	/* Set default reject text */
++	if (rejecttext == NULL) {
++		rejecttext = strdup("Blocked by SpamAssassin");
++	}
++
+ 	if (pidfilename)
+ 	{
+ 		unlink(pidfilename);
+@@ -488,7 +498,7 @@ assassinate(SMFICTX* ctx, SpamAssassin*
+ 	if (do_reject)
+ 	{
+ 		debug(D_MISC, "Rejecting");
+-		smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
++		smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), rejecttext);
+ 
+ 
+ 		if (flag_bucket)
diff --git a/spamass-milter.spec b/spamass-milter.spec
index 0a2a27a..cc1e04d 100644
--- a/spamass-milter.spec
+++ b/spamass-milter.spec
@@ -27,7 +27,7 @@
 Summary:	Milter (mail filter) for spamassassin
 Name:		spamass-milter
 Version:	0.3.2
-Release:	14%{?dist}
+Release:	15%{?dist}
 License:	GPLv2+
 Group:		System Environment/Daemons
 URL:		http://savannah.nongnu.org/projects/spamass-milt/
@@ -50,6 +50,7 @@ Patch2:		spamass-milter-0.3.1-authuser.patch
 Patch3:		spamass-milter-0.3.2-rcvd.patch
 Patch4:		spamass-milter-0.3.2-bits.patch
 Patch5:		spamass-milter-0.3.1-group.patch
+Patch6:		spamass-milter-0.3.2-rejecttext.patch
 # Patches not yet submitted upstream
 Patch7:		spamass-milter-0.3.1-ipv6.patch
 Patch8:		spamass-milter-0.3.2-auth-no-ssf.patch
@@ -120,6 +121,10 @@ cp -p %{SOURCE3} spamass-milter-postfix-tmpfs.conf
 # Add -g option for group-writable socket for Postfix support (#452248)
 %patch5 -p1 -b .group
 
+# Add -R option to specify SMTP rejection text (#1131667)
+# http://savannah.nongnu.org/patch/?func=detailitem&item_id=5189
+%patch6 -b .rejecttext
+
 # Add IPv6 whitelisting support
 %patch7 -p1 -b .ipv6
 
@@ -266,7 +271,6 @@ fi
 /usr/sbin/usermod -a -G postfix sa-milt || :
 
 %files
-%defattr(-,root,root,-)
 %doc AUTHORS ChangeLog NEWS README
 %{_mandir}/man1/spamass-milter.1*
 %config(noreplace) %{_sysconfdir}/sysconfig/spamass-milter
@@ -285,7 +289,6 @@ fi
 %ghost %{rundir}/spamass-milter/spamass-milter.sock
 
 %files postfix
-%defattr(-,root,root,-)
 %doc README.Postfix
 %if %{rundir_tmpfs}
 %{_prefix}/lib/tmpfiles.d/spamass-milter-postfix.conf
@@ -297,6 +300,10 @@ fi
 %ghost %{rundir}/spamass-milter/postfix/sock
 
 %changelog
+* Tue Feb 24 2015 Paul Howarth <paul at city-fan.org> - 0.3.2-15
+- Add -R option to specify SMTP rejection text (#1131667)
+- Drop %%defattr, redundant since rpm 4.4
+
 * Thu Aug 21 2014 Kevin Fenzi <kevin at scrye.com> - 0.3.2-14
 - Rebuild for rpm bug 1131960
 
@@ -312,33 +319,33 @@ fi
 * Fri Feb 15 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.2-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
-* Wed Sep  5 2012 Paul Howarth <paul at city-fan.org> 0.3.2-9
+* Wed Sep  5 2012 Paul Howarth <paul at city-fan.org> - 0.3.2-9
 - Add systemd preset support (#850321)
 
-* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> 0.3.2-8
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.2-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
-* Wed Jul  4 2012 Paul Howarth <paul at city-fan.org> 0.3.2-7
+* Wed Jul  4 2012 Paul Howarth <paul at city-fan.org> - 0.3.2-7
 - Move the tmpfiles.d config from %%{_sysconfdir} to %%{_prefix}/lib
 
-* Mon Apr 16 2012 Paul Howarth <paul at city-fan.org> 0.3.2-6
+* Mon Apr 16 2012 Paul Howarth <paul at city-fan.org> - 0.3.2-6
 - Do a hardened (PIE) build where possible
 
-* Wed Jan 11 2012 Paul Howarth <paul at city-fan.org> 0.3.2-5
+* Wed Jan 11 2012 Paul Howarth <paul at city-fan.org> - 0.3.2-5
 - Rebuild for gcc 4.7 in Rawhide
 
-* Wed Aug 24 2011 Paul Howarth <paul at city-fan.org> 0.3.2-4
+* Wed Aug 24 2011 Paul Howarth <paul at city-fan.org> - 0.3.2-4
 - Add systemd init support, on by default from Fedora 16
 - %%ghost the sockets for clean uninstalls
 
-* Thu Aug 18 2011 Paul Howarth <paul at city-fan.org> 0.3.2-3
+* Thu Aug 18 2011 Paul Howarth <paul at city-fan.org> - 0.3.2-3
 - Help for users authenticating to Postfix (#730308)
 
-* Mon Jul 18 2011 Paul Howarth <paul at city-fan.org> 0.3.2-2
+* Mon Jul 18 2011 Paul Howarth <paul at city-fan.org> - 0.3.2-2
 - Drop the wrapper, which hasn't been needed since 0.3.1 was released
 - Nobody else likes macros for commands
 
-* Tue Feb 15 2011 Paul Howarth <paul at city-fan.org> 0.3.2-1
+* Tue Feb 15 2011 Paul Howarth <paul at city-fan.org> - 0.3.2-1
 - Update to 0.3.2 (upstream fix for popen unsanitized input vulnerability:
   CVE-2010-1132, #572117, #572119, http://savannah.nongnu.org/bugs/?29136)
 - Drop popen patch, now upstream
@@ -347,34 +354,34 @@ fi
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.1-25
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
-* Tue Nov 30 2010 Paul Howarth <paul at city-fan.org> 0.3.1-24
+* Tue Nov 30 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-24
 - Require systemd-units for ownership of /etc/tmpfiles.d directory
 - Add Default-Stop LSB keyword in initscript
 
-* Fri Nov 26 2010 Paul Howarth <paul at city-fan.org> 0.3.1-23
+* Fri Nov 26 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-23
 - Make sure /var/run/spamass-milter and /var/run/spamass-milter/postfix exist
   at boot time for systems with /var/run on tmpfs (#656692)
 
 * Wed Sep 29 2010 jkeating - 0.3.1-22
 - Rebuilt for gcc bug 634757
 
-* Thu Sep 23 2010 Paul Howarth <paul at city-fan.org> 0.3.1-21
+* Thu Sep 23 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-21
 - Add IPv6 whitelisting support (#630263)
 
-* Tue Jun  8 2010 Paul Howarth <paul at city-fan.org> 0.3.1-20
+* Tue Jun  8 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-20
 - RHEL-6 onwards have noarch subpackages, so make spamass-milter-postfix one
 
-* Mon Apr 19 2010 Paul Howarth <paul at city-fan.org> 0.3.1-19
+* Mon Apr 19 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-19
 - Fix patch for CVE-2010-1132 to not create a zombie process per email when
   the -x or -b options are used (#583523)
 
-* Tue Mar 23 2010 Paul Howarth <paul at city-fan.org> 0.3.1-18
+* Tue Mar 23 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-18
 - Add patch to get rid of compiler warnings
 - Reorder and re-base patches to optimize chances of upstream accepting them
 - Improve Received-header patch (#496763) incorporating additional fix from
   upstream update (http://savannah.nongnu.org/bugs/?17178)
 
-* Fri Mar 12 2010 Paul Howarth <paul at city-fan.org> 0.3.1-17
+* Fri Mar 12 2010 Paul Howarth <paul at city-fan.org> - 0.3.1-17
 - Update initscript to support running the milter as root, which is needed
   for the -x (expand aliases) option; note that the milter does not run as
   root by default
@@ -386,19 +393,19 @@ fi
   merge the macro documentation patch into this patch
 - Document patch usage in spec file
 
-* Tue Aug 11 2009 Paul Howarth <paul at city-fan.org> 0.3.1-16
+* Tue Aug 11 2009 Paul Howarth <paul at city-fan.org> - 0.3.1-16
 - Switch to bzipped source tarball
 
-* Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> 0.3.1-15
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.1-15
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 
-* Fri Apr 24 2009 Paul Howarth <paul at city-fan.org> 0.3.1-14
+* 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
+* 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
 - Change sa-milt user's home directory from
@@ -406,18 +413,18 @@ fi
   so as to retain directory contents across a reboot (#489995), and fix the home
   directory of any existing sa-milt account on upgrades
 
-* Fri Feb 27 2009 Paul Howarth <paul at city-fan.org> 0.3.1-12
+* Fri Feb 27 2009 Paul Howarth <paul at city-fan.org> - 0.3.1-12
 - Subpackage for postfix is now noarch for Fedora 10 onwards
 - Fix scriptlet deps to ensure that sa-milt user exists before we attempt to
   add it to the postfix group
 
-* Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> 0.3.1-11
+* Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.1-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 
-* Fri Feb 13 2009 Paul Howarth <paul at city-fan.org> 0.3.1-10
+* Fri Feb 13 2009 Paul Howarth <paul at city-fan.org> - 0.3.1-10
 - Rebuild for shared libmilter in Fedora 11 development
 
-* Thu Jul  3 2008 Paul Howarth <paul at city-fan.org> 0.3.1-9
+* Thu Jul  3 2008 Paul Howarth <paul at city-fan.org> - 0.3.1-9
 - Require /usr/sbin/sendmail (for -b/-B/-x options) rather than sendmail pkg
 - Make summary and description less Sendmail-specific
 - Add patch to support group-writable socket for MTA communication, needed
@@ -427,28 +434,28 @@ fi
   present
 - Document additional ENVRCPT macros to provide
 
-* Tue May 20 2008 Paul Howarth <paul at city-fan.org> 0.3.1-8
+* Tue May 20 2008 Paul Howarth <paul at city-fan.org> - 0.3.1-8
 - Fix initscript failure to start with SELinux in enforcing mode (#447247)
   (needs selinux-policy >= 3.3.1-55 on F9)
 
-* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> 0.3.1-7
+* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.3.1-7
 - Autorebuild for GCC 4.3
 
-* Mon Feb 18 2008 Paul Howarth <paul at city-fan.org> 0.3.1-6
+* Mon Feb 18 2008 Paul Howarth <paul at city-fan.org> - 0.3.1-6
 - Rebuild with gcc 4.3.0 for Fedora 9
 
-* Fri Oct 12 2007 Paul Howarth <paul at city-fan.org> 0.3.1-5
+* Fri Oct 12 2007 Paul Howarth <paul at city-fan.org> - 0.3.1-5
 - Split initscript and config out from being here documents in the spec and
   have them as separate source files instead
 - Unexpand tabs
 - Clarify license as GPL v2 or later (GPLv2+)
 - Use the standard scriptlet for user/group creation in %%pre
 
-* Wed Aug 30 2006 Paul Howarth <paul at city-fan.org> 0.3.1-4
+* Wed Aug 30 2006 Paul Howarth <paul at city-fan.org> - 0.3.1-4
 - Use make/DESTDIR instead of deprecated %%makeinstall macro
 - Expand tabs and clean up changelog entries
 
-* Mon May 15 2006 Paul Howarth <paul at city-fan.org> 0.3.1-3
+* Mon May 15 2006 Paul Howarth <paul at city-fan.org> - 0.3.1-3
 - Use upstream default settings (#191602)
   This change re-enables by default Subject/Content-Type header modification
   (which may have a performance impact for large messages) and disables by
@@ -457,45 +464,45 @@ fi
   EXTRA_FLAGS="-m -r 15"
   in %%{_sysconfdir}/sysconfig/spamass-milter
   
-* Sun May  7 2006 Paul Howarth <paul at city-fan.org> 0.3.1-2
+* Sun May  7 2006 Paul Howarth <paul at city-fan.org> - 0.3.1-2
 - Fix race condition in "stop" clause of initscript (#190894)
 
-* Thu Apr  6 2006 Paul Howarth <paul at city-fan.org> 0.3.1-1
+* Thu Apr  6 2006 Paul Howarth <paul at city-fan.org> - 0.3.1-1
 - Update to 0.3.1
 
-* Wed Feb 15 2006 Paul Howarth <paul at city-fan.org> 0.3.0-9
+* Wed Feb 15 2006 Paul Howarth <paul at city-fan.org> - 0.3.0-9
 - Don't use macros in command paths, hardcode them instead
 
-* Mon Aug  1 2005 Paul Howarth <paul at city-fan.org> 0.3.0-8
+* Mon Aug  1 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-8
 - Run the milter in a wrapper script that restarts it if it crashes
 
-* Thu Jun 16 2005 Paul Howarth <paul at city-fan.org> 0.3.0-7
+* Thu Jun 16 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-7
 - Bump and rebuild due to transient build system failure
 
-* Wed Jun 15 2005 Paul Howarth <paul at city-fan.org> 0.3.0-6
+* Wed Jun 15 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-6
 - Adjust initscript chkconfig values so it starts before sendmail
 
-* Mon Jun 13 2005 Paul Howarth <paul at city-fan.org> 0.3.0-5
+* Mon Jun 13 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-5
 - Help the configure script find sendmail
 
-* Mon Jun 13 2005 Paul Howarth <paul at city-fan.org> 0.3.0-4
+* Mon Jun 13 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-4
 - Bump and rebuild
 
-* Mon Jun 06 2005 Paul Howarth <paul at city-fan.org> 0.3.0-3
+* Mon Jun 06 2005 Paul Howarth <paul at city-fan.org> - 0.3.0-3
 - Use Extras standard buildroot
 - Unpack tarball quietly
 - Create account sa-milt and run the milter using that instead of root
 - Fix socket name in README
 - Initscript not %%config
 
-* Sun Jun 05 2005 Warren Togami <wtogami at redhat.com> 0.3.0-2
+* Sun Jun 05 2005 Warren Togami <wtogami at redhat.com> - 0.3.0-2
 - Extras
 
-* Tue Feb 08 2005 Dag Wieers <dag at wieers.com> 0.3.0-1
-- Updated to release 0.3.0.
+* Tue Feb 08 2005 Dag Wieers <dag at wieers.com> - 0.3.0-1
+- Updated to release 0.3.0
 
-* Wed Sep 01 2004 Dag Wieers <dag at wieers.com> 0.2.0-1
-- Fixed variables in sysconfig file. (mator)
+* Wed Sep 01 2004 Dag Wieers <dag at wieers.com> - 0.2.0-1
+- Fixed variables in sysconfig file (mator)
 
-* Tue Feb 17 2004 Dag Wieers <dag at wieers.com> 0.2.0-0
-- Initial package. (using DAR)
+* Tue Feb 17 2004 Dag Wieers <dag at wieers.com> - 0.2.0-0
+- Initial package (using DAR)


More information about the scm-commits mailing list