0

I'm trying to set up a custom mailing list for my site.

When a user(user@bar.com) sends a mails to list@foo.com. The mail should automatically be sent to the subscribers.

Making the actual sending isn't that hard. But when the emails get delivered I get the "This message may not have been sent by..." warning.

This doesn't look to Cool.

First:

  1. How do I prevent this message from showing (Most important)
  2. How can I make the receiver see the list@foo.com address instead of their own. (Like google's mailing lists)

Note: The receiver should still be able to see the actual sender in the from field.

I've read some other posts on the topic, mentioning all kinds off different headers. But I Can't seem to get it to work.

I'm using PHPmailer and heres a part of my code:

<?php
    include(class.phpmailer.php);
    $real_to = "user@bar.com";
    $mail = new PHPMailer();
    $mail->IsMail();
    $mail->AddReplyTo($_POST['from_mail'], $_POST['from_name']);
    $mail->Host = "mail.foo.com";
    $mail->From = $_POST['from_mail'];
    $mail->Sender = "list@foo.com";
    $mail->MessageID = $_POST['msgID'];
    $mail->FromName = $_POST['from_name'];
    $mail->AddAddress($listmail);
    $mail->Subject  = $_POST['subject'];
    $mail->ContentType  = $_POST['content_type'];

    $mail->addCustomHeader("X-BeenThere: " . $listmail);
    $mail->addCustomHeader("Precedence: list");
    $mail->addCustomHeader("Precedence: list");
    $mail->addCustomHeader("Envelope-To: " . "list@foo.com");
    //$mail->addCustomHeader("Received: " . $_POST['received']);
    $mail->Body = $_POST['body'];
    $mail->Send();
?>
4

2 回答 2

1

我最终制作了一个更新邮件列表的 cronjob,将所有收件人添加为别名。这解决了所有关于不是来自发件人的按摩的奇怪消息。我不知道这是否是一个好方法。但它有效。

我还添加了 PTR 记录。安装了 DKIM 支持并设置了 SPF 记录。这解决了所有垃圾邮件标记。

现在问题解决了。

于 2014-03-23T19:49:42.973 回答
1

我不太确定 php 代码中需要什么,但这里有一些一般的邮件服务器提示。您的某些问题可能出在您的标头信息或邮件服务器的配置中。

当我使用我们的本地邮件服务器向邮件列表发送消息时,我发现人们没有在某些域上接收邮件。当我查看邮件服务器日志(hMailServer)时,我看到收件人的服务器正在拒绝邮件。

问题原来是我的域在 ISP 的域设置中 缺少反向 ip 查找注册。

我相信这也可能是某些邮件收件人将您的邮件标记为垃圾邮件通知和警告的来源(视您的情况而定)。

要考虑的另一点是,您在标题中指定了返回路径地址- 这与回复地址不同- 这是邮件服务器在相互交谈时使用的设置。查看这个小故障排除指南

于 2014-03-23T17:46:21.367 回答