2.11から3.4にアップグレードした後、Postfix Relayアクセスが拒否されました。

2.11から3.4にアップグレードした後、Postfix Relayアクセスが拒否されました。

Postfix バージョン 2.11.3 は過去数年間で完全に機能してきました。バージョン3.4.14にアップグレードした後、サーバーは電子メールを外部に送信できなくなります。

そのファイルにmail.err次の行が見つかりました。

postfix/smtpd[1043]: fatal: in parameter smtpd_relay_restrictions or smtpd_recipient_restrictions, specify at least one working instance of: reject_unauth_destination, defer_unauth_destination, reject, defer, defer_if_permit or check_relay_domains

master.cfその後、2つのパラメータを次のように設定しました。

  -o smtpd_recipient_restrictions=reject_unauth_destination
  -o smtpd_relay_restrictions=reject_unauth_destination

Postfixバージョン2.11では、両方のパラメータがコメントアウトされています。

設定後、メッセージは消えましたが、ファイルに別mail.errのエラーが見つかりました。mail.log

Jun  3 08:01:22 smtp-out postfix/smtpd[19915]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[127.0.0.1]>

これら2つのパラメータを使用していますが、sender_dependent_relayhost_maps = hash:/etc/postfix/transport_sender正しい設定は何ですか(これが問題の場合)。

これは私のmain.cfファイルです:

inet_protocols = ipv4
smtpd_banner = Company ESMTP NO UCE/UBE
biff = no
append_dot_mydomain = no
myhostname = smtp-out.company.com
mydomain = company.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smtp-out.local, localhost.dmz.local.dmz.local, localhost, $mydomain, localhost.$mydomain

relayhost = [mail.external-relayserver.com]

relay_domains =
mynetworks = 192.168.10.0/24, 192.168.15.0/24, 127.0.0.0/8, [::1]/128
header_checks = regexp:/etc/postfix/regexp/header_checks
message_size_limit = 47185920
recipient_delimiter = +

transport_maps = hash:/etc/postfix/transport

undisclosed_recipients_header=
local_recipient_maps =
smtp_tls_security_level=may
smtp_tls_loglevel=1

# relay transport
sender_dependent_relayhost_maps = hash:/etc/postfix/transport_sender
smtp_sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

default_destination_concurrency_limit = 2
default_destination_rate_delay = 1s

master.cf文書:

smtp      inet  n       -       -       -       -       smtpd
  -o smtpd_recipient_restrictions=reject_unauth_destination
  -o smtpd_relay_restrictions=reject_unauth_destination

pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache

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}

ベストアンサー1

postfixサーバーを介して中継できる人を指定する必要があります。今後これreject_unauth_destination

たとえば、自分のネットワークがサーバーを介して中継されるようにするには、次のようにします。

smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination

または sasl_authentication を使用する場合:

smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated,
                           reject_unauth_destination

これらのルールはリストされている順序で指定されているため、上記のルールを使用すると、ネットワーク上のクライアントが認証することなくメールを中継できます。ネットワーク外のクライアントは自分自身を認証する必要があります。他人の中継の試みは拒否されます。


ところで、あなたのような単純なサフィックス構成の場合、これらのオプションmain.cfmaster.cf

おすすめ記事