让 Postfix 将“身份验证结果”标头添加到发往本地域的本地邮件中?

让 Postfix 将“身份验证结果”标头添加到发往本地域的本地邮件中?

如果我通过sendmail或 SubmissionS 客户端向我的虚拟帐户(我的域名是 example.org)写一封邮件,我收到的邮件如下所示:

Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from example.org
    by hostname with LMTP
    id 5n+pDaCqAWAOcgAAUprYAg
    (envelope-from <[email protected]>)
    for <[email protected]>; Fri, 15 Jan 2021 15:45:52 +0100
To: [email protected]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.org;
    s=r; t=1610721951;
    h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
     to:to:cc; bh=91RazCIc2UKGe+HBO/tFDtuL2v1Tzk19s+Q44fL6gEY=;
    b=pmlzcXQJAFHqKAjznCT4Hc77BjyX8QFXrQRTfzCH7UXXsBxNYCuSNrM6wSXAZ54+lAVDIO
    MYEGXwY3+4F1GgbJ/dQVQGYq262FKjcVwQhFHALvI704iGMEt5Uu/kqLHkk09EQKIyBlAf
    btrA42do+0lia6kkPNd2ezVqOR8O6WkH52eVKj8x/+lq3P5N4sCgoiOZcnIWUlyBMlhlFa
    vMWLjc+4DU4nLZxOYZyYS68RVJuDN4Vr5cz6+jNGYvidXkCvtyT99MgmMQ38oKwtbpT+0g
    sNzjOif4PbAWrJ+29IoJa/lV9nkYIKVtMa4CPJ6bqAVj4ITjwGLTwswBK//VdA==
From: [email protected]
Subject: test e-mail
Message-Id: <[email protected]>
Date: Fri, 15 Jan 2021 15:45:51 +0100 (CET)

Mail body

如果我将其发送给外部收件人,则会添加“身份验证结果”。

Authentication-Results: mail2.outsi.de (dis=neutral; info=dmarc domain policy);
    dmarc=pass (dis=neutral p=reject; aspf=r; adkim=r; pSrc=dns) header.from=example.org;
    dkim=pass header.d=example.org header.s=r header.b=O/8zOi6w
Received: from mail.outsi.de ([10.10.10.11])
        by mail2.outsi.de
        with SMTP (SubEthaSMTP 3.1.7) id KJYEI2ZV
        for [email protected];
        Fri, 15 Jan 2021 15:52:36 +0100 (CET)
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=10.10.10.10; helo=example.org; [email protected]; receiver=<UNKNOWN> 
Received: from example.org (example.org [10.10.10.10])
    by mail1.outsi.de (Postfix) with ESMTPS id ACBEF1060308
    for <[email protected]>; Fri, 15 Jan 2021 14:52:36 +0000 (UTC)
To: [email protected]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.org;
    s=r; t=1610721951;
    h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
     to:to:cc; bh=91RazCIc2UKGe+HBO/tFDtuL2v1Tzk19s+Q44fL6gEY=;
    b=pmlzcXQJAFHqKAjznCT4Hc77BjyX8QFXrQRTfzCH7UXXsBxNYCuSNrM6wSXAZ54+lAVDIO
    MYEGXwY3+4F1GgbJ/dQVQGYq262FKjcVwQhFHALvI704iGMEt5Uu/kqLHkk09EQKIyBlAf
    btrA42do+0lia6kkPNd2ezVqOR8O6WkH52eVKj8x/+lq3P5N4sCgoiOZcnIWUlyBMlhlFa
    vMWLjc+4DU4nLZxOYZyYS68RVJuDN4Vr5cz6+jNGYvidXkCvtyT99MgmMQ38oKwtbpT+0g
    sNzjOif4PbAWrJ+29IoJa/lV9nkYIKVtMa4CPJ6bqAVj4ITjwGLTwswBK//VdA==
From: [email protected]
Subject: test e-mail
Message-Id: <[email protected]>
Date: Fri, 15 Jan 2021 15:45:51 +0100 (CET)

Mail body

我如何才能让 Postfix 将此标头添加到发往我本地域 (example.org) 的外发邮件中?Milter 是 Rspamd。

在我的“main.cf”中我有

# [...]

non_smtpd_milters = $smtpd_milters
milter_default_action = accept

在我的“master.cf”中我有

smtp             inet  n       -       n       -       -       smtpd
 -o milter_macro_daemon_name=VERIFYING

submissions      inet  n       -       n       -       -       smtpd
 -o syslog_name=postfix/smtps
 -o smtpd_tls_wrappermode=yes
 -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
 -o milter_macro_daemon_name=ORIGINATING

# [...]

答案1

这是因为您的 OpenDMARC 配置将 IgnoreAuthenticatedClients 设置为 true,这将忽略来自您本地域的电子邮件。

看起来你正在使用带有 authres_status 插件的 Roundcube 网络邮件客户端,对我来说,解决方法是编辑 authres_status.php 并检测 DKIM 签名是否包含我的域名,然后伪造状态以通过 xD

相关内容