如何避免 Postfix 向同一域的用户发送未经身份验证的电子邮件

如何避免 Postfix 向同一域的用户发送未经身份验证的电子邮件

希望你能帮助我。

我刚刚安装了 postfix,正在尝试配置以避免垃圾邮件。我安装的版本是3.4.14

我正在尝试配置 posfix 以实现以下行为:从外部发件人外部收件人, 必须是拒绝,我的结果是拒绝配置似乎没问题

外部发件人内部收件人, 必须是公认,我的结果是公认配置似乎没问题

内部发件人(未经身份验证)外部收件人, 必须是拒绝,我的结果是拒绝配置似乎没问题

内部发件人(未经身份验证)内部同一服务器域收件人, 必须是拒绝,我的结果是公认配置似乎错误的我不明白为什么

内部发件人(已验证)外部收件人, 必须是公认,我的结果是公认配置似乎没问题,通过发送电子邮件到 Gmail 进行验证,它被正常接收,并在我的 postfix 收件箱中正确回复和接收。

内部发件人(已验证)内部同一服务器域收件人, 必须是公认,我的结果是公认配置似乎没问题。

这是我按照指南通过 mysql 安装和配置虚拟用户的方法 https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin

我已经多次阅读有关 smtpd_recipient_restrictons 和 smtpd_sender_restruction 的内容,并尝试了它们的多种组合,但均未成功

此部分日志包含 Postfix 上配置的错误行为,应被拒绝并且不正常:

dummyserver@dummy:~$ telnet email.subdom.learning.com 25
Trying 177.138.109.12...
Connected to email.subdom.learning.com.
Escape character is '^]'.
220 email.subdom.learning.com ESMTP Postfix (Debian/GNU)
ehlo telnet.subdom.learning.com
250-email.subdom.learning.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
MAIL FROM: <[email protected]>
250 2.1.0 Ok
RCPT TO: <[email protected]>
250 2.1.5 Ok
quit
221 2.0.0 Bye

欢迎您提供任何帮助

这是我的 main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_auth_only = No 
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = 
        permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated
myhostname = email.subdom.learning.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost = 
mynetworks = 192.168.0.0/24 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf

这是我的 master.cf

smtp      inet  n       -       y       -       -       smtpd
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=may
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
        -o syslog_name=postfix/$service_name
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
postlog   unix-dgram n  -       n       -       1       postlogd
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

相关内容