git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Joe Perches <joe@perches.com>
Cc: git@vger.kernel.org, Jay Soffian <jaysoffian@gmail.com>
Subject: Re: [PATCH] git-send-email.perl: Fold long header lines to 78 chars
Date: Wed, 07 Oct 2009 22:02:28 -0700	[thread overview]
Message-ID: <7vd44yo4uz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1254759898.1799.449.camel@Joe-Laptop.home> (Joe Perches's message of "Mon\, 05 Oct 2009 09\:24\:58 -0700")

Joe Perches <joe@perches.com> 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@perches.com>
>
> 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";
>  		}

  reply	other threads:[~2009-10-08  5:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 16:24 [PATCH] git-send-email.perl: Fold long header lines to 78 chars Joe Perches
2009-10-08  5:02 ` Junio C Hamano [this message]
2009-10-08  5:28   ` Joe Perches
2009-10-08 16:27     ` Junio C Hamano
2009-10-08 17:03       ` [PATCH v2] git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"s Joe Perches
2009-10-09  6:50         ` Junio C Hamano
2009-10-10  0:57         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd44yo4uz.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=joe@perches.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).