Re: [PATCH] git-send-email.perl: Fold long header lines to 78 chars

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

 



Joe Perches <joe@xxxxxxxxxxx> writes:

> Some MTAs reject or filter long header lines which can
> be generated if the cc list is only a few entries.
>
> Fold long header lines to 78 chars to be more rfc compliant.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index dd821f7..cb8b48b 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -835,10 +870,10 @@ sub send_message
>  	    $gitversion = Git::version();
>  	}
>  
> -	my $cc = join(", ", unique_email_list(@cc));
> +	@cc = unique_email_list(@cc);
>  	my $ccline = "";
> -	if ($cc ne '') {
> -		$ccline = "\nCc: $cc";
> +	if (@cc gt 0) {

"gt"?  I think you meant (@cc > 0) but you can also say "if (@cc) {" which
would most clearly convey what you want to say..

> +		$ccline = fold_header("\nCc: ", ", ", @cc);
>  	}
>  	my $sanitized_sender = sanitize_address($sender);
>  	make_message_id() unless defined($message_id);
> @@ -976,7 +1011,7 @@ X-Mailer: git-send-email $gitversion
>  		if ($smtp_server !~ m#^/#) {
>  			print "Server: $smtp_server\n";
>  			print "MAIL FROM:<$raw_from>\n";
> -			print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
> +			print fold_header("RCPT TO:", ",", map { "<$_>" } @recipients)."\n";
I do not think this hunk is correct.

Shouldn't we be rather repeating "RCPT TO: " for each recipient, as
RFC2821 4.1.1.3 says (this is an issue with the original code)?  I do not
think SMTP's "RCPT TO" command has the notion of continuation line used
for the payload (i.e. RFC 2822 Internet Message Format), and folding the
line is a new bug this patch introduces.

>  		} else {
>  			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
>  		}
--
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]