我正在尝试使用 msmtp 作为系统配置来设置 Ubuntu 20.04。
我安装了 msmtp (v1.8.6-1) 和 heirloom-mailx (v12.5-2+deb7u1build0.14.04.1)。
配置文件/etc/msmtprc (chmod: 600) 有以下内容:
# Set default values for all accounts.
account default
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp
# gmail
host smtp.gmail.com
port 587
from <account>@gmail.com
user <account>
password <password>
# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL
Run Code Online (Sandbox Code Playgroud)
日志文件/var/log/msmtp文件模式为 660。
文件/etc/mailrc (chmod: 600) 包含以下内容:
set sendmail="/usr/bin/msmtp"
Run Code Online (Sandbox Code Playgroud)
当我尝试使用 sendmail 从终端发送电子邮件时,我收到以下sendmail: account default not found: no configuration file …
我的 crontab 中有以下内容
15 */4 * * * ...
我最初的意图是,从计算机启动后,我每 4 小时运行一次。如果我早上8点开机,它会在8点、12点、16点、20点……运行;如果我在上午 9 点开机,它将在 9 点、13 点、17 点、21 点……运行
我的观察是 crontab 似乎将小时除以 4,如果余数为 0 则执行。
有没有办法可以实现前者而不是后者?