0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

さくらVPSから携帯キャリアにメール送信する(CentOS,Postfix)

Posted at

携帯キャリア(*@docomo.ne.jp)で受信できるよう
ドメインを取得してメール送信できる環境を整えます。

インターネット上の記事を読むと、auがもっとも厳しい制約を掛けているとのことですが、自分はdocomo/softbankしか保持していないため、今回は2社で試してみます。

参考)キャリアの情報
https://www.nttdocomo.co.jp/service/imode_mail/notice/sender_id/
https://www.au.com/mobile/service/mail/attention/spf-record/

実施すること
・ドメインを取得してA、MX、TXT(spf)レコードを登録する
・gmail、docomo、softbankのキャリアメールアドレスでメールを受信する

本Postfixの設定は、ほぼデフォルトであるためインターネット上に構築・公開する際にはリレー・送信元を自分自信のみに制御するなど注意と対策をお願いいたします。

環境

$ rpm -qa | grep postfix
postfix-2.10.1-6.el7.x86_64

$ alternatives --display mta
mta - status is auto.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
Current `best' version is /usr/sbin/sendmail.postfix.

DNS

$ dig <domain>
;; ANSWER SECTION:
<domain>. 3600 IN A <ip>

$ dig <domain> txt 
;; ANSWER SECTION:
<domain>. 1262 IN TXT "v=spf1 +ip4:<ip> include:mail.<domain> -all"

メール送信

$ mail kai.kusakari@gmail.com
Subject:test
gmail
.
$ mail *@docomo.ne.jp
Subject:test
docomo
.
$ mail *@i.softbank.jp
Subject:test
soft
.

gmail、softbankにはメールが届きましたがdocomoだけメールが帰ってきました。少し情報を見ると、docomoは多くの場合メールの受信が制限されているそうです。以下の手順で制御を解除することで受信することができました。
https://dekiru.net/article/14776/

上記docomoのように、docomoのキャリアメールに対してPCのメールを受信する設定を入れている人は極めてまれだと思うので、docomoのドメインからgmailなどにメールが来たとしても別手段(電話など)で返信すべきですね。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?