我在这里看到过几个这个问题,但我找不到解决方案。
我目前正在尝试使用 mailtutils 设置 Postfix,但我无法在邮箱中看到收到的电子邮件,所以我不确定此过程中是否存在问题。
我发送到邮件帐户的邮件在日志中显示为已发送,但它们并未进入邮箱,甚至垃圾邮件文件夹也没有收到。日志没有显示任何错误,所以我不确定问题是什么。
以下是输出电子邮件日志:
邮件日志
Jan 12 18:01:19 mail postfix/qmgr[25826]: 69C03AE5FF7: from=<[email protected]>, size=366, nrcpt=1 (queue active)
Jan 12 18:01:19 mail postfix/local[25873]: 69C03AE5FF7: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jan 12 18:01:19 mail postfix/qmgr[25826]: 69C03AE5FF7: removed
以下是主要配置文件:
主配置文件
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mycompanyname.com.au
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mycompanyname.com.au, mail.mycompanyname.com, localhost.$myhostname, localhost
# uncomment this if you don't wanna send external emails that are not "mycompanyname"
#relayhost = [mycompanyname.com.au]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
#local_transport = virtual
#virtual_transport = mailutils
我还设置了sasl_passwd
正确的凭据,并使用以下命令发送电子邮件:
echo "body of your email" | mail -s "This is a subject" -a "From:[email protected]" [email protected]
问题是,我能够从 @mycompanyname.com.au 向 @outlook.com、@gmail.com 和 @hotmail.com 甚至我的大学邮箱发送和接收电子邮件,并且我可以看到邮箱中发送的电子邮件,但电子邮件不会显示在“mycompany”邮箱中。例如,如果我从 @mycompanyname.com.au 向 @mycompany.com.au 发送,则不会显示任何内容。这可能表明电子邮件已发送但未收到?
日志输出没有显示任何问题,所以我不确定我在这里做错了什么。
请注意,我正在使用 Outlook Web App 接收“mycompanyname”服务器的电子邮件,并且我确保它不会过滤垃圾邮件。
答案1
默认情况下,将邮件发送到正在运行的服务器中的本地postfix
邮箱。如果您想在“Outlook Web App”中接收电子邮件,则需要配置以在那里传递消息。/var/mail/user
/var/spool/mail/user
postfix
postfix