我在 ubuntu 18.04 上安装了一个 vps,使用 virtualmin 作为控制面板。在虚拟服务器中创建用户后,服务器会自动在“Maildir”文件夹(通常用于通过 IMAP 存储邮件)之外创建一个“邮件”目录。服务器使用后缀。
我在用户文件夹中的文件夹结构现在是这样的:
root@server01:/home/tuppr/homes/dprins# ls -al
total 28
drwxr-x--- 7 dprins@tuppr.nl tuppr 4096 Jan 11 21:02 .
drwxr-xr-x 3 tuppr tuppr 4096 Jan 11 21:01 ..
drwx------ 3 dprins@tuppr.nl tuppr 4096 Jan 11 21:02 mail
drwx------ 9 dprins@tuppr.nl tuppr 4096 Jan 11 21:01 Maildir
drwx------ 2 dprins@tuppr.nl tuppr 4096 Jan 11 21:02 .spamassassin
drwxr-xr-x 2 dprins@tuppr.nl tuppr 4096 Jan 11 21:04 .tmp
drwx------ 7 dprins@tuppr.nl tuppr 4096 Jan 11 21:02 .usermin
问题是传入的邮件奇怪地存储在“Maildir”目录中,但电子邮件客户端和网络邮件看不到它。
我的后缀 main.cf 看起来像这样:
root@server01:/home/tuppr/homes/dprins# cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# 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 = server01.dennisprins.nl
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server01.dennisprins.nl, localhost.dennisprins.nl, , localhost
#relayhost =
relayhost = vps.transip.email:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
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
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
#smtp_tls_security_level = may
allow_percent_hack = no
在“邮件”目录中,我通常只找到一些“鸽子”日志文件,但没有真正的电子邮件。这些存储在“Maildir”中,但由于某种原因,我尝试的每个电子邮件客户端似乎都没有发现存储在该文件夹中的邮件。就像它忽略了这些。webmail 客户端也看不到任何传入的邮件。但它们实际存储在“Maildir”中。
但是,发送邮件进展顺利。我使用第三方电子邮件客户端(例如在我的 Mac 上)发送的每封邮件都存储在服务器上,网络邮件客户端也会在“已发送”文件夹中看到它们。
我的鸽舍配置也指向“Maildir”。执行grep
'/mail' 的命令不会显示任何内容,而是显示 dovecot 中的注释规则。
我的 usermin 邮箱配置如下所示:
root@server01:/etc/dovecot# cat /etc/usermin/mailbox/config
spam_always=0
folder_types=local,ext,pop3,imap
no_mailer=0
server_attach=0
top_buttons=1
mail_dir=/var/spool/mail
mail_dir_qmail=Maildir
mail_file=mbox
shortindex=0
mail_system=4
from_format=1
smtp_ssl=0
pop_locks=1
nologout=1
wrap_width=80
spam_report=
perpage=20
folder_virts=virt,comp
show_to=0
mail_style=0
no_orig_ip=1
html_base64=0
edit_from=0
no_crlf=0
sendmail_path=/usr/lib/sendmail
noindex_hostname=1
from_map=/etc/postfix/virtual
mail_qmail=
pop3_server=localhost
send_mode=localhost
server_name=
smtp_pass=
global_address=
ldap_login=
ldap_quotas=
ldap_base=
smtp_user=
max_attach=
global_address_group=
smtp_port=
ldap_host=
ldap_tls=
max_quota=
ldap_pass=
smtp_auth=
ldap_port=
我还阅读并尝试了这篇文章: https ://www.virtualmin.com/node/35887 https://www.virtualmin.com/node/36027
我从字面上检查了所有内容,但我不知道为什么它不起作用。所有 DNS 记录都很好。SPF 记录也是如此。这些已经检查过了。每当我删除“邮件”目录时,只要我使用电子邮件帐户,它就会回来(无论是通过邮件客户端还是网络邮件)
你们知道它为什么会这样吗?