Postfix:如何拒绝传出不存在的地址和不属于用户的地址?
- 案例A:([电子邮件受保护]) 登录 Roundcube,然后使用不存在的域名创建别名。然后用这个来发送。已经发送成功了。所以我在这个网站上搜索并找到了一个解决方案,它很有帮助。
- 情况 B: ([电子邮件受保护]) 登录 Roundcube,然后使用不存在的用户名创建别名。然后用这个来发送。它发送而不会被拒绝。
- 案例 C:一个大问题:([电子邮件受保护]) 登录 Roundcube 然后使用任何用户名创建一个别名,并使用位于同一台计算机上的现有虚拟 @domain(不属于登录用户)。然后发送一封电子邮件。有用....
我该如何解决案例 B,尤其是案例 C?
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
delay_warning_time = 4
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20480000
milter_default_action = accept
mydestination = localhost.$mydomain, localhost
mydomain = domain(*censored*).com
myhostname = domain(*censored*).com
mynetworks = 127.0.0.1, VPS-IP (*censored*)
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES
recipient_delimiter = +
relay_domains = proxy:mysql:/etc/path(*censored*)/configs/postfix/mysql-relay_domains_maps.cf
sample_directory = /usr/share/doc/postfix-2.2.2/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_milters = inet:127.0.0.1:8891
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain
smtpd_tls_cert_file = /etc/letsencrypt/live/domain(*censored*).com/fullchain.pem
smtpd_tls_ciphers = high
smtpd_tls_key_file = /etc/letsencrypt/live/domain(*censored*).com/privkey.pem
smtpd_tls_loglevel = 2
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/path(*censored*)/configs/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/path(*censored*)/configs/postfix/virtual_regexp
virtual_gid_maps = static:12
virtual_mailbox_base = /var/path(*censored*)/vmail
virtual_mailbox_domains = proxy:mysql:/etc/path(*censored*)/configs/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/path(*censored*)/configs/postfix/mysql-virtual_mailbox_maps.cf
virtual_minimum_uid = 997
virtual_transport = dovecot
virtual_uid_maps = static:997
一些值是审查的。
答案1
嗯...作为专门针对 Roundcube 的一个小(解决方法),我也看到在主要的大型域名提供商及其 Roundcube 客户端上所做的就是禁用添加别名的功能。因此无法在 roundcube 上发送带有自定义地址的电子邮件。
通过将其添加到 Roundcube 配置中:$config['identities_level'] = 4;
// 0 - many identities with possibility to edit all params
// 1 - many identities with possibility to edit all params but not email address
// 2 - one identity with possibility to edit all params
// 3 - one identity with possibility to edit all params but not email address
// 4 - one identity with possibility to edit only signature
Source: https://forum.iredmail.org/topic10975-iredmail-support-how-to-disable-the-possibility-to-change-sender-identity-in-roundcube.html