ローカルルートにメッセージを送信できません

ローカルルートにメッセージを送信できません

Raspberrypi 3B+システムでDebian Stretchベースのmit OpenMediaVault(ARM)を使用するのに問題があります。

次のコマンドはエラーを返さず、電子メールも返しません。

root@raspberrypi:~# echo "Content" | mail -s "Subject" root
root@raspberrypi:~# mail
No mail for root
root@raspberrypi:~# cat /var/spool/mail/root
root@raspberrypi:~#

メールでログイン

cat /var/log/mail.log
Jul 13 08:12:16 raspberrypi postfix/pickup[1809]: BA9A76059: uid=0 from=<root>
Jul 13 08:12:16 raspberrypi postfix/cleanup[1952]: BA9A76059: message-id=<[email protected]>
Jul 13 08:12:16 raspberrypi postfix/qmgr[1638]: BA9A76059: from=<[email protected]>, size=435, nrcpt=1 (queue active)
Jul 13 08:12:16 raspberrypi postfix/error[1954]: BA9A76059: to=<[email protected]>, orig_to=<root>, relay=none, delay=0.09, delays=0.04/0.03/0/0.02, dsn=5.0.0, status=bounced (raspberrypi.localdomain)
Jul 13 08:12:16 raspberrypi postfix/cleanup[1952]: CBF576061: message-id=<[email protected]>
Jul 13 08:12:16 raspberrypi postfix/bounce[1955]: BA9A76059: sender non-delivery notification: CBF576061
Jul 13 08:12:16 raspberrypi postfix/qmgr[1638]: CBF576061: from=<>, size=2447, nrcpt=1 (queue active)
Jul 13 08:12:16 raspberrypi postfix/qmgr[1638]: BA9A76059: removed
Jul 13 08:12:16 raspberrypi postfix/error[1954]: CBF576061: to=<[email protected]>, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced (raspberrypi.localdomain)
Jul 13 08:12:16 raspberrypi postfix/qmgr[1638]: CBF576061: removed

助けてくれてありがとう。

ベストアンサー1

解決策は/etc/postfix/main.cfの次の行です:

myhostname = localhost
mydomain = localdomain
mydestination = $myhostname, localhost.$mydomain, localhost
inet_interfaces = $myhostname, localhost
mynetworks_style = host
default_transport = error: outside mail is not deliverable

postfixサービスの再起動

root@raspberrypi:~# systemctl restart postfix.service

バラより

root@raspberrypi:~# echo Test | mail -s test root
root@raspberrypi:~# mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/root": 1 message 1 new
>N  1 [email protected]  Sat Jul 13 15:55   17/547   test

おすすめ記事