MATLAB Answers

Invalid Addresses sendmail exception

8 views (last 30 days)
Hi! I'm having a new problem w/ sendmail, new in the sense that I've used sendmail many times before but have never experienced this problem 'til now. Back story: I recently learned that, without announcement, the address I'd been using for an SMTP server was removed about six months ago; I was given a "new," numerical (the old address had been a text alias) IP, which works fine in my Python apps without my having had to do anything other than simply swap out the old for the new. However, using it similarly with sendmail I now get:
Java exception occurred:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for <un>@<my.domain>
with the "nested exception is:..." part repeated several times for each of the addresses I have in my cell array.
After a little searching online it sounds like my problem is most likely "Your smtp server forbids relaying, which is very common. Often a smtp server is configured to send only mails within the same domain without authentication." However, the sender address is also @<my.domain>--that's the same domain, yes? Is it possible that the way the javax.mail object is presenting the sender and recipient addresses to the smtp server is masking the fact that they're from the same domain? If so, workaround? Any other ideas? Thanks!

Accepted Answer

Walter Roberson
Walter Roberson on 18 May 2012
Go back to the basics. Telnet to the sendmail port on the new mail server and run a session by hand. Give a HELO line, then a MAIIL FROM command line, and then a RCPT TO command line, and see if you get rejected.
The relaying bit is about the domain that the server considers itself to be: it will not allow mail to be sent to what it thinks is a different domain than it is. For example if it knows itself as (say) then it would think as a destination was outside itself.
Walter Roberson
Walter Roberson on 23 May 2012
What was the solution eventually?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by