Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javamail behind proxy

 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using javamail and behind a proxy.
The mail server, the proxy and the application all three are on same LAN.
If I use outlook to talk to my mail server, it works fine... however with javamail, the following sample code throws exception...




nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: <some ip here>, port: 25;
nested exception is:
java.net.SocketException: Software caused connection abort: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at SendApp.send(SendApp.java:28)
at SendApp.main(SendApp.java:33)
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your proxy server allow the relaying of SMTP? Its going to have to to use JavaMail, and most don't.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks paul. I see it this way, if my outlook express works fine, so should any other mail client, then why not it be my javamail application? Just disabled proxies from IE and outlook still works as is...
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Be careful. If you are talking about Exchange servers, Outlook Express does not use SMTP to connect to them, it uses MAPI.


Just disabled proxies from IE and outlook still works as is


The connection setting in IE and the Services defined in Outlook Express are unrelated.

However, if you can connect to an SMTP server via a proxy using an MUA that is actually using SMTP as its connection protocol (phew!) then JavaMail should be able to connect too. How do you know that Outlook is using a proxy? Looking at my version of Outlook, I can only define a mail server, not a proxy (of course the mail server I define may actually be a proxy, but I can't tell that from Outlook).
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure the proxy is responsible for preventing you from connecting to port 25 on the mail server? I ask because some virus-prevention products (McAfee for sure and probably others) will block any outbound access to port 25, to prevent your computer from being used as a spam source. You should be able to turn that off in the product's configuration if that is your problem.
 
You don't like waffles? Well, do you like this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic