我正在使用postfix将我的电子邮件从*@myyyrd.fr中继给特定的收件人:
#/etc/aliases aXXXXre: [email protected] aXXe: [email protected] aXXXs: [email protected] vXXXXXt: [email protected] #/etc/reg_aliases /.*/ [email protected]
我想阻止使用我的postfix服务器作为垃圾邮件中继,并阻止服务器发送外发电子邮件给除上述地址列表之外的所有人。
为了清楚起见,发送到[email protected]的电子邮件将被redirect到[email protected],但发送到[email protected]的电子邮件应被拒绝 。
我试过没有成功使用/ etc / postfix / transport和/ etc / postfix / access …
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases, regexp:/etc/reg_aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix 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 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, melard.fr myorigin = melard.fr newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550
首先,postfix的默认configuration应该足以阻止您的服务器作为开放中继使用。 这是由于参数smtpd_relay_restrictions ,它的条件接受所有邮件的意向本地收件人(别名之前),使用sasl进行身份validation或生成localy(默认情况下)。
如果您确实需要更具体地限制,则可以在smtpd_recipient_restrictions使用指令check_recipient_access 。 它允许您使用接受的地址列表configuration一个文件。