rpms/exim/devel exim-4.69-expand-spamd.patch, NONE, 1.1 exim.spec, 1.64, 1.65

David Woodhouse dwmw2 at fedoraproject.org
Mon Aug 31 13:25:16 UTC 2009


Author: dwmw2

Update of /cvs/pkgs/rpms/exim/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32399

Modified Files:
	exim.spec 
Added Files:
	exim-4.69-expand-spamd.patch 
Log Message:
expand 

exim-4.69-expand-spamd.patch:
 spam.c |   31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

--- NEW FILE exim-4.69-expand-spamd.patch ---
diff --git a/src/spam.c b/src/spam.c
index bf2470c..aab96c6 100644
--- a/src/spam.c
+++ b/src/spam.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/spam.c,v 1.14 2007/05/14 18:56:25 magnus Exp $ */
+/* $Cambridge: exim/exim-src/src/spam.c,v 1.16 2008/01/28 13:14:48 tom Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -46,6 +46,7 @@ int spam(uschar **listptr) {
   struct timeval select_tv;         /* and applied by PH */
   fd_set select_fd;
 #endif
+  uschar *spamd_address_work;
 
   /* stop compiler warning */
   result = 0;
@@ -89,14 +90,26 @@ int spam(uschar **listptr) {
   };
 
   start = time(NULL);
+
+  if (*spamd_address == '$') {
+    spamd_address_work = expand_string(spamd_address);
+    if (spamd_address_work == NULL) {
+      log_write(0, LOG_MAIN|LOG_PANIC,
+        "spamassassin acl condition: spamd_address starts with $, but expansion failed: %s", expand_string_message);
+      return DEFER;
+    }
+  }
+  else
+    spamd_address_work = spamd_address;
+
   /* socket does not start with '/' -> network socket */
-  if (*spamd_address != '/') {
+  if (*spamd_address_work != '/') {
     time_t now = time(NULL);
     int num_servers = 0;
     int current_server = 0;
     int start_server = 0;
     uschar *address = NULL;
-    uschar *spamd_address_list_ptr = spamd_address;
+    uschar *spamd_address_list_ptr = spamd_address_work;
     uschar address_buffer[256];
     spamd_address_container * spamd_address_vector[32];
 
@@ -184,12 +197,12 @@ int spam(uschar **listptr) {
     }
 
     server.sun_family = AF_UNIX;
-    Ustrcpy(server.sun_path, spamd_address);
+    Ustrcpy(server.sun_path, spamd_address_work);
 
     if (connect(spamd_sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
       log_write(0, LOG_MAIN|LOG_PANIC,
                 "malware acl condition: spamd: unable to connect to UNIX socket %s (%s)",
-                spamd_address, strerror(errno) );
+                spamd_address_work, strerror(errno) );
       (void)fclose(mbox_file);
       (void)close(spamd_sock);
       return DEFER;
@@ -395,9 +408,11 @@ again:
     spam_rc = FAIL;
   };
 
-  /* remember user name and "been here" for it */
-  Ustrcpy(prev_user_name, user_name);
-  spam_ok = 1;
+  /* remember user name and "been here" for it unless spamd_socket was expanded */
+  if (spamd_address_work == spamd_address) {
+    Ustrcpy(prev_user_name, user_name);
+    spam_ok = 1;
+  }
 
   if (override) {
     /* always return OK, no matter what the score */


Index: exim.spec
===================================================================
RCS file: /cvs/pkgs/rpms/exim/devel/exim.spec,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -p -r1.64 -r1.65
--- exim.spec	31 Aug 2009 13:23:00 -0000	1.64
+++ exim.spec	31 Aug 2009 13:25:16 -0000	1.65
@@ -12,7 +12,7 @@
 Summary: The exim mail transfer agent
 Name: exim
 Version: 4.69
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: GPLv2+
 Url: http://www.exim.org/
 Group: System Environment/Daemons
@@ -54,6 +54,7 @@ Patch23: exim-4.67-smarthost-config.patc
 Patch24: exim-4.69-dynlookup.patch
 Patch25: exim-4.69-dynlookup-config.patch
 Patch26: exim-4.69-strictaliasing.patch
+Patch27: exim-4.69-expand-spamd.patch
 
 Requires: /etc/pki/tls/certs /etc/pki/tls/private
 Requires: /etc/aliases
@@ -185,7 +186,7 @@ greylisting unconditional.
 %patch24 -p1 -b .dynlookup
 %patch25 -p1 -b .dynconfig
 %patch26 -p1 -b .strictaliasing
-
+%patch27 -p1 -b .expandspamd
 
 cp src/EDITME Local/Makefile
 sed -i 's@^# LOOKUP_MODULE_DIR=.*@LOOKUP_MODULE_DIR=%{_libdir}/exim/%{version}-%{release}/lookups@' Local/Makefile
@@ -488,6 +489,7 @@ test "$1"  = 0 || %{_initrddir}/clamd.ex
 %changelog
 * Mon Aug 31 2009 David Woodhouse <David.Woodhouse at intel.com> - 4.69-16
 - Create group for exim with correct gid (#518706)
+- Allow expansion of spamd_address
 
 * Fri Aug 21 2009 Tomas Mraz <tmraz at redhat.com> - 4.69-15
 - rebuilt with new openssl




More information about the fedora-extras-commits mailing list