Javamail Error 550
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business
Com.sun.mail.smtp.smtpaddressfailedexception: 550 5.7.1 Unable To Relay For
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation com.sun.mail.smtp.smtpaddressfailedexception 550 5.7.1 relaying denied Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like javamail faq you, helping each other. Join them; it only takes a minute: Sign up Java Mail Exception up vote 1 down vote favorite I have currently face a problem when I try to send an email using JavaMail API.
Javax.mail.sendfailedexception: Invalid Addresses
The exception I get from my application console is : "javax.mail.MessagingException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)" by the way, I have already set my mail.smtp.auth property to true as : props.put("mail.smtp.auth", "true"), but it still fail, does anyone has idea? or face similar problem before ? java javamail share|improve this question edited Mar 1 '10 at 3:50 Jim Counts 6,25582654 asked Mar 1 '10 at 3:28 Dickson 5412818 add a
Smtpaddressfailedexception Relay Access Denied
comment| 2 Answers 2 active oldest votes up vote 1 down vote A 550 error is often returned by the SMTP server when the sending hostname cannot be inverse resolved to the originating IP address. This allows mail servers a bit of authentication that the sending client is who it says it is. Unfortunately, many test clients - especially systems behind a NAT device - will have originating IP addresses that don't map to any name. For example, the machine I am typing this on has an unroutable IP address of 192.168.1.103 and my hostname could be so.example.myhouse which works fine because my router pretends that packets from my desk come from (e.g.) 69.59.196.211 which is my WAN address. However, if you use a props.put("mail.from", "me@so.example.myhouse") the SMTP server may try a DNS lookup and obviously fail for my fictional hostname (that is, one that the global DNS doesn't know of). Even if I used the DNS name which maps to 69.59.196.211 (e.g. stackoverflow.com) the SMTP server may do a reverse DNS lookup to check that 211.196.59.69.in-addr.arpa maps to stackoverflow.com. If that fails, the SMTP server may consider you a spoofer and return a 550. Finally, your sending client or every host it its IP address block could be blacklisted by the SMTP server for reasons that you have no control over. Without more contex
Exception 550 relaying mail to is not allowed Problem: Running server side code that sends an email is being rejected by the SMTP server: javax.mail.SendFailedException: Invalid Addresses; nested exception is: .smtpaddressfailedexception: 550 5.7.1 unable to relay com.sun.mail.smtp.SMTPAddressFailedException: 550 relaying mail to example.com is not allowed at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
Javax.mail.sendfailedexception Invalid Addresses Unable To Relay
at javax.mail.Transport.send0(Transport.java:169) at javax.mail.Transport.send(Transport.java:98) Contrary to the error message, its not an issue isolated to the "To" recipient address. No matter unable to relay smtp what the "To" field was, the relay error was the same with the ???.com substituted in. Other posts/support-resources on the web point to issues with authentication - but this SMTP server does not http://stackoverflow.com/questions/2353734/java-mail-exception require authentication, just that the host is one of a set of IP addresses. Other web applications on the same host, running in the same (tomcat) application server are sending mail to this SMTP server with no problems. Solution: In this case, the difference was the spec of the JavaMail libraries. The apps that were working were all using spec 1.2 (deployed with activation.jar, mail.jar and mailapi.jar). http://dev-answers.blogspot.com/2007/05/javamail-exception-550-relaying-mail-is.html Our app getting the relay error was using spec 1.3 (implementation version 1.4). Downgrading the libraries (ie putting the 3 older jars in WEB-INF/lib) resolved the problem - no more errors from the SMTP server. There may be a change in spec to do with the way the host is identified. If the libraries were identifying the client code's host as anything other than the IP address then this may be the problem. Perhaps the new libraries require additional properties to configure this behaviour? For the moment things are working but I may get to the bottom of this later ... Posted by Kevin Jansz at 12:13 pm Labels: exceptions No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) Blog Archive ► 2016 (1) ► February (1) ► 2015 (1) ► October (1) ► 2014 (2) ► November (1) ► June (1) ► 2013 (6) ► October (1) ► August (1) ► July (1) ► June (1) ► April (1) ► March (1) ► 2012 (5) ► November (1) ► October (1) ► July (1) ► April (1) ► March (1) ► 2011 (7) ► October (1) ► September (1) ► August (1) &
for issue changes as well as the emails generated viaContact Administrators form can get affected due to this error. The following appears in theatlassian-jira-outgoing-mail.log: 2012-05-17 unable to 14:47:58,780 ERROR [SMTP Server(servername)] Sending mailitem To='sample@domain.com' Subject='Sample Subject' From='sender@domain.com' FromName='null' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null' ServiceRunner Mail Queue Service Error occurred in sending e-mail: To='sample@domain.com' Subject='Sample Subject' From='sender@domain.com' FromName='null' unable to relay Cc='null' Bcc='null' ReplyTo='null' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null' com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550 you are not allowed to send mail to