0

I am using digitalocean mailing server. I have configured Mail_In_box in Ubuntu 14 version and also map my domain registrar DNS with server. I have installed roundcude mail and also able to send and receive email using roundcude and it is working nice.

Now I am trying to send email using javamail. But each time, I am getting error 554 5.7.1 : Relay access denied Below is my log.

DEBUG SMTP: trying to connect to host "mail.domainname.com", port 587, isSSL false
220 mail.domainname.com ESMTP Hi, I'm a Mail-in-a-Box (Ubuntu/Postfix; see     https://mailinabox.email/)
DEBUG SMTP: connected to host "mail.domainname.com", port: 587

EHLO admin.lan
250-mail.domainname.com
250-PIPELINING
250-SIZE 134217728
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "SIZE", arg "134217728"
DEBUG SMTP: Found extension "VRFY", arg ""
DEBUG SMTP: Found extension "ETRN", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<myfirstemailaddress@domainname.com>
250 2.1.0 Ok
RCPT TO:<myemailaddress@gmail.com>
554 5.7.1 <myemailaddress@gmail.com>: Relay access denied
DEBUG SMTP: Invalid Addresses
DEBUG SMTP:   myemailaddress@gmail.com
DEBUG SMTP: Sending failed because of invalid destination addresses
RSET
250 2.0.0 Ok
javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1     <myemailaddress@gmail.com>: Relay access denied

main.cf file:

mydestination = #myhostname, localhost.$myhostname, localhost
mynetworks = 127.0.0.0/8 $myhostname [::ffff:127.0.0.0]/104 [::1]/128

Kindly help me.

user1629977
  • 437
  • 1
  • 5
  • 21
  • Most of the time using SMTP AUTH should help you with this - once you're authenticated as myfirstemailaddress@domainname.com that server will allow you to send outward mails – Jan Mar 06 '18 at 09:40
  • Are you connecting to the email server from the java app on localhost, or remotely? Are you trying to authenticate with a user? – Stephan Mar 23 '18 at 03:57
  • Can you post your postfix config using command `postconf -n` – Stephan Aug 01 '18 at 19:07

0 Answers0