Sendmail 无法发送邮件

Sendmail 无法发送邮件

有人能帮我一下吗?我安装了 CentOS 8,正在尝试以下行:

echo "Subject: Hello" | sendmail -v [email protected]

这是/etc/hostname

web.mydomain.com

这是/etc/resolv.conf

# Generated by NetworkManager
search mydomain.com
nameserver 1.1.1.1
nameserver 8.8.8.8

这是/etc/hosts

### Hetzner Online GmbH installimage
# nameserver config
# IPv4
127.0.0.1 localhost.localdomain localhost
11.22.33.44 web.mydomain.com web
#
# IPv6
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
11:22:33:44::5 web.mydomain.com web

(此帖中的 IP 地址明显是伪造的)

web.mydomain.com我有指向盒子的 ip/ipv6 的DNS A 和 AAAA 记录。

我在我的主机 Hetzner 上设置了相应的反向 DNS 条目。

sendmail 命令的输出如下Mail Delivery Status Report will be mailed to <root>.

我发送的时候是以 root 身份登录的。奇怪的是,我有一个/var/spool/mail/mynamehere文件,但没有/var/spool/mail/root文件?

顺便说一句,我在底部有这个/etc/aliases(并且已经运行newaliases):

# Person who should get root's mail
root:           [email protected]

如果您还不知道,我根本不知道我在做什么。我现在想要的只是能够从各种 cron 作业向自己发送电子邮件。也许我应该将它们发送给 root 并让别名转发它们,但我也尝试过(只是root代替[email protected]),但似乎效果并不好?

Mydomain.com 的电子邮件由 gmail 处理,我可以通过 gmail 网络界面从该地址发送或接收邮件,没有任何问题。

这是/etc/postfix/main.cf

compatibility_level = 2
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix/samples
readme_directory = /usr/share/doc/postfix/README_FILES
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
smtpd_tls_security_level = may
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_security_level = may
meta_directory = /etc/postfix
shlib_directory = /usr/lib64/postfix

相关内容