我正在尝试限制谁可以在服务器上发送电子邮件。我在 main.cf 中使用了此指令:
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
/etc/mailname 的内容为:
cassiopeia.caoba.fr
/etc/postfix/sender_access 的内容为:
[email protected] REJECT
当然,哈希文件是使用以下命令创建的:
sudo postmap /etc/postfix/sender_access
然后使用以下命令重新启动 Postfix:
sudo /etc/init.d/postfix restart
不过,santiago 仍然可以正常发送电子邮件。例如:
echo $RANDOM | mail -s "Test" [email protected]
我的 main.cf 文件是:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
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
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtp_generic_maps = pcre:/etc/postfix/generic
myorigin = /etc/mailname
mydestination = localhost localhost.$mydomain $myhostname
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_mechanism_filter =
smtp_sasl_security_options =
relayhost = mail.authsmtp.com:2525
smtp_tls_security_level = encrypt
smtp_tls_mandatory_ciphers = high
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 = ipv4
内容
答案1
mail
不使用SMTP
协议,因此smtpd_sender_restrictions
不适用。