[PATCH] git-send-email.perl: check for lines longer than 998 characters
- From
- Adam Piątyszek <ediap@users.sourceforge.net>
- Date
- Jan 18, 2008, 07:47 UTC
- Message-ID
- <1200642458-3280-1-git-send-email-ediap@users.sourceforge.net>
- In-Reply-To
- <20080117153252.GD2816@coredump.intra.peff.net>
According to RFC2822 (Internet Message Format), each line of a message must be no more than 998 characters. This patch adds a check for the length of each body line of a message and dies if the length exceeds the limit.
Signed-off-by: Adam Piątyszek <ediap@users.sourceforge.net> --- git-send-email.perl | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl index e47994a..6d623ea 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -748,6 +748,9 @@ foreach my $t (@files) { $header_done = 1; } } else { + if (length($_) > 998) { + die "(msg) This message contains lines longer than 998 characters,\nwhich can not be correctly send as plain text using SMTP.\n"; + } $message .= $_; if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) { my $c = $2;
-- 1.5.4.rc3.4.g1633