Github messages for mblaze
 help / color / mirror / Atom feed
From: intr-cx <intr-cx@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Ignore fake message IDs set by Protonmail
Date: Mon, 31 Jul 2023 20:17:48 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-246@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

There is a new pull request by intr-cx against master on the mblaze repository

https://github.com/intr-cx/mblaze master
https://github.com/leahneukirchen/mblaze/pull/246

Ignore fake message IDs set by Protonmail
Proton-bridge injects fake message IDs suffixed by `protonmail.internalid` into References headers. This causes mthread to mess up and introduce a bunch of noise from supposedly missing emails. 

I know this isn't the cleanest solution and it is a bit of a niche problem, but I dug around a bit and [mu](https://github.com/djcb/mu/blob/5409c2cd8760fa9909feffd51159fecaee8fb04e/lib/message/mu-mime-object.cc#L432) for example works around it in a similar fashion.

A patch file from https://github.com/leahneukirchen/mblaze/pull/246.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-246.patch --]
[-- Type: text/x-diff, Size: 1702 bytes --]

From b48458da700a172d105f043e6f552566691d20e1 Mon Sep 17 00:00:00 2001
From: intr <15019654+intr-cx@users.noreply.github.com>
Date: Mon, 31 Jul 2023 10:42:44 +0200
Subject: [PATCH 1/2] ignore fake Protonmail message ids

---
 mthread.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mthread.c b/mthread.c
index d200879..42f044f 100644
--- a/mthread.c
+++ b/mthread.c
@@ -159,6 +159,12 @@ thread(char *file)
 			mid = strndup(m+1, v-m-1);
 			// XXX free?
 
+			//protonmail.internalid
+			if (mid && strlen(mid) >= 22) {
+				const char *pi = "@protonmail.internalid";
+				if (strcmp(mid + strlen(mid) - 22, pi))
+					continue;
+			}
 			me = midcont(mid);
 
 			if (me == c)

From 659ca8bf9fc84b21e5734be3e9e514a9f57faf5f Mon Sep 17 00:00:00 2001
From: interloper <15019654+intr-cx@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:31:36 +0200
Subject: [PATCH 2/2] fixup

---
 mthread.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/mthread.c b/mthread.c
index 42f044f..16affac 100644
--- a/mthread.c
+++ b/mthread.c
@@ -159,17 +159,18 @@ thread(char *file)
 			mid = strndup(m+1, v-m-1);
 			// XXX free?
 
-			//protonmail.internalid
-			if (mid && strlen(mid) >= 22) {
-				const char *pi = "@protonmail.internalid";
-				if (strcmp(mid + strlen(mid) - 22, pi))
-					continue;
-			}
 			me = midcont(mid);
 
 			if (me == c)
 				continue;
 
+			// ugly, skip fake Protonmail mids
+			if (strlen(mid) >= 22) {
+				const char *pi = "@protonmail.internalid";
+				if (strcmp(mid + strlen(mid) - 22, pi))
+					continue;
+			}
+
 			if (parent && !me->parent &&
 			    !reachable(me, parent) && !reachable(parent, me)) {
 				me->parent = parent;

                 reply	other threads:[~2023-07-31 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-246@inbox.vuxu.org \
    --to=intr-cx@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).