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

Re: [MacPerl] Net::SMTP timeout



At 10:10 +0200 2000.09.28, martijn wrote:
>some redirect code as a reply to the client. The first time I tried the
>script, it worked very well (very slow, but AFAIK Mac is slow at looking up
>domain-names and such, maybe this slows the script down, I dunno ...). Yet

Yes, name lookup can be slow, but this is not a Mac problem.  It could be a
problem in Net::Domain.  If your Mac does not have its own hostname, then
it can take a very long time.  You can hardcode a value to get rid of the
lookup, though.


>$smtp = Net::SMTP->new('xxx');

  my $smtp = Net::SMTP->new('smtp.example.com', Hello =>
'my.host.example.com');


You could even do:

  chomp(my $host = `hostname`);
  my $smtp = Net::SMTP->new('smtp.example.com', Hello => $host);

That will get your IP address or, if available, your actual hostname, and
will avoid the lookup in any event.

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org