在php和sendmail中转发内部邮件

时间:2014-03-04 22:14:22

标签: php sendmail

这是一封由php mail()发送的电子邮件; 它似乎在最终发送到目的地之前被转发了两次。

MyQuestion:这是否被认为是正常的?如果没有,如何解决这个问题?

以下是来源的一部分:

   Received: from mailer.sv.xxx.net ([2600:3c01::xxx]) 
by mx.google.com with ESMTPS id gn5si190076pbc.146.2014.03.04.13.54.31
for <dest@gmail.com>


   Received: from mailer.xxxx.net (localhost [127.0.0.1])
by mailer.sv.xxx.net (8.14.4/8.14.4/Debian-2ubuntu2.1)
for <dest@gmail.com>

   Received: (from www-data@localhost)
by mailer.xxx.net 

PHP.ini :(以www-data运行)

 sendmail_path = /usr/sbin/sendmail -t -i -r mailer

===========================

更新:这是php发送的另一封电子邮件。

- 在我卸载sendmail并安装Postfix之后。

这就是我想要的(只是'看起来更好')

 Received: from XXX.net (XXX.net. [173.x.x.x])

 Received: by XXX.net (Postfix, from userid 33)

1 个答案:

答案 0 :(得分:1)

Sendmail-8.12 +出于安全原因不再是设置root uid程序。它只是风险较小的集合组(gid)程序。

您需要额外的跃点,以便在没有root权限的情况下将sendmail中的电子邮件传递到以root权限运行的127.0.0.1:25的主sendmail守护程序。现代sendmail是正常的和预期的。

您可以考虑将您的php配置为通过smtp将电子邮件直接发送到127.0.0.1:25,但我不建议将其用于经验有限的主持人。