根据another answer,如果您想直接从stdin
发送邮件,可以将其发送到sendmail -t
,如printf "Subject: test\nTo: test@example.org\nFrom: test@example.com\n\ntesting" | sendmail -t
。
然而,当我在我的Debian 7(wheezy)上尝试这样做的时候,我没有得到任何东西,而且,从内部,Mailing to remote domains not supported
,来自Exim4。建议的方法包括运行dpkg-reconfigure exim4-config
,但是,没有一个选项可以直接通过SMTP发送邮件,也不会接收邮件。
修复Exim4最简单的方法是什么,或者用不那么复杂的东西快速替换它?我甚至不需要池支持,只需要通过SMTP发送一次。
答案 0 :(得分:0)
# fgrep remote /var/log/exim4/mainlog.1 | sed -E 's#([ <])[^ <]+@[^ >]+([ >])#\1a@b\2#g' | head -1 2019-01-08 00:47:00 1ggebk-00055M-St ** a@b <a@b> R=nonlocal: Mailing to remote domains not supported #
除了按照https://packages.debian.org/jessie/dma安装dma
(在wheezy
中不可用)之外,wheezy
的解决方案似乎是在{中选择internet
{1}}(保留了其他默认值)实际上并未打开SMTP端口,因为默认情况下,它仅侦听本地IPv4 / IPv6地址。
似乎有一个特定于Debian的dpkg-reconfigure exim4-config
(是的,它是双/etc/exim4/update-exim4.conf.conf
,不是错字),这在这场惨败中发挥了作用。这是运行.conf.conf
并仅更改向导中的第一个选项后的相关部分,该选项可以发送邮件,但似乎仍使SMTP端口仅对机器本身保持打开状态(如果您单击进入,则为默认选项)在重新配置中):
dpkg-reconfigure exim4-config