Localhost 中的 Postfix

Localhost 中的 Postfix

我已经在 localhost 中设置了 postfix。但为什么它拒绝使用除我的计算机名称之外的其他用户名。我已将 main.cf 设置如下:

myhostname = yuki
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = yuki.com yuki localhost.localdomain localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/

当我从终端输入时:

sudo telnet localhost 25 ==>the result is ok, as follow:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 yuki ESMTP Postfix (Ubuntu)

但是当我从终端输入时:

sudo telnet yuki.com 25==>the result is:
telnet: could not resolve yuki.com/25: Name or service not known

但是当我从终端输入时:

sudo telnet yuki-PC 25==> the result is:
Trying 127.0.1.1...
Connected to yuki-PC.
Escape character is '^]'.
220 yuki ESMTP Postfix (Ubuntu)

注:yuki-PC 是我的计算机名称。

而且当我发送电子邮件时,电子邮件已发送,但当我查看时却/home/yuki/Maildir/new没有电子邮件。

请帮帮我,我真的是网络新手。

答案1

将域添加yuki.com/etc/hosts并重试:

127.0.0.1   localhost yuki-PC yuki.com

答案2

关于无法送达的电子邮件,请确保您已正确配置了投递代理,SMTP 仅接收和传输电子邮件,实际上并不将其传递给最终用户。您的情况可能是以下任一情况,

1)本地运输配置不正确。

2)对于本地用户来说,电子邮件可能已经发送到/var/spool/mail/$用户名

  • 以接收者用户身份登录服务器并发出/bin/邮件查看是否列出了任何电子邮件

相关内容