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,638 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
  • 2
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
is your authentication getting called?
0
 

Author Comment

by:LiveWire530
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
The mail server I was using needed to have the webserver's IP added to to it relay list
Thanks!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Images won't display in JSP pages 30 173
jason format for rest webservices and sub resourcing 1 84
java cigar challenge 58 204
java operators 3 87
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now