git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Erik Faye-Lund <kusmabite@googlemail.com>,
	Frans Pop <elendil@planet.nl>,
	git@vger.kernel.org
Subject: Re: git-send-email generates mail with invalid Message-Id
Date: Tue, 28 Jul 2009 12:44:23 +0200	[thread overview]
Message-ID: <20090728104423.GA12947@vidovic> (raw)
In-Reply-To: <40aa078e0907280217g76cbfai8544edde605f8772@mail.gmail.com>

Erik Faye-Lund wrote:
> 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

  parent reply	other threads:[~2009-07-28 10:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28  2:46 git-send-email generates mail with invalid Message-Id Frans Pop
2009-07-28  9:17 ` Erik Faye-Lund
2009-07-28  9:27   ` Thomas Rast
2009-07-28  9:51     ` Erik Faye-Lund
2009-07-28 10:03       ` Thomas Rast
2009-07-28 10:44     ` Nicolas Sebrecht [this message]
2009-07-28 11:13       ` Frans Pop
2009-07-28 11:38         ` Nicolas Sebrecht
2009-07-28 11:47           ` Erik Faye-Lund
2009-07-28 12:10             ` Erik Faye-Lund
2009-07-28 15:07               ` Nicolas Sebrecht
2009-07-28 10:14   ` Frans Pop
2009-07-28 10:26     ` Frans Pop

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=20090728104423.GA12947@vidovic \
    --to=nicolas.s.dev@gmx.fr \
    --cc=elendil@planet.nl \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@googlemail.com \
    --cc=trast@student.ethz.ch \
    /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).