我已经在 centos 6.4 服务器中安装了 postfix,并对 main.cf 文件中进行了如下更改。
nano /etc/postfix/main.cf
myhostname = server.kavirajan.com
mydomain = kavirajan.com
myorigin = $mydomain ##line no 99 - uncomment
inet_interfaces = all ##line no 116 - change to all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ##line no 164 - add $domain at the end
mynetworks = 192.168.1.0/24, 127.0.0.0/8 ##line no 264 - uncomment and add your network range
home_mailbox = Maildir/ ##line no 419 - uncomment
在我重新启动 postix 并尝试连接 telnet 并使用它来发送测试邮件后。
telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server.kavirajan.com ESMTP Postfix
ehlo localhost
250-server.kavirajan.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:<user1>
250 2.1.0 Ok
rcpt to:<user1>
554 5.7.1 <user1>: Relay access denied
我反复收到中继访问被拒绝错误。
邮件日志显示:
Jun 5 17:53:23 kavirajan postfix/smtpd[28483]: connect from localhost[::1]
Jun 5 17:53:53 kavirajan postfix/smtpd[28483]: NOQUEUE: reject: RCPT from localhost[::1]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]$
Jun 5 17:53:59 kavirajan postfix/smtpd[28483]: disconnect from localhost[::1
请任何人帮助我解决这个问题。
答案1
在您的 MAIL FROM: 和 RCPT TO: 中,您只写了用户名。请尝试使用完整的邮件地址,即[电子邮件保护]。