我正在使用在docker容器中运行的alpine linux来运行webapp。该Web应用程序应该从命令行使用mail命令发送电子邮件。
为此,我安装了如下邮件:
apk add mailx
当我尝试发送消息时,出现以下错误:
bash-4.3# mail [email protected]
Subject: test
EOT
Null message body; hope that's ok
bash-4.3# send-mail: applet not found
不知道我在做什么错。任何帮助都将受到高度赞赏。
高山地区没有默认的MTA。除了mailx之外,您还需要安装和配置MTA(邮件传输代理),例如postfix:
# apk add postfix
(1/3) Installing db (5.3.28-r0)
(2/3) Installing libsasl (2.1.26-r8)
(3/3) Installing postfix (3.1.3-r0)
Executing postfix-3.1.3-r0.pre-install
Executing busybox-1.25.1-r0.trigger
OK: 8 MiB in 16 packages
开始后缀:
~ # postfix start
postfix/postfix-script: warning: not owned by root: /var/spool/postfix/.
postfix/postfix-script: warning: not owned by root: /var/spool/postfix/pid
postfix/postfix-script: starting the Postfix mail system
发送测试消息:
~ # mail -s "Test" [email protected]
.
EOT
Null message body; hope that's ok
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句