メールテストで送信。


# メールクライアントインストール 多分インストール済。
[root@mail ~]# yum -y install mailx


# メールボックスは Maildir を参照するよう設定
[root@mail ~]# echo 'export MAIL=$HOME/Maildir' >> /etc/profile

# 自身にテストメール送信 [mail (ユーザー名)@(ホスト名)]
[cent@mail ~]$ mail guest@localhost
# 件名
Subject: Test Mail#1
# 本文
This is the first mail.

# 本文を終了する場合はピリオド(.)を入力してEnter
.
EOT

# 自身にテストメール送信 [mail (ユーザー名)@(ホスト名)]

[cent@mail ~]$ su - guest ←guestユーザに変更

[cent@mail ~]$ mail guest@localhost ←自分にメールを送信。
# 件名
Subject: Test Mail#1
# 本文
This is the first mail.

# 本文を終了する場合はピリオド(.)を入力してEnter
.
EOT


メールを受信する

[cent@mail ~]$ mail

Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/home/guest/Maildir": 1 message 1 new

>N 1 cent Thu Jun 29 16:49 17/530 "Test Mail#1"



# 表示したいメールの番号を入力
& 1
Message 1:
From cent@atalanta.jp Thu Jun 29 19:49:34 2019
Return-Path: <giest@atalanta.jp>
X-Original-To: cent@localhost
Delivered-To: cent@localhost.atalanta.jp
Date: Thu, 29 Jun 2019 19:49:33 +0900
To: cent@localhost.atalanta.jp
Subject: Test Mail#1
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
From: guest@atalanta.jp (guest)
Status: R

This is the first mail.

# 終了する場合は [q]
& q
Held 1 message in /home/cent/Maildir
You have mail in /home/cent/Maildir