我的邮件被发送到谷歌的垃圾邮件文件夹

时间:2011-06-18 11:26:37

标签: ruby-on-rails email postfix-mta

我刚刚设置了我的网络服务器,rails app,后缀和dovecot。当我测试邮件时它工作正常,但Gmail会自动将我发送的邮件放入垃圾邮件文件夹中。

我检查了Spamhaus列表中的IP地址,没有,我检查了邮件日志,并没有什么令人惊讶的......

任何人都可以为我提供其他我应该寻找的指导吗?

谢谢!

更新

这是邮件标题:

Delivered-To: test@example.com
Received: by 10.52.113.230 with SMTP id jb6cs31694vdb;
        Sat, 18 Jun 2011 05:42:32 -0700 (PDT)
Received: by 10.227.198.133 with SMTP id eo5mr3183668wbb.38.1308400951575;
        Sat, 18 Jun 2011 05:42:31 -0700 (PDT)
Return-Path: 
Received: from mail.example.com (mail.example.com [123.45.678.910])
        by mx.google.com with ESMTP id fs8si5078709wbb.140.2011.06.18.05.42.29;
        Sat, 18 Jun 2011 05:42:30 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of request@example.com designates 123.45.678.910 as permitted sender) client-ip=123.45.678.910;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of request@example.com designates 123.45.678.910 as permitted sender) smtp.mail=request@example.com
Received: from example.com (localhost.localdomain [127.0.0.1])
    (Authenticated sender: request@example.com)
    by mail.example.com (Postfix) with ESMTPA id CCB602AFCF
    for ; Sat, 18 Jun 2011 14:42:29 +0200 (CEST)

3 个答案:

答案 0 :(得分:2)

我要检查的第一件事是,电子邮件中的:from value:user_name中的config.action_mailer.smtp_settings相同

以下是一个示例,请注意'youremail@gmail.com'

# config/development.rb
config.action_mailer.smtp_settings = {
    :address              => "smtp.gmail.com",
    :port                 => 587,
    :domain               => 'gmail.com',
    :user_name            => 'youremail@gmail.com',
    :password             => SECRET[:email_password],
    :authentication       => 'plain'
    # :enable_starttls_auto => true  
  }  

# app/mailers/user_mailer.rb
class UserMailer < ActionMailer::Base

  default :from => "youremail@gmail.com"  

  def welcome_email(user)
    @user = user
    mail(:to => user.profile.email,
         :subject => "Registration Successful")
  end
end

答案 1 :(得分:0)

您可能需要使用自定义域。你呢?从理论上讲,任何人都可以设置自定义邮件服务器并发送垃圾邮件,这可能就是它发生的原因。

另外,请务必不要在标题中添加任何异乎寻常的内容。

答案 2 :(得分:0)

我发现您的电子邮件没有DKIM,这也可能是将电子邮件放入垃圾邮件或者可能是由于IP声誉或域名声誉造成的一个原因。

您可以检查黑名单here

的IP和域名信誉