[arch-commits] Commit in amavisd-milter/trunk (PKGBUILD fix-client-name.patch)

Thore Bödecker foxxx0 at archlinux.org
Tue May 15 19:21:17 UTC 2018


    Date: Tuesday, May 15, 2018 @ 19:21:16
  Author: foxxx0
Revision: 322474

upgpkg: amavisd-milter 1.6.1-4

add patch for RDNS_NONE fix

Added:
  amavisd-milter/trunk/fix-client-name.patch
Modified:
  amavisd-milter/trunk/PKGBUILD

-----------------------+
 PKGBUILD              |   12 +++++++++---
 fix-client-name.patch |   42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-05-15 18:45:17 UTC (rev 322473)
+++ PKGBUILD	2018-05-15 19:21:16 UTC (rev 322474)
@@ -1,9 +1,10 @@
 # Maintainer: Thore Bödecker <foxxx0 at archlinux.org>
+# Contributor: Florian Pritz <bluewind at xinu.at>
 # Contributor: Karol Babioch <karol at babioch.de>
 
 pkgname=amavisd-milter
 pkgver=1.6.1
-pkgrel=3
+pkgrel=4
 pkgdesc="sendmail milter for amavisd-new using the AM.PDP protocol"
 arch=('x86_64')
 url="http://amavisd-milter.sourceforge.net/"
@@ -11,12 +12,17 @@
 depends=('amavisd-new')
 makedepends=('libmilter')
 source=("${pkgname}-${pkgver}.tar.gz::https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz/download"
-        'amavisd-milter.service')
+        'amavisd-milter.service'
+        'fix-client-name.patch')
 sha512sums=('28f505a8e130e67decc6c6ff8526f82db24b1b27a11e69f1a112e3e6103f303d333743c2ceaf12bad86979c987cde64f41afb4794c1ca1222cf11a2c3b03c8a5'
-            '0a07da1f1c1299ac26fc8ccd77919e4c5c69ea3e673c1d34f46f730899e2b4234784147fb9929e635a6dc7a40474ca0ba2f03785125ba5b37b1252eb986b4510')
+            '0a07da1f1c1299ac26fc8ccd77919e4c5c69ea3e673c1d34f46f730899e2b4234784147fb9929e635a6dc7a40474ca0ba2f03785125ba5b37b1252eb986b4510'
+            '56b0c8841648de9f8f3efccd110d3c9f9dd82a237816873def32bbf620df4e1451538d8be3e06ff1780025add72a57b252371600303181cf1423aa25255a29e0')
 
 prepare() {
     cd "${srcdir}/${pkgname}-${pkgver}"
+
+    patch -p1 -N -l -i "${srcdir}/fix-client-name.patch"
+
     # change upstream default paths (must match those of amavisd-new)
     sed -i 's|/var/amavis|/var/spool/amavis|g' "${pkgname}/amavisd-milter.8"
 }

Added: fix-client-name.patch
===================================================================
--- fix-client-name.patch	                        (rev 0)
+++ fix-client-name.patch	2018-05-15 19:21:16 UTC (rev 322474)
@@ -0,0 +1,42 @@
+Use {client_name} if available instead of hostname passed to xxfi_connect
+
+Spamassassin's RDNS_NONE check tests if the rdns field in the Received header
+is empty or "unknown". Postfix sets the client_name macro to "unknown" when the
+FcrDNS check fails, but the hostname passed to xxfi_connect is set to the IP
+address which means that RDNS_NONE will never trigger. Fix this by using
+client_name if available and only fall back to the hostname parameter
+otherwise.
+
+diff -ur a/amavisd-milter/mlfi.c b/amavisd-milter/mlfi.c
+--- a/amavisd-milter/mlfi.c	2015-05-24 20:59:19.000000000 +0200
++++ b/amavisd-milter/mlfi.c	2017-12-15 18:08:15.007525175 +0100
+@@ -315,6 +315,7 @@
+     const void *addr;
+     const char *prefix;
+     const char *daemon_name;
++    const char *client_host;
+     int		len, plen;
+ 
+     logmsg(LOG_DEBUG, "%s: CONNECT", hostname);
+@@ -331,8 +332,20 @@
+     (void) memset(mlfi, '\0', sizeof(*mlfi));
+     mlfi->mlfi_amasd = -1;
+ 
++	/* Try to get client_name from macros */
++	if ((client_host = smfi_getsymval(ctx, "{client_name}")) != NULL) {
++	    logqidmsg(mlfi, LOG_INFO, "client_name: %s", client_host);
++	    if ((mlfi->mlfi_client_host = strdup(client_host)) == NULL) {
++		logqidmsg(mlfi, LOG_ERR, "could not allocate memory");
++		mlfi_setreply_tempfail(ctx);
++		return SMFIS_TEMPFAIL;
++	    }
++	} else {
++		logqidmsg(mlfi, LOG_INFO, "{client_name} undefined at connect time! Falling back to libmilter value.");
++	}
++
+     /* Save connection informations */
+-    if (hostname != NULL && *hostname != '\0') {
++    if (hostname != NULL && *hostname != '\0' && mlfi->mlfi_client_host == NULL) {
+ 	if ((mlfi->mlfi_client_host = strdup(hostname)) == NULL) {
+ 	    logmsg(LOG_ERR, "%s: could not allocate memory", hostname);
+ 	    mlfi_setreply_tempfail(ctx);



More information about the arch-commits mailing list