Java Forum / General / March 2006
email sent from java app haults queues
dylan.roehrig@gmail.com - 21 Mar 2006 19:49 GMT I'm not sure if this is the correct place to be posting this. I have a consultant who is trying to use a java app to send an email using my exchange server. Whenever the email attempts to be sent to an email address outside of the company, the message gets stuck in the queue and is never transferred to the other email server. Is this likely a problem with the app, or with my exchange server?
Oliver Wong - 21 Mar 2006 23:42 GMT > I'm not sure if this is the correct place to be posting this. I have a > consultant who is trying to use a java app to send an email using my > exchange server. Whenever the email attempts to be sent to an email > address outside of the company, the message gets stuck in the queue and > is never transferred to the other email server. Is this likely a > problem with the app, or with my exchange server? Try using a different server. If the problem goes away, it's probably a problem with the server. Try using a different app. If the problem goes away, it's probably a problem with the app. If it goes away in both cases, then the problem is probably complicated. If the problem doesn't remains in both cases, then problem is probably complicated.
- Oliver
Roedy Green - 21 Mar 2006 23:49 GMT > If the problem doesn't remains in >both cases, then problem is probably complicated. > > - Oliver LOL. That tickled.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Oliver Wong - 22 Mar 2006 00:07 GMT >> If the problem doesn't remains in >>both cases, then problem is probably complicated. >> >> - Oliver > > LOL. That tickled. Darn. I had initially written something like "If the problem doesn't go away in both cases", but realized that this could be ambiguous as to whether I meant "If there exists zero or one cases where the problem goes away", or "If there exists exactly zero cases where the problem goes away", so I wanted to rephrase it as "If the problem remains in both cases", but I see I forgot to delete the "doesn't".
- Oliver
Roedy Green - 22 Mar 2006 00:37 GMT >>> If the problem doesn't remains in >>>both cases, then problem is probably complicated. [quoted text clipped - 9 lines] >wanted to rephrase it as "If the problem remains in both cases", but I see I >forgot to delete the "doesn't". even corrected, it still tickles my funny bone.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 21 Mar 2006 23:47 GMT >I'm not sure if this is the correct place to be posting this. I have a >consultant who is trying to use a java app to send an email using my >exchange server. Whenever the email attempts to be sent to an email >address outside of the company, the message gets stuck in the queue and >is never transferred to the other email server. Is this likely a >problem with the app, or with my exchange server? I have found ISPs are interfering more and more often with email in attempts to curb spam. The essential problem is the email protocols have no inherent provisions to deal with it.
For example, Telus won't let you access SMTP servers other than theirs.
Shaw limits you to 700 outgoing emails a day.
Shaw won't let you access your email account unless you are accessing via a Shaw IAP.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Nigel Wade - 22 Mar 2006 12:51 GMT > I'm not sure if this is the correct place to be posting this. I have a > consultant who is trying to use a java app to send an email using my > exchange server. Whenever the email attempts to be sent to an email > address outside of the company, the message gets stuck in the queue and > is never transferred to the other email server. Is this likely a > problem with the app, or with my exchange server? What does your Exchange server say in it's logs? If your Exchange server accepts an email which it subsequently can't deliver, it's most likely a problem in your Exchange server. Is it setup to allow relaying?
Of course it could be that both the Java app and Exchange are working fine and it's the recipient's mail server that is broken. Exchange could be retrying the request (hence the need to look in the Exchange logs) and will continue to do so for several days before finally bouncing the message back to the sender.
I don't see how it could be a problem with the Java app.
 Signature Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
dylan.roehrig@gmail.com - 22 Mar 2006 21:36 GMT Thanks for all of the replies. If I telnet to the exchange server on port 25 from the server the java app is on, I am able to send an email that way just fine, which indicates that relaying is functioning without a problem because otherwise it spits out an error saying that relaying is now allowed to the destination domain.
Attempting to send a message to an outside domain (gmail.com for example) works via telnet. Sending a message to that same domain does not work via the java app. If it helps, they are using JavaMail.
Nigel Wade - 23 Mar 2006 10:56 GMT > Thanks for all of the replies. If I telnet to the exchange server on > port 25 from the server the java app is on, I am able to send an email [quoted text clipped - 5 lines] > example) works via telnet. Sending a message to that same domain does > not work via the java app. If it helps, they are using JavaMail. You still need to look at the Exchange logs. It's Exchange which is not forwarding the mail on for final delivery. Find out why.
 Signature Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
dylan.roehrig@gmail.com - 23 Mar 2006 16:06 GMT Looking at the exchange logs, the last thing that the exchange server says is
2006-03-22 20:42:11 4.79.181.18 OutboundConnectionResponse SMTPSVC1 mailserver - 25 - - 354+go+ahead 0 0 12 0 437 SMTP - - - -
Does JavaMail put a <CRLF>.<CRLF> automatically at the end of the message?
Nigel Wade - 24 Mar 2006 12:08 GMT > Looking at the exchange logs, the last thing that the exchange server > says is > > 2006-03-22 20:42:11 4.79.181.18 OutboundConnectionResponse SMTPSVC1 > mailserver - 25 - - 354+go+ahead 0 0 12 0 437 SMTP - - - - I don't do Exchange, so I don't know what all that means. It's not exactly transparent in meaning is it? Is that the server accepting the message from the client, or the server attempting to forward it on?
If it's the Exchange server forwarding the message, and the 437 is a reply code from the external MTA then that indicates a transient error. A 4xx reply code indicates that was the message was ok, but the receiving MTA was unable to process the message at the current time - please call again later. Always supposing that Microsoft obey the accepted protocols...
> Does JavaMail put a <CRLF>.<CRLF> automatically at the end of the > message? It does everything required to compose a correct message. If it didn't the Exchange server should not have accepted it.
Here is a snippet of code I use to send new users a "welcome" message (which automatically generates their mail account) when I register them:
Properties props = System.getProperties();
// Setup mail server props.put("mail.smtp.host", ConfigurationData.getMailServer());
// Get session Session session = Session.getDefaultInstance(props, null);
// Define message MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("xxx@yyy")); message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient)); message.setSubject("Welcome to the Space Plasma Physics mail system"); message.setText("This is a test message to ensure that email is working.");
// Send message Transport.send(message);
As you can see, there's not a lot to it. There certainly is no need to terminate the message with a <CR><LF>.<CR><LF>. That is part of the transmission protocol and is handled by Transport.send() for SMTP.
 Signature Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
dylan.roehrig@gmail.com - 24 Mar 2006 16:56 GMT Nigel, Thanks, that actually clears it up quite a bit. I wanted to see what the code to send the mail would look like, so that helps. The message that I posted from the Exchange server is once the server has accepted the message and is attempting to forward it on. In testing, I set up another smtp server and it worked fine, so evidently the problem is with the Exchange server. I'll have to do some work to figure out why, but your help was greatly appreciated, thanks.
Dylan.
Nigel Wade - 27 Mar 2006 09:46 GMT > Nigel, > Thanks, that actually clears it up quite a bit. I wanted to see what [quoted text clipped - 3 lines] > another smtp server and it worked fine, so evidently the problem is > with the Exchange server. Now, why doesn't that surprise me.
> I'll have to do some work to figure out why, Because it's written by Microsoft?
> but your help was greatly appreciated, thanks. No problem.
One tool that I find invaluable when trying to track down IP communication problems is ethereal. It's available for both Windows and Linux (and other OS). It captures packets off the net and displays their contents. Provided you are not using encrypted comms. it can save many hours spent pouring over a problem when you can see exactly what was sent by both ends, and when. It has an extensive range of filters to restrict what packets are captured and displayed.
 Signature Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|