From owner-dev-commits-ports-main@freebsd.org Tue Aug 3 16:45:05 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4C3163C305; Tue, 3 Aug 2021 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfLMP5Vqwz3HKm; Tue, 3 Aug 2021 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A607816D19; Tue, 3 Aug 2021 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173Gj5eC037349; Tue, 3 Aug 2021 16:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173Gj5eG037348; Tue, 3 Aug 2021 16:45:05 GMT (envelope-from git) Date: Tue, 3 Aug 2021 16:45:05 GMT Message-Id: <202108031645.173Gj5eG037348@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 191922dd0978 - main - mail/mlmmj: Improve support for X-Original-From MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 191922dd097895100db92e0d103a03bdb19960f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 16:45:05 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/ports/commit/?id=191922dd097895100db92e0d103a03bdb19960f4 commit 191922dd097895100db92e0d103a03bdb19960f4 Author: Baptiste Daroussin AuthorDate: 2021-08-03 08:04:00 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 16:45:01 +0000 mail/mlmmj: Improve support for X-Original-From In FreeBSD setup when emails are incoming from a domain with strong dmarc validation policy (like yahoo) mail a munged upfront by rspamd and X-Original-From is set to the original email. The initial support for X-Original-From allowed everything to work but list control, this update makes listcontrol (+help, +subscribe etc works for those domains) --- mail/mlmmj/Makefile | 2 +- mail/mlmmj/files/patch-originalfromemail | 47 ++++++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/mail/mlmmj/Makefile b/mail/mlmmj/Makefile index 292636766d0d..1797d99b8a2f 100644 --- a/mail/mlmmj/Makefile +++ b/mail/mlmmj/Makefile @@ -2,7 +2,7 @@ PORTNAME= mlmmj PORTVERSION= 1.3.0 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= mail MASTER_SITES= http://mlmmj.org/releases/ diff --git a/mail/mlmmj/files/patch-originalfromemail b/mail/mlmmj/files/patch-originalfromemail index 4ee0b485e3a2..c6bc45d2f129 100644 --- a/mail/mlmmj/files/patch-originalfromemail +++ b/mail/mlmmj/files/patch-originalfromemail @@ -1,8 +1,21 @@ +diff --git src/listcontrol.c src/listcontrol.c +index d0c2e14..96e98d9 100644 +--- src/listcontrol.c ++++ src/listcontrol.c +@@ -191,7 +191,7 @@ int listcontrol(struct email_container *fromemails, const char *listdir, + if(fromemails->emailcount != 1 && ctrl != CTRL_BOUNCES) { + errno = 0; + log_error(LOG_ARGS, "Ignoring mail with invalid From: " +- "which was not a bounce"); ++ "which was not a bounce: %d", fromemails->emailcount); + return -1; + } + diff --git src/mlmmj-process.c src/mlmmj-process.c -index 82e4d04..fee5603 100644 +index 82e4d04..a9003e7 100644 --- src/mlmmj-process.c +++ src/mlmmj-process.c -@@ -473,6 +473,7 @@ int main(int argc, char **argv) +@@ -473,10 +473,12 @@ int main(int argc, char **argv) struct stat st; uid_t uid; struct email_container fromemails = { 0, NULL }; @@ -10,7 +23,12 @@ index 82e4d04..fee5603 100644 struct email_container toemails = { 0, NULL }; struct email_container ccemails = { 0, NULL }; struct email_container rpemails = { 0, NULL }; -@@ -488,6 +489,7 @@ int main(int argc, char **argv) + struct email_container dtemails = { 0, NULL }; ++ struct email_container *testfrom = NULL; + struct strlist *access_rules = NULL; + struct strlist *delheaders = NULL; + struct strlist allheaders; +@@ -488,6 +490,7 @@ int main(int argc, char **argv) { "Return-Path:", 0, NULL }, { "Delivered-To:", 0, NULL }, { "Subject:", 0, NULL }, @@ -18,7 +36,7 @@ index 82e4d04..fee5603 100644 { NULL, 0, NULL } }; -@@ -708,6 +710,11 @@ int main(int argc, char **argv) +@@ -708,6 +711,11 @@ int main(int argc, char **argv) for(i = 0; i < readhdrs[0].valuecount; i++) { find_email_adr(readhdrs[0].values[i], &fromemails); } @@ -30,7 +48,20 @@ index 82e4d04..fee5603 100644 /* discard malformed mail with invalid From: unless it's a bounce */ if(fromemails.emailcount != 1 && (recipextra == NULL || -@@ -1036,7 +1043,10 @@ int main(int argc, char **argv) +@@ -812,7 +820,11 @@ int main(int argc, char **argv) + log_error(LOG_ARGS, "listcontrol(from, %s, %s, %s, %s, %s, %s, %s)\n", listdir, toemails.emaillist[0], mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce, donemailname); + #endif + unlink(mailfile); +- listcontrol(&fromemails, listdir, recipextra, ++ if (originalfromemails.emailcount > 0) ++ testfrom = &originalfromemails; ++ else ++ testfrom = &fromemails; ++ listcontrol(testfrom, listdir, recipextra, + mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce, + donemailname); + +@@ -1036,7 +1048,10 @@ int main(int argc, char **argv) if(!send && (subonlypost || modonlypost || modnonsubposts)) { /* Don't send a mail about denial to the list, but silently * discard and exit. */ @@ -42,7 +73,7 @@ index 82e4d04..fee5603 100644 log_error(LOG_ARGS, "Discarding %s because" " there are sender restrictions but" " From: was the list address", -@@ -1047,10 +1057,10 @@ int main(int argc, char **argv) +@@ -1047,10 +1062,10 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } if(subonlypost) { @@ -55,7 +86,7 @@ index 82e4d04..fee5603 100644 } if(!foundaddr) { if(modnonsubposts) { -@@ -1086,10 +1096,10 @@ int main(int argc, char **argv) +@@ -1086,10 +1101,10 @@ int main(int argc, char **argv) } MY_ASSERT(txt); register_unformatted(txt, "subject", subject); @@ -68,7 +99,7 @@ index 82e4d04..fee5603 100644 MY_ASSERT(queuefilename) close_text(txt); myfree(listaddr); -@@ -1101,7 +1111,7 @@ int main(int argc, char **argv) +@@ -1101,7 +1116,7 @@ int main(int argc, char **argv) execlp(mlmmjsend, mlmmjsend, "-L", listdir, "-l", "1",