email sent from java app haults queues

D

dylan.roehrig

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?
 
O

Oliver Wong

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
 
R

Roedy Green

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.
 
O

Oliver Wong

Roedy Green said:
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
 
R

Roedy Green

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".

even corrected, it still tickles my funny bone.
 
N

Nigel Wade

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.
 
D

dylan.roehrig

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.
 
N

Nigel Wade

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.

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.
 
D

dylan.roehrig

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?
 
N

Nigel Wade

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.
 
D

dylan.roehrig

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.
 
N

Nigel Wade

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top