Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package sa-exim:

Fixes have been made to address the issues that caused the Exim team to drop 
the local_scan support (wich sa-exim admittedly is the only package 
utilizing), but then reinstated in anticipation of this upload. Please refer 
to https://bugs.debian.org/926878 for the discussion.

There's no bug report mentioned in the changelog corresponding to the fix for 
the overwriting ov local_hostname because I thought #926952 was about that, 
but that was more about exim4-dev missing due to the Exim team's decision due 
to that bug, so it was closed when exim4 4.92-6 was uploaded to unstable. 
Anyway, the the changes are small and address significant bugs that can cause 
perhaps not data loss but great inconvenience in repairing data in certain 
circumstances.

So I'd be grateful if you'd

unblock sa-exim/4.2.1-17

Thanks,
-- 
Magnus Holmgren        holmg...@debian.org
Debian Developer 
Index: debian/patches/api-limitations.patch
===================================================================
--- debian/patches/api-limitations.patch	(revision 87)
+++ debian/patches/api-limitations.patch	(arbetskopia)
@@ -5,9 +5,9 @@
 Bug-Debian: http://bugs.debian.org/420555
 Bug-Debian: http://bugs.debian.org/420736
 
---- sa-exim-4.2.1.orig/sa-exim.c
-+++ sa-exim-4.2.1/sa-exim.c
-@@ -29,10 +29,8 @@ http://lists.merlins.org/lists/listinfo/
+--- a/sa-exim.c
++++ b/sa-exim.c
+@@ -29,10 +29,7 @@ http://lists.merlins.org/lists/listinfo/
  #include "sa-exim.h"
  
  /* Exim includes */
@@ -16,50 +16,43 @@
 -extern int     body_linecount;         /* Line count in body */
 -extern uschar *primary_hostname;
 +#include <local_scan.h>
-+//extern int     body_linecount;         /* Line count in body */
  
  #ifdef DLOPEN_LOCAL_SCAN
  
-@@ -602,6 +602,15 @@ int local_scan(volatile int fd, uschar *
+@@ -602,6 +599,10 @@ int local_scan(volatile int fd, uschar *
      /* Do not put a %s in there, or you'll segfault */
      static char *SAmsgerror="Temporary local error while processing message, please contact postmaster";
  
 +    /* This needs to be retrieved through expand_string in order
 +       not to violate the API. */
-+    static uschar *primary_hostname;
-+    if (!primary_hostname) {
-+        store_pool = POOL_PERM;
-+        primary_hostname = expand_string("$primary_hostname");
-+        store_pool = POOL_MAIN;
-+    }
++    uschar *primary_hostname=expand_string("$primary_hostname");
 +
      /* New values we read from spamassassin */
      char *xspamstatus=NULL;
      char *xspamflag=NULL;
-@@ -1229,18 +1268,19 @@ restart:
+@@ -1229,18 +1230,20 @@ restart:
  	    }
  	}
  
--	if (SAEximDebug > 1)
-+/*	if (SAEximDebug > 1)
++	
+ 	if (SAEximDebug > 1)
  	{
  	    log_write(0, LOG_MAIN, "SA: Debug2: body_linecount before SA: %d", body_linecount);
  	}
--
-+*/
+ 
  	/* update global variable $body_linecount to reflect the new body size*/
 -	body_linecount = (line - 1);
-+/*	body_linecount = (line - 1);
++	if (body_linecount > 0) body_linecount = (line - 1); // Not updating if zero, indicating spool_wireformat
  
  	if (SAEximDebug > 1)
  	{
  	    log_write(0, LOG_MAIN, "SA: Debug2: body_linecount after SA: %d", body_linecount);
  	}
-+*/
++
      }
  
      fclose((FILE *)readfh);
-@@ -1331,6 +1371,9 @@ restart:
+@@ -1331,6 +1334,9 @@ restart:
  	
  	if (dorej && doteergrube)
  	{
@@ -69,7 +62,7 @@
  	    /* By default, we'll only save temp bounces by message ID so
  	     * that when the same message is submitted several times, we
  	     * overwrite the same file on disk and not create a brand new
-@@ -1353,20 +1396,8 @@ restart:
+@@ -1353,20 +1359,8 @@ restart:
  
  	    for (i=0;i<SAteergrubetime/10;i++)
  	    {
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 87)
+++ debian/patches/series	(arbetskopia)
@@ -9,3 +9,4 @@
 greylisting-ipv6.patch
 greylist-lint.patch
 delete-ext-html-references.patch
+remove-header-crs.patch
Index: debian/patches/remove-header-crs.patch
===================================================================
--- debian/patches/remove-header-crs.patch	(finns ej)
+++ debian/patches/remove-header-crs.patch	(revision 90)
@@ -0,0 +1,32 @@
+Description: Delete carriage returns from header lines.
+ When spamd gets a message with CRLF line endings, which it will when
+ the spool file is in wire format, it will return a message with CRLF
+ line endings, including the header. We will need to strip out the
+ CRs.
+
+--- a/sa-exim.c
++++ b/sa-exim.c
+@@ -406,6 +406,11 @@ int parsemlheader(char *buffer, FILE *re
+ 	    if (buffer[strlen(buffer)-1] == '\n')
+ 	    {
+ 		buffer[strlen(buffer)-1]=0;
++		/* and any carriage return */
++		if (buffer[strlen(buffer)-1] == '\r')
++		{
++		    buffer[strlen(buffer)-1]=0;
++		}
+ 	    }
+ 	    if (SAEximDebug > 5)
+ 	    {
+@@ -1078,6 +1083,11 @@ int local_scan(volatile int fd, uschar *
+ 	if (buffer[strlen(buffer)-1] == '\n')
+ 	{
+ 	    buffer[strlen(buffer)-1]=0;
++	    /* and any carriage return */
++	    if (buffer[strlen(buffer)-1] == '\r')
++	    {
++		buffer[strlen(buffer)-1]=0;
++	    }
+ 	}
+ restart:
+ 	if (SAEximDebug > 5)
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 87)
+++ debian/changelog	(arbetskopia)
@@ -1,3 +1,17 @@
+sa-exim (4.2.1-17) unstable; urgency=medium
+
+  * remove-header-crs.patch (new): Strip out carriage returns from header
+    lines returned by spamd when the spool file is in wire format
+    (Probably closes: #879687; it's a bit unclear what the bug is about).
+  * api-limitation.patch: Do expansion of $primary_hostname on every call;
+    for some reason, it were getting overwritten between calls despite
+    using the permanent memory pool in accordance with Exim documentation.
+    Also start using body_linecount again since it's now part of the API,
+    but don't update it when it's zero, indicating that the spool file is
+    in wire format.
+
+ -- Magnus Holmgren <holmg...@debian.org>  Wed, 08 May 2019 23:11:16 +0200
+
 sa-exim (4.2.1-16) unstable; urgency=low
 
   * reproducible-build.patch: Make ACKNOWLEDGEMENTS always UTF-8 encoded

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to