Smtp server cannot send mail to exchange server

exchange-2007smtp

I'm not a system admin so ask me to clarify any bad explanations. We have 3 machines, all on the same domain:

1) exchange server
2) SMTP server
3) Web Server

Using Java, I send an email from the web server to the SMTP server. The SMTP server is supposed to relay the email to the exchange server. However, the email never gets sent, and on the SMTP server, the following error message shows up:

Message delivery to the host [exchange server IP address] failed while delivering to the remote domain [domain that both machines are on]: An SMTP protocol error occurred. Reason given is 'MAIL' … The remote server replied '530 5.7.1 client not
authorized'

It seems like the exchange server is not allowing the SMTP server to connect. Also, the system admins are pointing me towards the Java code and configurations, but it seems to me like the issue is between the SMTP-Exchange servers, not between the Web server-SMTP server. Any pointers on where to debug? Btw, Exchange should allow 'anonymous' access from the SMTP server, but it would seem like it isn't since the error is client not authorized. What Exchange knowledge am I missing to make this work?

Other info:
Mail sending was working before, and no changes AFAIK were made to either the exchange setup, or the smtp setup. Changes were possibly made to the java code configurations though.

Best Answer

A couple reasons why this happens that I've seen

  • You're authenticating with an account but using a return address that the account does not have permissions to send as
  • You're sending anonymously and the server does not accept anonymous mail

If it is supposed to accept anonymous mail as you say, then remove the authentication parameters from the Java mailer.