# cd /etc/ssmtp
# cp -p ssmtp.conf ssmtp.conf.org
# vi ssmtp.conf
以下はウチのプロバイダの場合の設定です。
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=your-smtp.server.ne.jp:25
# Where will the mail seem to come from?
rewriteDomain=your-domain.server.ne.jp
# The full hostname
hostname=RaspberryPi3
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
UseTLS=NO
UseSTARTTLS=NO
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
〜略〜
# instruct the monitoring daemon where to send mail alerts
MAILADDR hoge@my.mail-addr.com
設定を反映するため、mdadm-raidサービスを再起動します。
# systemctl restart mdadm-raid.service
mdadmからメール送信テスト
mdadmからメール送信できるかテストします。
# mdadm --monitor --scan --test -1
以下のようなメールが届いたら成功。以上で作業完了です。
From: "mdadm monitoring"
To: hoge@my.mail-addr.com
Subject: TestMessage event on /dev/md0:RaspberryPi3
This is an automatically generated mail message from mdadm
running on RaspberryPi3
A TestMessage event had been detected on md device /dev/md0.
Faithfully yours, etc.
P.S. The /proc/mdstat file currently contains the following:
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[0] sda1[3] sdb1[1]
123369472 blocks super 1.2 level 5, 256k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>