git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-send-email generates mail with invalid Message-Id

From
NSNicolas Sebrecht <nicolas.s.dev@gmx.fr>
Date
Jul 28, 2009, 10:44 UTC
Message-ID
<20090728104423.GA12947@vidovic>
In-Reply-To
<40aa078e0907280217g76cbfai8544edde605f8772@mail.gmail.com>
Erik Faye-Lund wrote:
Show 5 quoted lines
> On Tue, Jul 28, 2009 at 4:46 AM, Frans Pop<elendil@planet.nl> 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
Previous: Frans PopNext: Frans Pop
Message 8 of 13 in “git-send-email generates mail with invalid Message-Id”
  1. Frans PopJul 28, 2009
  2. Erik Faye-LundJul 28, 2009
  3. Thomas RastJul 28, 2009
  4. Erik Faye-LundJul 28, 2009
  5. Thomas RastJul 28, 2009
  6. Frans PopJul 28, 2009
  7. Frans PopJul 28, 2009
  8. Nicolas SebrechtJul 28, 2009
  9. Frans PopJul 28, 2009
  10. Nicolas SebrechtJul 28, 2009
  11. Erik Faye-LundJul 28, 2009
  12. Erik Faye-LundJul 28, 2009
  13. Nicolas SebrechtJul 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.