我正在尝试使用 Sendmail 创建一个万能电子邮件地址(它将用于捕获退回的电子邮件Oceth 的 OEMPro)。
首先我创建一个新用户:
# useradd -s /bin/false bounces
# passwd bounces
然后我创建并打开了一个 virtusertable 文件vim virtusertable
并添加:
[email protected] bounces
@sub.example.com [email protected]
然后我将下面这行添加到发送邮件接近尾声,但在 MAILER_DEFINITIONS 之前
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
最后,我跑了
# make
Updating databases ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...
Updating auth ...
sasl2-bin not installed, not configuring sendmail support.
To enable sendmail SASL2 support at a later date, invoke "/usr/share/sendmail/update_auth"
Creating /etc/mail/relay-domains
# Optional file...
Updating Makefile ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/Makefile...
Updating sendmail.cf ...
The following file(s) have changed:
/etc/mail/sendmail.cf
** ** You should issue `/etc/init.d/sendmail reload` ** **
# service sendmail reload
* Reloading Mail Transport Agent (MTA) sendmail [ OK ]
# service sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail [ OK ]
经过所有这些,它似乎不起作用,我该如何正确测试它。我尝试发送电子邮件至[电子邮件保护]但当我看着/var/邮件/我没有看到跳出用户。
# ls /var/mail/
root www-data other-user
我也为此创建了 MX DNS 记录,例如 sub.example.com。
另一个表明它无法正常工作的迹象是,当我们尝试使用此电子邮件地址作为我们的 POP3 监控方法时,我们收到 504 错误Oceth 的 OEMPro。
更新
我尝试以 root 身份运行以下命令,试图调试该问题,但我不清楚它告诉我什么。
root:/# sendmail -d60.5 -bv [email protected]
map_lookup(dequote, other-user, %0=other-user) => NOT FOUND (0)
map_lookup(host, sub.example.com, %0=sub.example.com) => sub.example.com. (0)
[email protected]... deliverable: mailer esmtp, host sub.example.com., user [email protected]
root:/# sendmail -d60.5 -bv [email protected]
map_lookup(dequote, other-user, %0=other-user) => NOT FOUND (0)
map_lookup(host, sub.example.com, %0=sub.example.com) => sub.example.com. (0)
[email protected]... deliverable: mailer esmtp, host sub.example.com., user [email protected]
我不知道为什么它首先尝试查找我们系统上的另一个用户other-user
更新2
运行后# echo '$=w' | sendmail -bt
得到以下结果。
# echo '$=w' | sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> localhost
ip-1??-??-??-??5
[1??.??.??.??5]
ip-1??-??-??-??5.ec2.internal
[127.0.0.1]
ip-172-31-31-167.eu-west-1.compute.internal
在发送邮件我已将FEATURE(
virtusertable',更改hash -o /etc/mail/virtusertable.db')dnl
为FEATURE(
virtusertable', hash -o /etc/mail/virtusertable.db')dnl
,基本上我只是删除了-o
标志。
然后我更新了/etc/mail/本地主机名包括sub.example.com
,因此现在内容为:
localhost
ip-17?-??-??-?67.eu-west-1.compute.internal
sub.example.com
然后我跑了:
# service sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail
# echo '$=w' | sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> localhost
ip-1??-??-??-??5
[1??.??.??.??5]
ip-1??-??-??-??5.ec2.internal
[127.0.0.1]
sub.example.com
ip-17?-??-??-?67.eu-west-1.compute.internal
发送电子邮件至[电子邮件保护]我仍然没有看到邮箱/var/邮件/
# ls /var/mail/
root www-data other-user
当我尝试使用这些设置来配置 OEMPro 应用程序时,仍然会出现 504 错误。