LoginSignup
1
0

AlmaLinux 9 で SAKURA の メールボックスを使う

Last updated at Posted at 2024-02-21

s-nail のインストール

[root@my.domain.server ~]# dnf install s-nail

設定

$HOME/.mailrc を以下のように設定する。

set v15-compat
set mta=smtp://username%40my.domain:mypassword@www9999.sakura.ne.jp:587 smtp-use-starttls
set from=username@my.domain

上記は次のように読み替えること

  • username = ユーザ名
  • my.domain = ユーザのドメイン名
  • mypassword = パスワード
  • www9999 = 利用している SAKURA メールボックスのサーバ名

mta 設定の書式としては、[プロトコル]://[アカウント]:[パスワード]@[SMTPサーバ]:[ポート] となる。SAKURA のメールボックスでは、ドメイン名を含めたメールアドレスが SMTP 認証時のアカウントとなるので、上記のように username@my.domain を [アカウント] に設定する。このとき、[アカウント] と [パスワード] は urlencode されている必要があるので、[アカウント] に含まれる @%40 に置き換える。(使用している文字によっては[パスワード] も urlencode しなければならない)

メール送信テスト

[user@my.server ~]$ mail xxxx@gmail.com
Subject: TEST
To: xxxx@gmail.com
This is a s-nail test.
^D
-------
(Preliminary) Envelope contains:
From: username@my.domain
To: xxxx@gmail.com
Subject: TEST
Send this message [yes/no, empty: recompose]? y
[in-admin@xserver ~]$

^DCtrl + D

環境

  • Host OS : AlmaLinux 9.3
  • 外部 SMTP : SAKURA mailbox

余談

VPS でウェブ・サーバを運用しているのですが、メールは面倒臭いので SAKURA メールボックスを利用しています。

AlmaLinux 8 (≒CentOS 8) までと違って、AlmaLinux 9 では mailx が無くなり s-nail を使う必要があるのですが、.mailrc の書き方も以前とは変っていて、ちょっと設定に手間取りました。

自分のための備忘を同じような環境の方のためにシェアします。

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