* [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
* Re: [PR PATCH] [Updated] Ignore fake message IDs set by Protonmail
2023-07-31 18:17 [PR PATCH] Ignore fake message IDs set by Protonmail intr-cx
@ 2024-10-30 11:51 ` intr-cx
0 siblings, 0 replies; 2+ messages in thread
From: intr-cx @ 2024-10-30 11:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
There is an updated 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: 4746 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/5] ignore fake Protonmail message ids
---
mthread.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mthread.c b/mthread.c
index d2008790..42f044f4 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/5] fixup
---
mthread.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/mthread.c b/mthread.c
index 42f044f4..16affac1 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;
From 2cbed193bf9db9c814f95553990256ee6b8ce61c Mon Sep 17 00:00:00 2001
From: interloper <15019654+intr-cx@users.noreply.github.com>
Date: Thu, 9 Nov 2023 16:22:12 +0100
Subject: [PATCH 3/5] add url viewer
---
mless | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mless b/mless
index ddead987..cd307676 100755
--- a/mless
+++ b/mless
@@ -89,7 +89,8 @@ while :; do
LESSOPEN="|$0 --filter %s" \
less -Ps"mless %f?m (message %i of %m).." -R \
"+:e $(mscan -n .)$nl" //scan $(mscan -n :)
- case "$?" in
+ _c="$?"
+ case "$_c" in
0|1) exit $?;;
36) # $ goto end
mseq -C '$' 2>/dev/null
@@ -105,6 +106,10 @@ while :; do
mseq -f : | mseq -S
mseq -C +
;;
+ 117) # u extract URLs
+ _url="$(mshow -N -h ''| extract_url -l -c "$XDG_CONFIG_HOME"/urlview/config 2>&- | fzf)"
+ [ "$_url" != "" ] && handle-url "$_url"
+ ;;
82) # R toggle raw mode
MLESS_RAW=$((1-$MLESS_RAW))
;;
From 6ad2128ca5bdaa10b25962cfd9647cc6babd76e2 Mon Sep 17 00:00:00 2001
From: Silvan Jegen <s.jegen@gmail.com>
Date: Sat, 18 May 2024 11:30:24 +0200
Subject: [PATCH 4/5] Fix calloc argument order
These were found through gcc warnings.
---
mflag.c | 2 +-
msort.c | 2 +-
mthread.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mflag.c b/mflag.c
index ddf633cd..9ee87471 100644
--- a/mflag.c
+++ b/mflag.c
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
return 0;
}
- args = calloc(sizeof (char *), argsalloc);
+ args = calloc(argsalloc, sizeof (char *));
if (!args)
exit(-1);
diff --git a/msort.c b/msort.c
index 5d2d88d4..02d1e42c 100644
--- a/msort.c
+++ b/msort.c
@@ -319,7 +319,7 @@ main(int argc, char *argv[])
xpledge("stdio rpath", "");
- mails = calloc(sizeof (struct mail), mailalloc);
+ mails = calloc(mailalloc, sizeof (struct mail));
if (!mails)
exit(-1);
diff --git a/mthread.c b/mthread.c
index 16affac1..b0a741a1 100644
--- a/mthread.c
+++ b/mthread.c
@@ -372,7 +372,7 @@ sort_tree(struct container *c, int depth)
if (i == 1) // no sort needed
return;
- struct container **a = calloc(sizeof (struct container *), i);
+ struct container **a = calloc(i, sizeof (struct container *));
if (!a)
return;
From bda938824d2a001e34ac0c2c1f8169833284d4e0 Mon Sep 17 00:00:00 2001
From: interloper <15019654+intr-cx@users.noreply.github.com>
Date: Wed, 30 Oct 2024 12:50:06 +0100
Subject: [PATCH 5/5] Redo logic & add protonmail.conversationid
---
mthread.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mthread.c b/mthread.c
index b0a741a1..5ee9245d 100644
--- a/mthread.c
+++ b/mthread.c
@@ -165,9 +165,11 @@ thread(char *file)
continue;
// ugly, skip fake Protonmail mids
- if (strlen(mid) >= 22) {
+ char *at = strchr(mid, '@');
+ if (at != NULL) {
const char *pi = "@protonmail.internalid";
- if (strcmp(mid + strlen(mid) - 22, pi))
+ const char *pc = "@protonmail.conversationid";
+ if (strcmp(at, pi) == 0 || strcmp(at, pc) == 0)
continue;
}
^ 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).