Postfix:Mailgun未在同一域内触发

问题描述 投票:0回答:1

The Configs

我们做了通常的main.cf(后缀)中继/ sasl条目:

# Amavisd + SpamAssassin + ClamAV
#
content_filter = smtp-amavis:[127.0.0.1]:10024

# Concurrency per recipient limit.
smtp-amavis_destination_recipient_limit = 1

relayhost = [smtp.mailgun.org]:587

smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:[email protected]:password
smtp_sasl_security_options = noanonymous

这实际上工作得很好,邮件传递也正确记录在Mailgun下。

问题如果我们在域内发送电子邮件,则不会触发Mailgun。意思是:如果JohnDoe @ ourXYZDomain。com向JaneDoe @ ourXYZDomain发送电子邮件,则将通过后缀来发送。如果JohnDoe @ ourXYZDomain。com向JohnDoe @ someOtherDomain。com发送电子邮件,则将通过Mailgun smtp发送并记录该电子邮件。

分析同一域内的邮件将被发送,并且不会引发任何错误。当查看接收到的电子邮件的标头时,它表明后缀甚至没有使用Mailgun。请参见第6行的localhost [127.0.0.1]

Subject:test - 00:11
Contact photo
From    [email protected]    Date    Mon 00:11
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from mail.ourXYZDomain.com (localhost [127.0.0.1])
    by mail.ourXYZDomain.com (Postfix) with ESMTP id 49KwDw97hggXdtN
    for <[email protected]>; Sun, 10 May 2020 20:11:12 +0000 (UTC)
Authentication-Results: mail.ourXYZDomain.com (amavisd-new); dkim=pass
    reason="pass (just generated, assumed good)"
    header.d=ourXYZDomain.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=
    ourXYZDomain.com; h=user-agent:message-id:subject:subject
    :to:from:from:date:date:content-transfer-encoding:content-type
    :content-type:mime-version; s=dkim; t=1589141471; x=1591733472;
    bh=WonWKNs0MVBQ4Md9bT3TQ0-----=; b=1lp9qX-----YE
    HQwrRVwjLjcPcP/jkjhgjghgfWisfODNZ5xHnQto5Xa
    D6/Wj8fAEpwiu8uG5Ujhugz778gjNZ8UhFXtJf2aK
    1B8iZembDuiIsjg6fKj6snRjA=
X-Virus-Scanned: amavisd-new at mail.ourXYZDomain.com
Received: from mail.ourXYZDomain.com ([127.0.0.1])
    by mail.ourXYZDomain.com (mail.ourXYZDomain.com [127.0.0.1]) (amavisd-new, port 10026)
    with ESMTP id xzds0121548c for <[email protected]>;
    Sun, 10 May 2020 20:11:11 +0000 (UTC)
Received: from _ (localhost [127.0.0.1])
    by mail.ourXYZDomain.com (Postfix) with ESMTPSA id 49KwDv54101252XdtL
    for <[email protected]>; Sun, 10 May 2020 20:11:11 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
    format=flowed
Content-Transfer-Encoding: 7bit
Date: Mon, 11 May 2020 00:11:11 +0400
From: [email protected]
To: [email protected]
Subject: test - 00:11
Message-ID: <[email protected]>
X-Sender: [email protected]

我们对此行为没有任何解释。也许我们错过了什么?

谢谢您的提示

mailgun postfix-mta
1个回答
0
投票

Mailgun是许多Mail Relay service中的一种,主要用于将邮件中继到外部网络。邮件中继是将电子邮件从一台服务器传输到另一台服务器进行传递的过程。例如,如果您为公司A工作,并向公司B的某人发送电子邮件,则您将连接到公司的SMTP服务器,然后将您的电子邮件中继到公司B所拥有的服务器。

要在相同网络上发送邮件,您不需要需要中继主机。此处的邮件通过后缀在本地传递到其他用户的帐户。本地邮件取决于main.cf中的“ myorigin”“ mydestination” mynetworks“设置。以下邮件主机配置是一个使您清楚的示例。

/etc/postfix/main.cf:
       myorigin = $mydomain
       mydestination = $myhostname localhost.$mydomain localhost $mydomain
       mynetworks = 127.0.0.0/8 10.0.0.0/24

       relayhost = [smtp.mailgun.org]:587

       # Optional: forward all non-local mail to firewall
       #relayhost = [firewall.example.com]

您可以在以下链接中找到更多信息

Postfix Standard Configuration Examples

© www.soinside.com 2019 - 2024. All rights reserved.