From: ashiire <ashiire@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] improve named part/attachment detection
Date: Wed, 16 Aug 2023 13:09:51 +0200 [thread overview]
Message-ID: <20230816110951.zMp_o0bMbXENaAWltc9Ym1H-Yao9ajUbMZDVyI2qIYI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-232@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
There is an updated pull request by ashiire against master on the mblaze repository
https://github.com/ashiire/mblaze ashiire-patch-1
https://github.com/leahneukirchen/mblaze/pull/232
improve named part/attachment detection
This will add filename detection for parts which specify Content-Disposition _without_ a filename parameter and Content-Type _with_ a name parameter. I'm not sure whether omitting this possibility was intentional, e.g. to adhere to standard, but messages which name their attachments in this way occur in the wild.
A patch file from https://github.com/leahneukirchen/mblaze/pull/232.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ashiire-patch-1-232.patch --]
[-- Type: text/x-diff, Size: 1907 bytes --]
From da49ac5b1e1e11878c3fdf9c58c1d24a0354f158 Mon Sep 17 00:00:00 2001
From: ashiire <31418397+ashiire@users.noreply.github.com>
Date: Wed, 11 Jan 2023 12:20:51 +0100
Subject: [PATCH 1/2] improve named part/attachment detection
will now detect filenames for parts if the part specifies Content-Disposition without a filename parameter and Content-Type with a name parameter
---
mshow.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mshow.c b/mshow.c
index 1cd2cbc..b4463e9 100644
--- a/mshow.c
+++ b/mshow.c
@@ -158,11 +158,11 @@ mime_filename(struct message *msg)
static char buf[512];
char *v;
char *filename = 0;
-
- if ((v = blaze822_hdr(msg, "content-disposition"))) {
- if (blaze822_mime2231_parameter(v, "filename",
- buf, sizeof buf, "UTF-8"))
- filename = buf;
+
+ if ((v = blaze822_hdr(msg, "content-disposition")) &&
+ blaze822_mime2231_parameter(v, "filename",
+ buf, sizeof buf, "UTF-8")) {
+ filename = buf;
} else if ((v = blaze822_hdr(msg, "content-type"))) {
if (blaze822_mime2231_parameter(v, "name",
buf, sizeof buf, "UTF-8"))
From 52dbd42252147a1b2c9d6e58d04be2ea0c6aea1a Mon Sep 17 00:00:00 2001
From: ashiire <31418397+ashiire@users.noreply.github.com>
Date: Wed, 11 Jan 2023 12:20:51 +0100
Subject: [PATCH 2/2] improve named part/attachment detection
will now detect filenames for parts if the part specifies Content-Disposition without a filename parameter and Content-Type with a name parameter
---
mshow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mshow.c b/mshow.c
index b4463e9..d0871f2 100644
--- a/mshow.c
+++ b/mshow.c
@@ -158,7 +158,7 @@ mime_filename(struct message *msg)
static char buf[512];
char *v;
char *filename = 0;
-
+
if ((v = blaze822_hdr(msg, "content-disposition")) &&
blaze822_mime2231_parameter(v, "filename",
buf, sizeof buf, "UTF-8")) {
next prev parent reply other threads:[~2023-08-16 11:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-232@inbox.vuxu.org>
2023-02-12 10:38 ` ashiire
2023-08-11 11:37 ` ashiire
2023-08-11 13:31 ` leahneukirchen
2023-08-16 11:09 ` ashiire [this message]
2023-08-16 14:46 ` [PR PATCH] [Updated] " ashiire
2024-09-11 19:36 ` [PR PATCH] [Merged]: " leahneukirchen
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=20230816110951.zMp_o0bMbXENaAWltc9Ym1H-Yao9ajUbMZDVyI2qIYI@z \
--to=ashiire@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).