all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api 1/1] rulesystem: limit linelength of disclaimer to 998 bytes
@ 2021-11-22 19:50 Stoiko Ivanov
  2021-11-23  6:16 ` Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2021-11-22 19:50 UTC (permalink / raw)
  To: pmg-devel

As described in
http://www.postfix.org/postconf.5.html#smtp_line_length_limit

postfix splits lines which are longer by inserting <cr><lf><space> to
adhere with RFC 5322 (section 2.1.1):
https://datatracker.ietf.org/doc/html/rfc5322#section-2.1.1

If a longer line is part of the disclaimer pmg-smtp-filter adds it
without this modification, which breaks DKIM signatures (since the
body is modified by postfix after the body hash is computed)

reported in our community forum:
https://forum.proxmox.com/threads/dkim-body-has-been-altered-when-enabling-disclaimer-function.97919/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/RuleDB/Disclaimer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PMG/RuleDB/Disclaimer.pm b/src/PMG/RuleDB/Disclaimer.pm
index 1b1accf..1c81b03 100644
--- a/src/PMG/RuleDB/Disclaimer.pm
+++ b/src/PMG/RuleDB/Disclaimer.pm
@@ -84,6 +84,10 @@ sub save {
     defined($self->{ogroup}) || die "undefined object attribute: ERROR";
     defined($self->{value}) || die "undefined object attribute: ERROR";
 
+    if ($self->{value} =~ /^.{998,}$/m) {
+	die "too long line in disclaimer - breaks RFC 5322!\n";
+    }
+
     if (defined ($self->{id})) {
 	# update
 	
-- 
2.30.2





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

end of thread, other threads:[~2021-11-23  6:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 19:50 [pmg-devel] [PATCH pmg-api 1/1] rulesystem: limit linelength of disclaimer to 998 bytes Stoiko Ivanov
2021-11-23  6:16 ` Thomas Lamprecht

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal