我正在尝试在 ssh root 登录时创建电子邮件警报,因此我必须安装ssmtp和邮件实用程序。
然后我配置ssmtp.conf文件如下:
# Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
#Adding email id to receive system information
root = rootuser@gmail.com
# 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=mail
mailhub = smtp.gmail.com:587
AuthUser=dmymail@gmail.com
AuthPass=plaintext password
UseTLS=YES
UseSTARTTLS=YES
# …Run Code Online (Sandbox Code Playgroud)