git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-send-email and "mailhost" misbehavior
@ 2010-11-15 20:24 Mike Frysinger
  2010-11-16 19:06 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-11-15 20:24 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git-send-email and "mailhost" misbehavior
  2010-11-15 20:24 git-send-email and "mailhost" misbehavior Mike Frysinger
@ 2010-11-16 19:06 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2010-11-16 19:06 UTC (permalink / raw)
  To: Jari Aalto; +Cc: git, Mike Frysinger

Mike Frysinger <vapier@gentoo.org> writes:

> 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-16 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-15 20:24 git-send-email and "mailhost" misbehavior Mike Frysinger
2010-11-16 19:06 ` Junio C Hamano

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).