sendmail:旅行时重写信封信息

sendmail:旅行时重写信封信息

我在办公室运行自己的 sendmail 邮件服务器,多年来一直运行良好。

我最近注意到,在旅行时,我发给朋友的电子邮件有时会被退回 - 通常是因为我使用的 IP 地址属于由我碰巧使用的 ISP 动态分配的范围。这些地址经常因为这样或那样的原因被列入黑名单。

我的问题是,有谁知道我如何让 sendmail 重写标头信息,以便任何内容(尤其是我使用我的电子邮件地址发送的内容)都可以被重写,看起来像是从我自己的网络发送的(我们有自己的 C 类范围)。实际上,我希望通过我的邮件服务器发送的所有外发邮件看起来都像是从我的办公室实际发送的。

抱歉 - 我应该解释得更清楚一些。当我旅行时,我使用自己的电子邮件帐户,该帐户使用自己的邮件服务器作为 SMTP 主机。看来,当我通过动态分配的 IP 地址连接到网络并通过我的 SMTP 服务器发送电子邮件时,它会被目标主机拒绝。我非常确定我正在对我的服务器进行身份验证 - 我会检查几个小时后是否有空。

附录:

以下是我从当前位置通过 SMTP 服务器向 Google 帐户发送电子邮件后,gmail.com 的典型拒绝标头。该问题是由原始“接收自”标头引起的。

----- 会话记录如下 ----- ... 在与 gmail-smtp-in.l.google.com 交谈时:

>>> DATA
<<< 550-5.7.1 [203.217.18.80      12] Our system has detected that this message is
<<< 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
<<< 550-5.7.1 this message has been blocked. Please visit
<<< 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for
<<< 550 5.7.1 more information. pp2si5211798pbb.61 - gsmtp
554 5.0.0 Service unavailable

>--t157o6hX029609.1423122606/edrs.com.au
>Content-Type: message/delivery-status
>
>Reporting-MTA: dns; edrs.com.au
>Received-From-MTA: DNS; 58-6-171-5.dyn.iinet.net.au
>Arrival-Date: Thu, 5 Feb 2015 18:49:51 +1100
>
>Final-Recipient: RFC822; [email protected]
>Action: failed
>Status: 5.7.1
>Remote-MTA: DNS; gmail-smtp-in.l.google.com
>Diagnostic-Code: SMTP; 550-5.7.1 [203.217.18.80      12] Our system has detected that this >message is
>Last-Attempt-Date: Thu, 5 Feb 2015 18:50:06 +1100

>--t157o6hX029609.1423122606/edrs.com.au
>Content-Type: message/rfc822
>Content-Transfer-Encoding: binary

>Return-Path: <[email protected]>
>Received: from [192.168.0.166] (58-6-171-5.dyn.iinet.net.au [58.6.171.5])
    (authenticated bits=0)
    by edrs.com.au (8.13.8/8.13.8) with ESMTP id t157nohY029604
    (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO)
    for <[email protected]>; Thu, 5 Feb 2015 18:49:51 +1100
>Message-ID: <[email protected]>
>Date: Thu, 05 Feb 2015 17:49:50 +1000
>From: Nigel Allen <[email protected]>
>User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
>MIME-Version: 1.0
>To: Nigel Allen <[email protected]>
>Subject: {SPAM?} Fwd: Re: Listener Issue: App installation or download
>References: <[email protected]>
>In-Reply-To: <[email protected]>
>X-Forwarded-Message-Id: <[email protected]>
>Content-Type: multipart/mixed; boundary="----------=_1423122599-19274-10"
>X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (edrs.com.au [203.32.74.10]); Thu, 05 Feb 2015 18:49:52 +1100 (AEDT)
>X-Spam-Score: 6.618 (******) >AWL,BAYES_00,DNS_FROM_AHBL_RHSBL,HTML_MESSAGE,RCVD_IN_PBL,RCVD_IN_RP_RNBL,RDNS_DYNAMIC
>Content-Transfer-Encoding: binary
>X-Scanned-By: MIMEDefang 2.70 on 203.32.74.10

答案1

如果您说的是 Received-From 标头,那么这是不可能的。因为 Received-From 是在收到信件后由链中的每个服务器添加的。因此,除非您在循环中有另一个更靠近目标中继的服务器(我想您没有),否则您无法重写标头,因为您没有这样做的可能性。

但是,您可以使用其他技术发送邮件:

  • 您可以通过 VPN 将邮件发送到您的办公室,使用办公室 MTA 作为中继
  • 您可以注册另一个电子邮件,例如在 gmail/yahoo/whetever 上并使用它
  • 您可以在办公室设置网络邮件(如 Roundcube)并使用它来发送邮件,这样您就可以通过办公室 MTA 发送邮件
  • 您可以在办公室 MTA 中设置 SMTP 身份验证并通过它发送邮件,但无需 VPN、网络邮件或其他任何东西。

相关内容