Facebook反弹从.NET发送的电子邮件(亚马逊服务器)

时间:2013-11-24 16:10:57

标签: .net facebook amazon bounce reverse-dns

我有一个位于Amazon EC2服务器上的.NET webapp,有时需要自动向我们的用户发送电子邮件,有些用户在他们的个人资料中有@ facebook.com电子邮件。

在一段时间内,代码用于工作。但突然facebook开始反弹电子邮件。

我通过API连接到GoogleApps电子邮件帐户,然后发送电子邮件。这是行不通的。但是,当我直接从浏览器发送电子邮件时,使用相同的GoogleApps电子邮件帐户,它完美运行,Facebook不会退回电子邮件。我真的不知道发生了什么。

以下是我收到的错误消息示例:

------------------------------------------------------
Delivery to the following recipient failed permanently:

example@facebook.com
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain facebook.com by msgin.t.facebook.com. [69.171.244.12].

The error that the other server returned was:
554 5.7.1 POL-P7 Please visit http://postmaster.facebook.com/auth_error for more information

----- Original message -----

X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:message-id:mime-version:from:date:subject
:content-type:content-transfer-encoding;
bh=/QlLJ07OvzWA2ZFwfg4bOYoI1J7Rg0pgXSPnN5o4AfQ=;
b=d8fKwt7BXoFa1lBfzj/V/Yw9BBzYRU3ek7M+RHUqlj6eMcfGx2uHnUf0uL15exkHKg
gG4MsJ0UnP48I+sDyyjCYFeC2KvFc0h7CPKXEJrcvcdHHgnD08sihDv52NbL3etituDu
iKCglMiWFlCDIsVj70/2zv5Gd6oEo0s9kuwF5Tl1NxeneYZ+I7O0sW1bGAk4pSirerFn
2ULMo7NnNg+7hArlb7++88fR/SzUDS2up0cFdCNnXiw8URiSxFWCLEAQ7poO0BLjSOPT
0g9EvQZBVNcdpDul16QizIn06TCdl/Vo/17ZHlqqAKzGJ4JpIN5ak6FoMcAJR7/EaY1+
hNwA==
X-Gm-Message-State: ALoCoQk5gWH0rTql0eH4A8I9QxUtwvlgmd3XmiWBs7P81jfSiuZLVSLCC7Ihjf9LmdtrHTu/jRup
X-Received: by 10.224.54.66 with SMTP id p2mr4249799qag.87.1381928426232;
Wed, 16 Oct 2013 06:00:26 -0700 (PDT)
Return-Path: <contact@example.com>
Received: from AMAZONA-D82IT7Q (ec2-54-221-57-219.compute-1.amazonaws.com. [54.221.57.219])
by mx.google.com with ESMTPSA id a9sm126253475qed.6.1969.12.31.16.00.00
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Wed, 16 Oct 2013 06:00:25 -0700 (PDT)
Message-ID: <525e8de9.e90f310a.5f01.ffffc399@mx.google.com>
MIME-Version: 1.0
From: "Panel Example" 
<contact@example.com>
Date: Wed, 16 Oct 2013 06:00:25 -0700 (PDT)
Subject: =?utf-8?B?W0xhemVyIEJSXSBFdmVudG9zIHF1ZSB2b2PDqiBnb3N0YXJp?=
=?utf-8?B?YSBkZSBhcHJvdmVpdGFyIG5vIGRpYSAxNi8xMC8yMDEz?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64

----- End of message -----

我用来发送电子邮件的.NET代码是:

SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.Credentials = new NetworkCredential(myEmail, myPassword);
smtp.EnableSsl = true;
smtp.TargetName = "smtp.gmail.com";

MailMessage mail = new MailMessage();
mail.Subject = _subject;
mail.Body = _message;
mail.Priority = MailPriority.High;
mail.IsBodyHtml = true;
mail.Sender = new MailAddress(myEmail);
mail.From = new MailAddress(myEmail, "Panel Example");

if (Receivers.Count == 1)
{
    mail.To.Add(Receivers[0]);
}
else
{
    foreach (var item in Receivers)
    {
        mail.Bcc.Add(item);
    }
}

if (Attachs != null && Attachs.Count > 0)
    foreach (Attachment attach in Attachs)
        mail.Attachments.Add(attach);

smtp.Send(mail);

我应该在亚马逊服务器上配置反向DNS吗?端口587是否正确使用?是否有任何其他配置 - 超出SSL,端口 - 我将配置,以便Facebook不会退回电子邮件?

谢谢大家!

0 个答案:

没有答案
相关问题