From: Shannon Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 3/3] sendmail: break content disposition headers for attachments
Date: Tue, 2 Sep 2025 16:27:17 +0200 [thread overview]
Message-ID: <20250902142720.371671-4-s.sterz@proxmox.com> (raw)
In-Reply-To: <20250902142720.371671-1-s.sterz@proxmox.com>
this should make it easier to accomodate longer filenames, as line
lengths in emails are constraint.
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
proxmox-sendmail/src/lib.rs | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/proxmox-sendmail/src/lib.rs b/proxmox-sendmail/src/lib.rs
index fb201007..1c5daf0f 100644
--- a/proxmox-sendmail/src/lib.rs
+++ b/proxmox-sendmail/src/lib.rs
@@ -115,7 +115,7 @@ impl Attachment<'_> {
// both `filename` and `filename*` are included for additional compatability
let _ = writeln!(
attachment,
- "Content-Disposition: attachment; filename=\"{encoded_filename}\"; filename*=UTF-8''{}",
+ "Content-Disposition: attachment; filename=\"{encoded_filename}\";\n\tfilename*=UTF-8''{}",
utf8_percent_encode(&self.filename, RFC5987SET)
);
@@ -751,7 +751,8 @@ Lorem Ipsum Dolor Sit
Amet
------_=_NextPart_001_1732806251
Content-Type: application/octet-stream; name="deadbeef.bin"
-Content-Disposition: attachment; filename="deadbeef.bin"; filename*=UTF-8''deadbeef.bin
+Content-Disposition: attachment; filename="deadbeef.bin";
+ filename*=UTF-8''deadbeef.bin
Content-Transfer-Encoding: base64
3q2+796tvu/erb7v3q3erb7v3q2+796tvu/erd6tvu/erb7v3q2+796t3q2+796tvu/erb7v
@@ -820,14 +821,16 @@ Content-Transfer-Encoding: 7bit
------_=_NextPart_002_1732806251--
------_=_NextPart_001_1732806251
Content-Type: application/octet-stream; name="deadbeef.bin"
-Content-Disposition: attachment; filename="deadbeef.bin"; filename*=UTF-8''deadbeef.bin
+Content-Disposition: attachment; filename="deadbeef.bin";
+ filename*=UTF-8''deadbeef.bin
Content-Transfer-Encoding: base64
3q2+796tvu/erb7v3q3erb7v3q2+796tvu/erd6tvu/erb7v3q2+796t3q2+796tvu/erb7v
3q2+796tvu8=
------_=_NextPart_001_1732806251
Content-Type: image/bmp; name="=?utf-8?B?8J+QhPCfkoAuYmlu?="
-Content-Disposition: attachment; filename="=?utf-8?B?8J+QhPCfkoAuYmlu?="; filename*=UTF-8''%F0%9F%90%84%F0%9F%92%80.bin
+Content-Disposition: attachment; filename="=?utf-8?B?8J+QhPCfkoAuYmlu?=";
+ filename*=UTF-8''%F0%9F%90%84%F0%9F%92%80.bin
Content-Transfer-Encoding: base64
3q2+796tvu/erb7v3q3erb7v3q2+796tvu/erd6tvu/erb7v3q2+796t3q2+796tvu/erb7v
@@ -936,14 +939,16 @@ SXBzdW0gRMO2bG9yIFNpdCBBbWV0Cgk8L3ByZT4KPC9ib2R5PjwvaHRtbD4=
------_=_NextPart_002_1732806251--
------_=_NextPart_001_1732806251
Content-Type: application/octet-stream; name="deadbeef.bin"
-Content-Disposition: attachment; filename="deadbeef.bin"; filename*=UTF-8''deadbeef.bin
+Content-Disposition: attachment; filename="deadbeef.bin";
+ filename*=UTF-8''deadbeef.bin
Content-Transfer-Encoding: base64
3q2+796tvu/erb7v3q3erb7v3q2+796tvu/erd6tvu/erb7v3q2+796t3q2+796tvu/erb7v
3q2+796tvu8=
------_=_NextPart_001_1732806251
Content-Type: image/bmp; name="=?utf-8?B?8J+QhPCfkoAuYmlu?="
-Content-Disposition: attachment; filename="=?utf-8?B?8J+QhPCfkoAuYmlu?="; filename*=UTF-8''%F0%9F%90%84%F0%9F%92%80.bin
+Content-Disposition: attachment; filename="=?utf-8?B?8J+QhPCfkoAuYmlu?=";
+ filename*=UTF-8''%F0%9F%90%84%F0%9F%92%80.bin
Content-Transfer-Encoding: base64
3q2+796tvu/erb7v3q3erb7v3q2+796tvu/erd6tvu/erb7v3q2+796t3q2+796tvu/erb7v
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
prev parent reply other threads:[~2025-09-02 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 14:27 [pbs-devel] [PATCH proxmox 0/3] improve mail compatability Shannon Sterz
2025-09-02 14:27 ` [pbs-devel] [PATCH proxmox 1/3] sendmail: encode non-ascii filenames to improve compatability Shannon Sterz
2025-09-02 14:27 ` [pbs-devel] [PATCH proxmox 2/3] sendmail: encode non-ascii bodies as base64 to improve comptability Shannon Sterz
2025-09-02 14:27 ` Shannon Sterz [this message]
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=20250902142720.371671-4-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.