[PATCH] Don't print an empty Cc header in SMTP mode when there's no cc recipient defined

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

 



Signed-off-by: Ask Bjørn Hansen <ask@xxxxxxxxxxxxxx>
---

There's some duplicate code between "what we do for sendmail"
and "what we do for SMTP" paths that should be fixed - this doesn't
do that, it only makes the SMTP path skip empty Cc lines...

 git-send-email.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index fd0a4ad..65620ab 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -651,7 +651,11 @@ X-Mailer: git-send-email $gitversion
 		} else {
 			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
 		}
-		print "From: $sanitized_sender\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
+		print "From: $sanitized_sender\n"
+		     . "Subject: $subject\n"
+		     . ($cc ? "Cc: $cc\n" : "")
+		     . "To: $to\n"
+		     . "\n";
 		if ($smtp) {
 			print "Result: ", $smtp->code, ' ',
 				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
-- 
1.5.3.5.561.g140d

-
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