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

Re: git-send-email and "mailhost" misbehavior

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2010, 19:06 UTC
Message-ID
<7vy68tgkb7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTinAjqb7cuCaiu=UvT9m5R=RM5E0hf4zPuKYVmHn@mail.gmail.com>
Mike Frysinger <vapier@gentoo.org> writes:
Show 42 quoted lines
> i have sendemail in my ~/.gitconfig setup like so:
> [sendemail]
>     smtpserver = localhost:1111
>
> and i have a ssh tunnel running there to forward my e-mail to another
> machine's localhost:25
>
> however, when i attempt to send e-mail from some systems, the `git
> send-email` process pauses for like 2 minutes without doing anything.
> after hassling my e-mail admin about greylisting (which is disabled
> for localhost), i looked at git-send-email a bit closer.
>
> running it through a heavy strace shows the source of the pause:
> connect(6, {sa_family=AF_INET, sin_port=htons(25),
> sin_addr=inet_addr("208.68.139.38")}, 16)
> then there's a timeout after 120 seconds trying to connect to this guy
>
> so wtf is "208.68.139.38" !?  well, my shitty ISP (comcast) is doing
> DNS hijacking for unresolved DNS names.  so git-send-email tried to
> look up some host and it got back "208.68.139.38".  while comcast is
> wrong here, why is git-send-email looking up anything at all
> considering my sendemail.smtpserver is configured to localhost ?
>
> it seems that buried in the bowels of git-send-email and totally
> undocumented is this nugget:
> /usr/libexec/git-core/git-send-email:
> ...
> sub maildomain_mta {
>     my $maildomain;
>
>     if (eval { require Net::SMTP; 1 }) {
>         for my $host (qw(mailhost localhost)) {
>             my $smtp = Net::SMTP->new($host);
> ...
>
> so git-send-email is so kind as to attempt port 25 connections to
> "mailhost:25" and "localhost:25" while attempting to locate its FQDN
> !?  this doesnt sound right at all.  DNS lookups do not require actual
> TCP/IP connection attempts.
>
> stubbing out "mailhost" to 127.0.0.1 in /etc/hosts fixes my troubles.
> -mike

Redirecting to Jari Aalto for 134550f (git-send-email.perl - try to give real name of the calling host to HELO/EHLO, 2010-03-14)

Previous: Mike Frysinger
Message 2 of 2 in “git-send-email and "mailhost" misbehavior”
  1. Mike FrysingerNov 15, 2010
  2. Junio C HamanoNov 16, 2010

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.