[PATCH] git-send-email.perl: check for lines longer than 998 characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux