From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id EE8F91FF0EC for ; Sat, 07 Nov 2026 21:44:28 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 780E92131F; Sat, 07 Nov 2026 21:44:28 +0100 (CET) From: Thomas Lamprecht To: pbs-devel@lists.proxmox.com, Shannon Sterz Subject: applied: [PATCH proxmox v3] fix #7814: send-mail: normalize LF line endings to CRLF endings Date: Sat, 7 Nov 2026 21:44:09 +0100 Message-ID: <179408380156.2556107.14174123446457945969.b4-ty@b4> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261020143437.333073-1-s.sterz@proxmox.com> References: <20261020143437.333073-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794084262986 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.279 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: HA36MD43DJWD2ZH55SQFSCQ25BIA2MPW X-Message-ID-Hash: HA36MD43DJWD2ZH55SQFSCQ25BIA2MPW X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 20 Oct 2026 16:34:35 +0200, Shannon Sterz wrote: > RFC5321 Section 2.3.8 requires that mails do not contain bare CR or LF > bytes. this patch normalizes unix style LF line endings to CRLF line > endings. it also removes bare CR bytes. > > when text would be base64 encoded, CR bytes will be dropped, to keep > the behavior for encoded and non-encoded text aligned. to comply with > rfc 2045 section 6.8 and rfc 2047 section 4.1 line endings are also > normalized before encoding them in headers and body text [1,2]. > > [...] Applied, thanks! [1/1] fix #7814: send-mail: normalize LF line endings to CRLF endings commit: 21bb4956bdbc6ebd4d2bd0ec020f4ff5835d28fc FYI, I folded in a few changes and reworded the commit message: - Moved both line ending loops to a shared helper normalize_line_endings(). - Filenames use char::is_control() to strip C1 control chars too. - Custom headers get CR stripped together with LF again, so the injection guard does not rely on later normalization. - I dropped the RFC 2047 reference, as that section does not require normalized line endings. Note that #7814 itself is acutally about SMTP targets, which do not use sendmail. There, lettre sends the forwarded message as is and dot-stuffs only lines that follow a CRLF. So bare LFs reached the relay, and a line with just a dot was not escaped. I added a follow-up that normalizes the message with the new helper, which keeps its MIME encodings intact. See 7668648f ("fix #7814: notify: smtp: normalize forwarded mail line endings")