# This files are the log come from the mail subsystem.
#
destination mail { file("/var/log/mail.log"); };
destination maillog { file("/var/log/maillog"); };
destination mailinfo { file("/var/log/mail.info"); };
destination mailwarn { file("/var/log/mail.warn"); };
destination mailerr { file("/var/log/mail.err"); };
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
日志在哪里?
默认位置取决于您的 linux/unix 系统,但最常见的位置是
如果它不存在,请查找
/etc/syslog.conf
。你应该看到这样的东西sendmail将日志写入系统日志
mail
工具。因此,它写入哪个文件取决于syslog的配置方式。如果您的系统使用syslog-ng(而不是更“传统”的syslog),那么您将不得不查找您的
syslog-ng.conf
文件。你应该是这样的:无法发送电子邮件?
我看到新安装的sendmail 无法发送电子邮件的最常见原因之一是 DAEMON_OPTIONS 设置为仅在 127.0.0.1 上收听
请参阅 /etc/mail/sendmail.mc
如果是这种情况,请删除“Addr=127.0.0.1”部分,重建您的 conf 文件,一切顺利!
如果到目前为止您一直在手动更改 /etc/sendmail.cf(而不是 *.m4 文件),您可以在 /etc/sendmail.cf 中进行类似的更改。违规行将如下所示:
将其更改为:
如果您在 *nix 上,请检查 /var/log/maillog 或 /var/log/messages
此外,如果没有任何结果,您可能需要按如下方式检查防火墙(确保以 root 身份执行此操作):
尝试查看 /var/log/mail.info 或 /var/log/mail.err
还检查 /var/spool/mqueue 以获取当前缓存的传出邮件
对于 Fedora 等人。journalctl _COMM=sendmail 将显示来自 sendmail 的消息。
我通过搜索被引导到这个答案。/var/log/mail 仅包含 Fedora 上的“统计”文件。并且所有其他提到的目录都不存在。
如果您不知道要使用什么参数,journalctl 不够直观,ymmv。所以我发布了这个解决方案。
您可以创建自己的日志文件
接着