0

I have a web app deployed on CentOS7 server.

My web app sends mail via (SMTP) and reads mail via(POP3/IMAP)from YAHOO server. All my configuration are correct and am making request via SSL.

I am facing some unusual behavior on server, sometimes it gets connected sometimes it does not .Most of the time this issue is fixed when i redeploy my app.

[Note : Firewall is turned off on server ]

My app is build on Spring Boot.

Please Help me in resolving this.

utsav anand
  • 385
  • 1
  • 4
  • 16

1 Answers1

0

You may have to manually implement round robin DNS. There are many servers in the IMAP and POP3 pools, and if one doesn't work, you should try the next:

For my location, I get 8 servers in the IMAP pool, with distinct IPs.

> nslookup imap.mail.yahoo.com
Non-authoritative answer:
imap.mail.yahoo.com     canonical name = imap.mail.gm0.yahoodns.net.
Name:   imap.mail.gm0.yahoodns.net
Address: 67.195.125.200
Name:   imap.mail.gm0.yahoodns.net
Address: 67.195.125.129
Name:   imap.mail.gm0.yahoodns.net
Address: 66.218.75.98
Name:   imap.mail.gm0.yahoodns.net
Address: 67.195.236.147
Name:   imap.mail.gm0.yahoodns.net
Address: 66.218.74.148
Name:   imap.mail.gm0.yahoodns.net
Address: 98.138.74.46
Name:   imap.mail.gm0.yahoodns.net
Address: 66.218.75.97
Name:   imap.mail.gm0.yahoodns.net
Address: 98.138.74.42

I don't know if Javamail rotates through servers automatically.

Max
  • 10,701
  • 2
  • 24
  • 48
  • But it never fails when i request from my local windows machine. – utsav anand Jun 09 '17 at 15:59
  • JavaMail just uses the JDK to make the connection. The [JDK does cache host names](https://stackoverflow.com/questions/1256556/any-way-to-make-java-honor-the-dns-caching-timeout-ttl), so that may be part of the problem. Still, you would need to retry the connection in the case of failure. – Bill Shannon Jun 09 '17 at 16:54