虽然我已经找到了二 答案,但我无法确定如何实际实现它们,其中至少有一个没有真正回答这个问题。所以,如果有人有什么经验可以分享的话,我将非常感激。
我有一个服务器(Ubuntu18.04)运行Postfix。我已经限制了使用postfwd的SASL发送者,以及使用Amavis从本地机器/网络(例如从web服务器)扫描发送出去的邮件。这一切都很好,在main.cf中如下所示:
smtpd_sender_restrictions =
check_client_access cidr:/etc/postfix/internal_clients_filter,
permit_mynetworks,
reject_unknown_sender_domain在master.cf中
senderCheck unix - n n - 15 spawn
user=nobody argv=/opt/policyd/src/policyd.pl max_idle=30 max_use=50 daemon_timeout=50
127.0.0.1:10025 inet n - n - - smtpd
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_data_restrictions=
-o smtpd_end_of_data_restrictions=
-o local_header_rewrite_clients=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o smtpd_milters=
-o local_recipient_maps=
-o relay_recipient_maps=
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings如何通过垃圾邮件和恶意软件扫描SASL发件人(根据定义他们不在我的网络上),就像我为本地发件人做的一样?
发布于 2021-01-12 08:07:02
对此的回答有点尴尬,那就是SASL-auth用户被过滤了。但是,我没有在syslog_name中为smtpd侦听器指定一个master.cf,所以我没有看到在所有噪声中都起作用的证据(SASL发送者可能占日志中所有流量的1% )。
因此,在忏悔,以下是一个完整的描述,我现在略有修改的配置,这是通过发送出去的邮件(如本地网络上的网络应用程序)和SASL认证的帐户发送邮件从任意外部网络通过我们的邮件服务器。
对库存包使用Ubuntu 18.04,除非另有说明:
首先,我需要将clamav用户添加到与amavis相同的组中:
$ id clamav
uid=115(clamav) gid=115(clamav) groups=115(clamav),126(amavis)对/etc/amavis/conf.d文件的更改:
<#>05-域_id
@local_domains_acl = ( ".$mydomain" );
# I've got multiple IP addresses on my machine and only want one to be used for mail:
@inet_acl = qw(127.0.0.1 [::1] 185.73.x.x [2001:ba8:0:x::x]); 15-content_filter_mode:启用垃圾邮件和反病毒检查
20-debian_defaults:设置和创建隔离目录(属于amavis user+group),并将final_spam_destiny设置为D_DISCARD
40-政策性银行:
$interface_policy{'10024'} = 'INTERNAL';
$policy_bank{'INTERNAL'} = { # mail originating from clients in cidr:/etc/postfix/internal_clients_filter
bypass_spam_checks_maps => [0], # spam-check outgoing mail
bypass_banned_checks_maps => [0], # banned-check outgoing mail
bypass_header_checks_maps => [0], # header-check outgoing mail
forward_method => 'smtp:[127.0.0.1]:10025', # relay to Postfix listener on port 10025
};In后缀main.cf:
smtpd_sender_restrictions =
check_client_access cidr:/etc/postfix/internal_clients_filter,
permit_mynetworks,
reject_unknown_sender_domain/etc/后缀/内部_client_filter:
0.0.0.0/0 FILTER smtp:127.0.0.1:10024
::/0 FILTER smtp:[::1]:10024In master.cf.
127.0.0.1:10025 inet n - n - - smtpd
-o syslog_name=amavis-reentry
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_data_restrictions=
-o smtpd_end_of_data_restrictions=
-o local_header_rewrite_clients=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o smtpd_milters=
-o local_recipient_maps=
-o relay_recipient_maps=
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings重新加载amavis和postfix以获得新的信任。在日志中查找"amavis-reentry“,您应该会看到过滤的结果。
https://serverfault.com/questions/1048500
复制相似问题