git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: git@vger.kernel.org
Subject: git-send-email and "mailhost" misbehavior
Date: Mon, 15 Nov 2010 15:24:02 -0500	[thread overview]
Message-ID: <AANLkTinAjqb7cuCaiu=UvT9m5R=RM5E0hf4zPuKYVmHn@mail.gmail.com> (raw)

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

             reply	other threads:[~2010-11-15 20:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15 20:24 Mike Frysinger [this message]
2010-11-16 19:06 ` git-send-email and "mailhost" misbehavior Junio C Hamano

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='AANLkTinAjqb7cuCaiu=UvT9m5R=RM5E0hf4zPuKYVmHn@mail.gmail.com' \
    --to=vapier@gentoo.org \
    --cc=git@vger.kernel.org \
    /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).