• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8057
  • Last Modified:

Relaying denied. IP name lookup failed. SMTP: Sending failed because of invalid destination addresses (recipient)

I have a question:
I'm trying to send email by simply using javamail.jar.
  I used correct email addresses, smtp server is responding. It accepts sender, but don't want to accept recepient even if recepient's and sender's addresses are the same. throws error: "550 5.7.1 <example@gmail.com>... Relaying denied. IP name lookup failed [10.1.100.10]"

Any suggestions or ideas?

Thanks

DEBUG: JavaMail version 1.4.4
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "somecompany.com", port 25, isSSL false
220 somecompany.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 11 Apr 2011 17:02:13 -0700
DEBUG SMTP: connected to host "somecompany.com", port: 25

EHLO 192.168.200.122
250-somecompany.com Hello [10.1.100.10], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ETRN", arg ""
DEBUG SMTP: Found extension "DELIVERBY", arg ""
DEBUG SMTP: Found extension "HELP", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<example@somecompany-server.hq>
250 2.1.0 <example@somecompany-server.hq>... Sender ok
RCPT TO:<examples@gmail.com>
550 5.7.1 <example@gmail.com>... Relaying denied. IP name lookup failed [10.1.100.10]
DEBUG SMTP: Invalid Addresses
DEBUG SMTP:   example@gmail.com
DEBUG SMTP: Sending failed because of invalid destination addresses
RSET
250 2.0.0 Reset state
javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
      com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <example@gmail.com>... Relaying denied. IP name lookup failed [10.1.100.10]

      at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
      at javax.mail.Transport.send0(Transport.java:195)
      at javax.mail.Transport.send(Transport.java:124)
      at com.Tests.main(Tests.java:70)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <yaniskes@gmail.com>... Relaying denied. IP name lookup failed [10.1.100.10]

      at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
      ... 4 more
QUIT
221 2.0.0 somecompany.com closing connection
send failed, exception: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
      com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <example@gmail.com>... Relaying denied. IP name lookup failed [10.1.100.10]

0
yaniskes
Asked:
yaniskes
1 Solution
 
chenry334Commented:
"Relay denied" means that the SMTP server you are using will not forward email to the user you are trying to send to for your host.

Typically email servers restrict who can send mail through them... Obviously this is to combat spam - if you left your email server as an "open relay" - then anyone could send email to anyone through your sever.

There are a few ways to open up your smtp server (providing you run it?) to allow relaying based on a number of factors. Originating ip, destination email address or domain, or you can use authentication so users must authenticate to your smtp server before attempting to send mail.

In a typical setup you would allow forwarding for any domain you accept mail for (because you're the end destination so of course you need to relay for your domain(s)!), relay mail for any internal subnets or servers, and rely on authentiication for any user not on a trusted network.

Some servers also deny relaying if your ip address (10.1.100.10 in your case) does not have a reverse DNS name.  You should be able to remove this restriction on your SMTP server so it will relay even if you don't have a reverse DNS entry for it.  If you want to 'hack' it - you can try adding a name for your ip in the smtp servers host file - or if you're running DNS create a reverse DNS entry for it - but it'd probably be easier to just disable reverse lookup enforcement.

What SMTP daemon are you running?
0
 
roemelboemelCommented:
As already mentioned you should make a PTR record for this IP (10.1.100.10)
Other possibility would be to add the 10.1.100.10 to the access file
You seem to be running sendmail and assuming that your installation is pretty standard (default filelocation and FEATURE(`access_db') active)
do
echo -e "10.1.100.10\tRELAY" > /etc/mail/access
makemap hash /etc/mail/access < /etc/mail/access 

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now