4

我在 server1.fvdevelopment.com 上运行 ispconfig 网络/邮件服务器,问题是我的邮件最终在 Google 成为垃圾邮件。我已经设置了 rDNS、DKIM、SPF、dmarc,在 mail.tester.com 上对其进行了测试并获得了 10/10,所以我认为记录部分不会成为问题。但是,我的邮件标头在一个地方包含 localhost。根据谷歌的说法,这是一种不好的做法。

标题如下:

Delivered-To: hatrix05slk@gmail.com
Received: by 10.46.83.71 with SMTP id t7csp321551ljd;
        Thu, 5 Oct 2017 01:44:12 -0700 (PDT)
X-Google-Smtp-Source: AOwi7QDMToIk1MWaxUfmgNnk5OxLTcntcctaq1yCwSzOdCTObVb5C54D/RJ3P4u4hAh4aaMJIJqf
X-Received: by 10.223.184.246 with SMTP id c51mr12273556wrg.250.1507193052462;
        Thu, 05 Oct 2017 01:44:12 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1507193052; cv=none;
        d=google.com; s=arc-20160816;
        b=fStO+P6zBspVbKy7h/F6IdpvGd0ED+o9ci/3Sopz2cRJfBkESefBHjtO24hKzTNYIx
         w5djV02Cj71F4diVmYutOpoeP02plccscyLfhWs2HwxTQ9pjYpFxdmBLtEy1j+HEhVmT
         FVb+StuxHBSMYWjNtqren7MSkJBmMIpVCkzebETAdotjDS9g96JU/gFaXqccJIF5NEz5
         GVmtnL+S5dtH6Dv+fm9xZfRvTuTLyDvI+RidZ1ZHGW9ZHh2fkGV0EyZvTkboEe0okhQ7
         n9PbyX+20xGmwKCfWD7sb3ey1CHlqPUZokXC/uIRAlJ4rldEWtlTPxEX/6PeD+34Ucq7
         zfpw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=user-agent:message-id:from:date:content-transfer-encoding
         :mime-version:subject:to:dkim-signature:arc-authentication-results;
        bh=1Z7p1Z5uGEIf+6AZhZ9l3wWsFBizphzS8t8qmhwcSfY=;
        b=vGnssxKjYXLBobxlSLeMbWr7+1tXStKmXXCOpvVVhHQ+JAkrjr+4/ArjltNLGMybZT
         7XwX3zKmnh2ZP8U39BXDDccVYIqvCE9EK7Zfkkd+M70nr0EWMpRzgdoFGZsJjg5DCQRD
         6NymwJDulAKDhBYJocgjfZ06lok6vshrZqwMXcDJTzDwWjD+IUJTgBQy8py7vDlO4mPG
         Es2AsVUFNEJGikHs3gj7wFBJRR27bskeYYyJ0Z3tnVswDGn6k0+U/Kj3XV9acQE29936
         KgMcLX1eTE3/QiFiTRP7oW6gIrLoEynI5UU3b/Bgq3KppclHl9m4q3v1ASa6JyjmZL9n
         u8AA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@magnorbertfotografus.hu header.s=default header.b=a0SJ1z55;
       spf=pass (google.com: domain of info@magnorbertfotografus.hu designates 207.154.236.132 as permitted sender) smtp.mailfrom=info@magnorbertfotografus.hu;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=magnorbertfotografus.hu
Return-Path: <info@magnorbertfotografus.hu>
Received: from server1.fvdevelopment.com (server1.fvdevelopment.com. [207.154.236.132])
        by mx.google.com with ESMTPS id a53si2257050wra.424.2017.10.05.01.44.11
        for <hatrix05slk@gmail.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 05 Oct 2017 01:44:12 -0700 (PDT)
Received-SPF: pass (google.com: domain of info@magnorbertfotografus.hu designates 207.154.236.132 as permitted sender) client-ip=207.154.236.132;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@magnorbertfotografus.hu header.s=default header.b=a0SJ1z55;
       spf=pass (google.com: domain of info@magnorbertfotografus.hu designates 207.154.236.132 as permitted sender) smtp.mailfrom=info@magnorbertfotografus.hu;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=magnorbertfotografus.hu
Received: from localhost (server1.fvdevelopment.com [127.0.0.1]) by server1.fvdevelopment.com (Postfix) with ESMTP id C9E5285A71 for <hatrix05slk@gmail.com>; Thu,
  5 Oct 2017 10:44:11 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= magnorbertfotografus.hu; h=user-agent:message-id:from:from:date :date:content-transfer-encoding:content-type:content-type :mime-version:subject:subject; s=default; t=1507193051; x= 1509007452; bh=L/xoTp7H4vQf9Krt99Qa65fJYkTcTAh3O6MbrxKyYR8=; b=a 0SJ1z55WFSLwHWYpsIZvEBVijKT05TW0LRozWmVp/xtV0W78vd6t5uzoEUgoESWd RHQCNz781PsXPaqqQVO5N7SK4IjceWXBd8mpubx/VxAk2hur81vEvIgTBy2oawUG d1M8rxc93Uir+3otzamGkBcV/UDCJURYbUNpLF4kCl7aYrpqkQ0lm1TPukfYkGvK dOjB+ERahcFini3S1v50yEAXeWIarEa3UN4vdA8gh3SG4FBJ9Zi/4C306xh/nml9 /00ynI53loJSatmH7I63oPmyJs5c2+iaW5N11/PMRWfUK8aGp54zs8gqb0r51jXw J8GBQD8e3vNN8AkVo42QQ==
X-Virus-Scanned: Debian amavisd-new at server1.fvdevelopment.com
Received: from server1.fvdevelopment.com ([127.0.0.1]) by localhost (server1.fvdevelopment.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8b0IS0eBLm7u for <hatrix05slk@gmail.com>; Thu,
  5 Oct 2017 10:44:11 +0200 (CEST)
Received: by server1.fvdevelopment.com (Postfix, from userid 33) id 0E6148157A; Thu,
  5 Oct 2017 10:44:11 +0200 (CEST)
To: hatrix05slk@gmail.com
Subject: Friss hirek jöttek
X-PHP-Originating-Script: 0:rcube.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Date: Thu, 05 Oct 2017 10:44:10 +0200
From: "Mag Norbert Fotográfus" <info@magnorbertfotografus.hu>
Message-ID: <066c4122a97faef9edce55bfcfcbc8bf@magnorbertfotografus.hu>
X-Sender: info@magnorbertfotografus.hu
User-Agent: Roundcube Webmail/1.2-beta

如您所见,“接收自”部分有一个本地主机。我的 /etc/hosts 如下所示:

207.154.236.132 server1.fvdevelopment.com
127.0.0.1 server1.fvdevelopment.com server1
127.0.1.1 server1.fvdevelopment.com server1
127.0.0.1 localhost.localdomain localhost

我的 /etc/hostname 有 server1.fvdevelopment.com。

关于如何摆脱 localhost 部分的任何想法,因为我尝试了很多变体但无法摆脱它。

最好的问候, Trix

4

3 回答 3

3

检查smtp_header_checks选项,例如main.cf添加以下行:

smtp_header_checks = pcre:/usr/local/etc/postfix/header_checks.pcre

您可以使用以下内容隐藏一些额外的标头,除了以、 发件人 IP 甚至 RoundCube 的签名/usr/local/etc/postfix/header_checks.pcre开头的标头之外Received:User-AgentX-PHP-Originating-Script:

/^Received:/                  IGNORE
/^X-PHP-Originating-Script:/  IGNORE
/^X-Originating-IP:/          IGNORE
/^X-Mailer:/                  IGNORE
/^User-Agent:/                IGNORE

smtp_header_checks仅适用于外发邮件(smtp 客户端)

于 2018-07-01T14:25:49.060 回答
1

您日志中的邮件标头表明该邮件在发送到 gmail 之前在您的主机内部转发了一次或两次。我不知道内部服务器设置是什么,但似乎'postfix'在它出去之前在内部将它发送给它自己(或它自己的另一个实例)。在这些“跃点”之一上,发件人被检测到或报告为“本地主机”。

为避免这种情况,请执行以下操作: - 修改 /etc/hosts 以使 localhost 和您的实际服务器名称的 IP 地址不相同,例如,试试这个:

207.154.236.132 server1.fvdevelopment.com
127.0.1.1 server1.fvdevelopment.com server1
127.0.0.1 localhost.localdomain localhost

(注意“外部”名称不在 127.0.0.1 上)

  • 检查与邮件服务相关的所有配置文件是否有任何对“localhost”的引用并终止它们(替换为服务器名称)。

  • 检查与邮件服务相关的所有配置文件以获取对 IP 地址的任何引用,127.0.0.1并将其更改为127.0.1.1. 这样,“内部跃点”从主机到自身的连接仍将在lo接口上,但127.0.0.1不在localhost.

  • 验证所选的辅助本地地址(例如,127.0.1.1)是否反向解析为您的完整服务器名称(例如, python -c 'import socket as s ; print (s.gethostbyaddr("127.0.1.1"))'

  • 验证是否hostname --fqdn返回server1.fvdevelopment.com(如果您的主机名设置为 ,通常会出现这种情况server1)。

于 2018-06-26T16:39:28.923 回答
0

请记住 ^^ 如果您在 Ispconfig 中更改全局过滤器中的某些内容,那么您所有手动编辑的正则表达式都将从 /etc/postfix/header_checks 中消失

我刚刚在电子邮件 -> 内容过滤器下直接添加了这些字段

此致

于 2020-03-24T16:01:02.953 回答