django / code.djangoproject.com

Configuration for Django's Trac instance (code.djangoproject.com)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trac notification emails sent via IPv6 are being flagged as spam by gmail

alasdairnicol opened this issue · comments

Gmail is flagging Trac notifications from code.djangoproject.com as spam, with a link to https://support.google.com/mail/answer/81126?hl=en-GB#authentication.

Here are the email headers. Would it be possible to create an SPF record for the IP address sending the emails?

Delivered-To: alasdair@...
Received: by 10.194.190.44 with SMTP id gn12csp2126929wjc;
        Tue, 28 Apr 2015 07:52:23 -0700 (PDT)
X-Received: by 10.140.235.68 with SMTP id g65mr1217528qhc.96.1430232742966;
        Tue, 28 Apr 2015 07:52:22 -0700 (PDT)
Return-Path: <noreply@djangoproject.com>
Received: from djangoproject.com ([2001:4802:7801:102:be76:4eff:fe20:789f])
        by mx.google.com with ESMTP id d74si18594161qhc.132.2015.04.28.07.52.22
        for <alasdair@...>;
        Tue, 28 Apr 2015 07:52:22 -0700 (PDT)
Received-SPF: none (google.com: noreply@djangoproject.com does not designate permitted sender hosts) client-ip=2001:4802:7801:102:be76:4eff:fe20:789f;
Authentication-Results: mx.google.com;
       spf=none (google.com: noreply@djangoproject.com does not designate permitted sender hosts) smtp.mail=noreply@djangoproject.com
Received: from djangoproject.com (ip6-localhost [127.0.0.1])
    by djangoproject.com (Postfix) with ESMTP id 870826A304;
    Tue, 28 Apr 2015 14:50:58 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
From: "Django" <noreply@djangoproject.com>
X-Trac-Version: 1.0.5
Precedence: bulk
Cc: django-updates@googlegroups.com
Auto-Submitted: auto-generated
X-Mailer: Trac 1.0.5, by Edgewall Software
X-Trac-Project: Django
Date: Tue, 28 Apr 2015 14:50:58 -0000
Reply-To: noreply@djangoproject.com
X-URL: https://code.djangoproject.com/
Subject: Re: [Django] #24714: Use more specific assertions than assertEqual
 in tests
X-Trac-Ticket-URL: https://code.djangoproject.com/ticket/24714#comment:8
Message-ID: <071.f8eb7fbc5a59f61fdcbe6e26324e16a6@djangoproject.com>
References: <056.410f75585511842836a658fcd6b32e98@djangoproject.com>
X-Trac-Ticket-ID: 24714
In-Reply-To: <056.410f75585511842836a658fcd6b32e98@djangoproject.com>

I believe that would look like v=spf1 ip4:162.242.220.127 ~all
@apollo13, okay with you?

@alasdairnicol Can gmail tell you why it flagged it as spam? I doubt that adding SPF would help.

@timgraham Looks okay, but I am not particularly wild about SPF -- but as long as it does not hurt us, why not. Just make sure to never return FAIL and just SOFTFAIL.

EDIT:// I'd also add the ipv6 addy and add a PTR record for it.

I wouldn't be surprised if adding the IPv6 PTR is sufficient.

@MarkusH Yeah, that should certainly improve it.

Added IPv6 PTR. I guess we can wait a bit and see if that resolves the problem?

@apollo13 In the UI, gmail linked to https://support.google.com/mail/answer/81126?hl=en-GB#authentication, but it didn't give a specific reason why it failed.

I mentioned SPF because I saw the spf result in the headers. However, looking at the guidelines, it looks like google think that valid reverse dns is more important than SPF records. Hopefully @timgraham adding the IPv6 PTR will do the trick.

Hi, I've received two trac update emails today:

  • The email sent from the IPv4 address 162.242.220.127 got through fine.
  • The email sent from the IPv6 address ended up in Gmail's Spam folder again.

I noticed this evening that the 'Additional Guidelines for IPv6' section of the page I linked to says that there should be a forward DNS record which matches the PTR. There doesn't seem to be a AAAA record for djangoproject.com at the moment.

Okay, I added the AAAA record.

@timgraham did you check that nginx actually handles ipv6 properly and we are not bound to ipv4 only?

No, I didn't, and it looks like it's not listening on ipv6. I deleted the AAAA record for now and will revisit tomorrow after fixing nginx. Thanks for the heads up!

nginx updated and AAAA record re-added.

Trying to get http://www.djangoproject.com from 2001:4802:7801:102:be76:4eff:fe20:789f...
200 OK

Thanks Tim. The latest email arrived via IPv6 and was not marked as spam by gmail.