0
2

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 3 years have passed since last update.

楽天ひかりのSMTPサーバにPostfixからメールリレーする

Posted at

目的

自宅サーバなどでPostfixから楽天ひかりのSMTPサーバを使ってメール送信する場合の最短手順です。

手順

楽天ひかりを開通させる

省略

独自ドメインをとる(可能なら)

最近はメール受信元でMXレコードをチェックするものが増えてきているので、お名前.comなどで独自ドメインをとり、MXレコードを設定しておくとよいでしょう。

楽天ひかりで無料メールアドレスを取得

SMTP-AUTHを通すために無料メールアドレスを1つ取得しておきます。手順は省略します。

Postfixのインストール

次のパッケージをインストールします。

# dnf install postfix cyrus-sasl-plain

main.cfの変更

/etc/postfix/main.cf
mydomain = 自分のドメイン名
myorigin = $mydomain
relayhost = [mail.gol.com]:587
smtpd_recipient_restrictions = permit_mynetworks
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp-auth
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain

SMTP-AUTHファイルの作成

下記ファイルを作成します。パスワードはデフォルトでメンバーズステーションのパスワードです。

/etc/postfix/smtp-auth
[mail.gol.com]:587 無料メールアドレス:パスワード

ハッシュ化して、平文ファイルを削除します。

# postmap hash:/etc/postfix/smtp-auth
# ls -l /etc/postfix/smtp-auth.db
# rm /etc/postfix/smtp-auth

Postfix起動

# systemctl restart postfix

以上

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?