Github messages for mblaze
 help / color / mirror / Atom feed
* [PR PATCH] Ignore fake message IDs set by Protonmail
@ 2023-07-31 18:17 intr-cx
  2024-10-30 11:51 ` [PR PATCH] [Updated] " intr-cx
  0 siblings, 1 reply; 2+ messages in thread
From: intr-cx @ 2023-07-31 18:17 UTC (permalink / raw)
  To: ml

[-- 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-30 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 18:17 [PR PATCH] Ignore fake message IDs set by Protonmail intr-cx
2024-10-30 11:51 ` [PR PATCH] [Updated] " intr-cx

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).