Postfix 设置仅发送邮件?

Postfix 设置仅发送邮件?

我正在尝试设置 postfix 以在我的计算机(Ubuntu 10.04)上发送邮件。它只需要发送邮件,并将由一些脚本中的 php mail() 函数使用。我有一个 google apps 帐户,它将接收该域的所有邮件(并且它目前运行正常)。

我刚刚安装了 postfix,并尝试按照 postfix 网站上的“空”服务器配置进行操作。例如,我的 main.cf 文件如下所示:

/etc/postfix/main.cf:

myorigin = $mydomain
relayhost = $mydomain
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled

另外,当说明告诉我更改 master.cf 时,我不确定该怎么做,所以我还没有改变任何东西,但我不认为这会影响发送邮件。/etc/postfix/master.cf:注释掉本地传送代理条目

但是,当我尝试使用以下命令向我的个人帐户发送电子邮件后,出现以下错误:

sendmail -v [email protected]


Aug 31 18:52:53 tdmain postfix/qmgr[16387]: 32811101D2: from=<>, size=1843, nrcpt=1 (queue active)
Aug 31 18:52:53 tdmain postfix/smtp[16956]: warning: relayhost configuration problem
Aug 31 18:52:53 tdmain postfix/smtp[16956]: 32811101D2: to=<[email protected]>, relay=none, delay=0, delays=0/0/0/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for name=org type=A: Host not found)
Aug 31 18:59:57 tdmain postfix/qmgr[16387]: 2AF23101CC: from=<[email protected]>, size=309, nrcpt=1 (queue active)
Aug 31 18:59:57 tdmain postfix/qmgr[16387]: 32811101D2: from=<>, size=1843, nrcpt=1 (queue active)
Aug 31 18:59:57 tdmain postfix/smtp[17535]: warning: relayhost configuration problem
Aug 31 18:59:57 tdmain postfix/smtp[17536]: warning: relayhost configuration problem
Aug 31 18:59:57 tdmain postfix/smtp[17535]: 2AF23101CC: to=<[email protected]>, relay=none, delay=440, delays=440/0.01/0/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for name=org type=A: Host not found)
Aug 31 18:59:57 tdmain postfix/smtp[17536]: 32811101D2: to=<[email protected]>, relay=none, delay=424, delays=424/0.01/0/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for name=org type=A: Host not found)

有任何想法吗?

编辑

好的,我仍然不太了解 postfix,但解决方案似乎是删除“relayhost =”后的所有内容,并手动指定上面的 mydomain 和 myhostname。

答案1

问题在于您的 Relayhost 参数,它应该是所有邮件应发送到的 SMTP 服务器的主机名。

对于 master.conf 文件,要注释掉的行如下:

local     unix  -       n       n       -       -       local

答案2

在基于 Debian 的发行版(如 Ubuntu)上,您可以使用dpkg-reconfigure postfix它将在您的终端中显示一个配置对话框。这样很容易,但请仔细阅读说明。

相关内容