linux smtp connect very slow

I am running opensuse 13.2 . I am not sure exactly when the problem started. Any smtp connect takes a unusually long time. When I start Thunderbird there is a long wait before the new mail appears.

Also I have a ruby program that sends mail using  the net/smtp and mail gems. It used to work fine. Now using mail defaults it times out on connect start. The default timeout is 30 seconds. If I set it to 200 seconds I get a connection and can send mail. I have not tried to find the minimum timeout necessary. This happens connecting to comcast and gmail.  gmail is 2 factor but comcast is not.

Any suggestions
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The short duration is only when local, you should set to 60-120.
The connection setup should not take it this long, run traceroute as well as check how much of your bandwidth is being consumed by other things that might explain the issue.

Double check that your outgoing connection is not being proxied.
First of all, you have to check your email server reverse dns entry with nslookup. Or if you are using email hosting, then ask them.

If you are using hosting server for emails, then check the maximum emails send limits per hour. Increase the limit.

When you send the email from code, please check your email on webmail instead of Thunderbird.

Check the thunderbird settings for receiving email set it to 1 minute.
dml12Author Commented:
A traceroute result is shown below:

sudo traceroute
traceroute to (, 30 hops max, 60 byte packets
 1 (  0.537 ms  0.526 ms  0.519 ms
 2  * * *
 3 (  11.411 ms  12.158 ms  12.171 ms
 4 (  29.571 ms  18.430 ms  19.513 ms
 5 (  27.165 ms  26.134 ms  27.146 ms
 6 (  38.548 ms  32.855 ms  22.776 ms
 7 (  23.797 ms  28.176 ms  28.168 ms
 8 (  28.412 ms  28.150 ms  28.395 ms
 9 (  29.127 ms  29.116 ms  29.118 ms
10 (  25.150 ms  22.735 ms  23.128 ms

I have been using this computer to do email for a long time. The default timeout worked fine for smtp email until a few weeks ago. Also when I started thunderbird it connected almost immediately.

I put an elapsed time check in the ruby code which showed about 127 seconds for smtp.start ,


Non-authoritative answer:        canonical name =

I removed the google server and got


Non-authoritative answer:        canonical name =
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Are you using 25, or 587 or 465 to connect?

Why are your default DNS servers those from Google versus the Comcast ones?

Determining the cause what was going on.
Can you check whether the thunderbird account setup matches the one used within your scripts?
dml12Author Commented:
Both 465 & 587 behaved the same. I preferred the google DNS . The problem was the same with the Comcast DNS.

The problem has magically gone away. The connect time from the Ruby program is now between 500 & 600 milliseconds. Thunderbird now shows mail almost immediately after starting. There is no longer a long delay.  So I have no clue what was wrong. I have not done any updates in the last few days.
Should this occur again, one of the checks you should include, is what your public ip, ( then lookup the reverse resolution for the ip
Nslookup <wan ip>

Without errors it is hard/impossible to determine.
One other option is to use a terminal app such as putty and initiate a connection to the 587 port and see whether a delay is seen.

I believe it was mentioned that throttling after a large influx might explain it.
I.e. Over a period of a month there is anumerical threshold that your ip exceeds.
See if the issue occurs in the latter part of the month.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dml12Author Commented:
The comments were reasonable but the problem went away on its own.
dml12Author Commented:
Sigh! The problem is Comcast. I connected to my phone as a wifi hotspot and got a reasonable connect ~6 seconds. Why using comcast improved for a few days is still a mystery.

I also did a new clean linux  install on another computer to show that the computer and installation was not the problem. It has the same slow connect with comcast and short connect time with my phone.

I am not sure how to pursue this wwith comcast.
check reverse resolution of your wan ip.
check with their support. presumably other than 25.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.