Catalogue
How to Stop Your "Registration Complete" Emails from Landing in Spam

How to Stop Your "Registration Complete" Emails from Landing in Spam

🌐 日本語で読む

Overview

A configuration that’s easy to forget when building a site:
“Our registration-complete emails keep ending up in spam.”

You need to set up an SPF record and configure reverse DNS lookup.

First, What Is Forward DNS Lookup?

domain — query —> IP address

Suppose you have an email address like the following.

info@hogehoge.jp

Querying the IP address from hogehoge.jp is called a forward lookup.

What Is Reverse DNS Lookup?

IP address — query —> domain

Querying hogehoge.jp from an IP address is called a reverse lookup.

SPF Record

SPF = Sender Policy Framework

It’s a framework that defines the policy of the side sending email.

Why Does Such a Framework Exist?

Because spoofing the sender is trivially easy!

1
$ echo "TEST" | sendmail -f aiueo@xxxx.jp -t kenzo.xxxxxx.0107@gmail.com

What Setting Up an SPF Record Means

Setting up an SPF record means that, by specifying the sender’s IP address and domain,
the recipient can verify whether the sender’s email address matches
the IP and domain information configured in the SPF record.

What Configuring Reverse Lookup Means

It lets you compare the domain derived from the sender’s IP address
with the domain tied to the reverse-lookup-configured IP, and
if they differ, judge it to be spoofed.

Services like Gmail have this filter enabled, so
if reverse lookup isn’t configured, your mail ends up in the spam box.

Verifying the SPF Record Setting

1
$ dig -t TXT <mail domain>
  • Example) gmail.com
1
2
3
$ dig -t TXT gmail.com

gmail.com. 300 IN TXT "v=spf1 redirect=_spf.google.com"
  • Example) yahoo.co.jp
1
2
3
$ dig -t TXT yahoo.co.jp

yahoo.co.jp. 6 IN TXT "v=spf1 include:spf.yahoo.co.jp ~all"

Verifying the SPF Record Setting in Gmail

  • When SPF: NEUTRAL, the SPF record is not configured correctly.
  • When SPF: PASS, the SPF record is configured correctly.

That’s all.

How to Stop Your "Registration Complete" Emails from Landing in Spam

https://kenzo0107.github.io/en/2016/12/02/meiwaku-mail/

Author

Kenzo Tanaka

Posted on

2016-12-02

Licensed under