?
Solved

JavaMail SMTP 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

Posted on 2004-04-19
5
Medium Priority
?
6,658 Views
Last Modified: 2007-12-19
Hello
I've developed a JavaMail form processor for a project of mine, however I am hung up on one problem.

I am using Tomcat and I run it on my local machine to test sending an email.
I use authentication and specifically enter the username and password for the server.  It works with no problem

When I use the same program on the public WebServer I get the 553 error when I try to send to an email adddress outside the domain.
javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

The Webserver still uses the same authentication.  Even stranger is when I Install Outlook and send email from that same address there is no problem

Please help
What can I do?
0
Comment
Question by:LiveWire530
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10864567
is your authentication getting called?
0
 

Author Comment

by:LiveWire530
ID: 10864660
Well I assume it authenticates, I see no errors with DEBUG option at the console level.
Plus I am sending 2 messages and the first one is within the domain and is also authenticated.

Below is the code:


public class LsbSmtpAuthenticator extends Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                  return new PasswordAuthentication("fromaddr@mydomain.com", "mypassword");
            }
      }
.
.
.

Properties props = System.getProperties();
          props.put("mail.smtp.host", "mail.mydomain.com");
          props.put("mail.smtp.auth", "true");
      Authenticator auth = new LsbSmtpAuthenticator();
      javax.mail.Session Msession = javax.mail.Session.getInstance(props, auth);

      Msession.setDebug(true);
          MimeMessage automessage = new MimeMessage(Msession);
          automessage.setFrom(new InternetAddress("fromaddr@mydomain.com"));
          automessage.addRecipient(Message.RecipientType.TO, new InternetAddress("toaddr@otherdomain.com"));
          automessage.setSubject("Testing");

      MimeBodyPart ahtml = new MimeBodyPart();
            ahtml.setContent(autoHTML,"text/html");
      MimeBodyPart atext = new MimeBodyPart();
            atext.setText(autoText);
      MimeMultipart amultipart = new MimeMultipart("alternative");
      amultipart.addBodyPart(ahtml);
      amultipart.addBodyPart(atext);
      
      automessage.setContent(amultipart);
          Transport.send(automessage);
0
 
LVL 92

Expert Comment

by:objects
ID: 10864759
perhaps add some debug to your getPasswordAuthentication() method to see that it is being called.
Of get some log of the SMTP traffic.
0
 
LVL 7

Accepted Solution

by:
searlas earned 1500 total points
ID: 10867419
See the information here:
http://mail.python.org/pipermail/mailman-users/2001-December/016230.html

From reading that, and your question, it seems that:
when mail originates from your local machine, it is relayed ok.
when mail originates from your public webserver it is not relayed.

Now, you don't say who hosts your public webserver, or who your isp is,
but I know that for myself, my ISP will ONLY relay email that originates
from IP addresses it controls.  If I want to send email from my webserver
I have to use a different smtp server, run by the people who host my
webserver.

So, it could just be you need to use a different mail.smtp.host (and authentication) for your webserver.

0
 

Author Comment

by:LiveWire530
ID: 10873462
The mail server I was using needed to have the webserver's IP added to to it relay list
Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question