Solved

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

Posted on 2004-04-19
5
6,644 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
trouble with PDF encryption using itext-1.3.1 17 88
tomcat users xml 7 139
doubleChar java challenge 7 129
spring example non maven 4 100
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article discusses how to implement server side field validation and display customized error messages to the client.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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