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

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

 



Erik Faye-Lund wrote:
> On Tue, Jul 28, 2009 at 4:46 AM, Frans Pop<elendil@xxxxxxxxx> 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@xxxxxxxx';
+       }
        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
--
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]