1

I use a mock SMTP server (MockSmtp or fakeSMTP) on my Mac for debugging and testing mail delivery during development. These mock SMTP servers simply display the mails which are to be sent instead of delivering them.

Since upgrading to Yosemite, though, sending mails to this local SMTP server via JavaMail (tested on Glassfish V3 and JBoss AS 7) is painfully slow. A single mail takes about 20s to send. Sending a mail via netcat does not have any delay so the problem should not be caused by the SMTP server. I had no such problems with Mavericks. Mails sent on the production systems (Debian stable) are delivered quickly, too.

I am currently running JAVA JDK v1.7.0_71, the JavaMail implementation and the mail session is provided by JBoss AS 7.4 and mails are sent using Seam Mail (Seam v2.3, latest nightly build). Using seams own JavaMail implementation and mail session does not change anything. Disabling the firewall (Little Snitch) also does not help.

What has changed from Mavericks to Yosemite which could cause these issues?

Roben
  • 840
  • 9
  • 19
  • Are you sending to "localhost" or to the host name of the machine? Maybe host name resolution is slowing it down? Are you using SSL? If so, perhaps certification management is slowing it down? Assuming the only thing that changed is the OS, and not the JDK nor the app server nor the applications, you need to look for things like this. – Bill Shannon Jan 28 '15 at 21:32
  • I am sending to "localhost". Changing this to 127.0.0.1 did not help either so name resolving should be ruled out, then. Thanks for the input, anyways! – Roben Jan 29 '15 at 10:16
  • I thought I finally solved it. I was able to nail the issue down to InetAddress.getLocalHost(), which took some seconds to complete. After trying several approaches without luck and nearly giving up, I changed the `127.0.0.1` line in my /etc/hosts file from `127.0.0.1 MacBook-Pro.local MacBook-Pro localhost` to `127.0.0.1 localhost MacBook-Pro.local MacBook-Pro`. After that, mail delivery was as fast as it should. Some time later I had to reboot my machine due to system updates. Now the issue is back although `/etc/hosts` remained the way I changed it :/ – Roben Mar 19 '15 at 14:31
  • 1
    And now it is fast again after changing my host name `sudo scutil --set HostName macbook-roben`. What a strange thing. – Roben Mar 19 '15 at 14:38
  • 1
    Thank you for mentioning InetAddress.getLocalHost(). This was guided me [here](https://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds/33289897) for final solution. – aousov Apr 11 '19 at 08:13

1 Answers1

1

Doing sudo scutil --set HostName macbook-my-name worked for me too! email send went from 9 seconds to .09s. Thank you Roben!

Edward
  • 51
  • 2