From: Nicolas Sebrecht Date: Tue, 28 Jul 2009 10:44:23 GMT Subject: Re: git-send-email generates mail with invalid Message-Id Message-ID: <20090728104423.GA12947@vidovic> In-Reply-To: <40aa078e0907280217g76cbfai8544edde605f8772@mail.gmail.com> Erik Faye-Lund wrote: > On Tue, Jul 28, 2009 at 4:46 AM, Frans Pop wrote: > > > I assume that this is a configuration issue in the git setup of the > > sender, but shouldn't git-send-email refuse to send out messages with an > > invalid Message-Id? Stricly speacking, it is not an invalid Message-Id. RFC 2822 says that the Message-Id has to be unique. The right hand side may not contain a domain identifier. It is a RECOMMENDED practice (a good one, though). IMHO, inn2 does a wrong assumption. > Not quite. git-send-email generates these message-ids itself (those > who contain "-git-send-email-", that is), and should as such be able > to rely on them being generated correctly. [...] > I'm no perl-expert, but the code looks pretty much correct to me. Looks good here too. That said, if $du_part is still empty after all the stuff over, we could add a fake domain name. This prevent the Message-Id from ending with "-git-send-email->". --- This is untested. 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 d508f83..82fb3b9 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -748,6 +748,9 @@ sub make_message_id use Sys::Hostname qw(); $du_part = 'user@' . Sys::Hostname::hostname(); } + if (not defined $du_part or $du_part eq '') { + $du_part = 'git@fake.dom'; + } my $message_id_template = "<%s-git-send-email-%s>"; $message_id = sprintf($message_id_template, $uniq, $du_part); #print "new message id = $message_id\n"; # Was useful for debugging -- Nicolas Sebrecht