服务器上安装了 Debian 7.8、Postfix 2.9.6、Dovecot 2.1.7。服务器不接收或向外部服务器发送邮件。在域内,一切正常。
配置文件:
/etc/hosname
vps-***.kz
主机名不能更改,它是由主机托管公司设置的。
/etc/mailname
mail.domain.kz
Posfix 配置文件:
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
myhostname = mail.domain.kz
mydomain = domain.kz
mydestination = mail.domain.kz, localhost.domain.kz, localhost, vps-***.kz, localhost.vps-***.kz
myorigin = mail.domain.kz
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
smtpd_tls_cert_file = /etc/postfix/certs/postfix.pem
smtpd_tls_key_file = /etc/postfix/certs/private/postfix.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
virtual_uid_maps = static:3000
virtual_gid_maps = static:3000
virtual_minimum_uid = 3000
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_domain_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
virtual_mailbox_base = /home/vmail
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_recipient_restrictions =
reject_unknown_recipient_domain,
permit_mynetworks,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unverified_recipient,
permit
broken_sasl_auth_clients = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
disable_vrfy_command = yes
max_use = 100
mailbox_size_limit = 0
default_process_limit = 100
header_size_limit = 10485760
message_size_limit = 104857600
smtpd_error_sleep_time = 20s
anvil_rate_time_unit = 60s
smtpd_client_connection_count_limit = 100
smtpd_client_connection_rate_limit = 250
smtpd_client_message_rate_limit = 250
maximal_queue_lifetime = 1d
bounce_queue_lifetime = 1d
smtpd_milters = unix:/clamav/clamav-milter.ctl, unix:/spamass/spamass.sock
日志文件中没有写入任何内容,空文件 /var/log/mail.*。Syslog 日志文件也是空的。
可能哪里出错了?
答案1
需要进行 SMTP 身份验证才能成功将电子邮件发送给外部用户。将以下几行添加到您的 main.cf 中:smtpd_recipient_restrictions = smtpd_sasl_auth_enable = yes smtpd_sasl_path = smtpd