我正在使用digitalocean mailing server。我在Ubuntu 14版本中配置了Mail_In_box,并将我的域名注册商DNS映射到服务器。我已经安装了圆形邮件,并且能够使用圆形发送和接收电子邮件,它工作得很好。
现在我正在尝试使用javamail发送电子邮件。但每一次,我都会收到错误 554 5.7.1:拒绝中继访问以下是我的日志。
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文件:
mydestination = #myhostname, localhost.$myhostname, localhost
mynetworks = 127.0.0.0/8 $myhostname [::ffff:127.0.0.0]/104 [::1]/128
请帮帮我。