Postfixで「554」番のエラーが出ている場合

Vine-2.5でpostfix-0.0.20010228pl08-0vl3を使っていると設定の仕方で
別とプロバイダーからのメールを拒絶することがあります。

サーバには下記のようなメッセージが残っていたらこの設定をお勧めします。
Jul 9 00:00:00 smtp postfix/smtpd[19734]: reject: RCPT from 送信先メールサーバ
[999.999.999.999]: 554 <受信者>: Recipient address rejected: Relay access
denied; from=<送信者> to=<受信者>
受信者名が正しいのに拒否してしまうパターンです。

メールサーバから下記のようなメールが来ても同じ症状です。
[a]Q-mailの場合
Hi. This is the qmail-send program at smb504.nifty.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<hogehoge@mail.server>:
888.888.888.888 does not like recipient.
Remote host said: 554 <hogehoge@mail.server>: Recipient address rejected: Relay access denied
Giving up on 888.888.888.888.

--- Below this line is a copy of the message.
以下省略

[b]postfixの場合
This is the Postfix program at host svan17.sannet.ne.jp.

I'm sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

For further assistance, please send mail to 

If you do so, please include this problem report. You can
delete your own text from the message returned below.

The Postfix program

<hogehoge@mail.server>: host smtp.mail.server[888.888.888.888] said: 554
    <hogehoge@mail.server>: Recipient address rejected: Relay access denied

<<<解決方法>>> Vine Linux 2.5には標準でPostfixのPRMが付いています。インストールした後、
通常の設定を行うのはもちろんですが、下記の行を修正してください。

allow_percent_hack = no

allow_percent_hack = yes

noになっていると不正中継サイトを使ったテストをしてもきちんと中継禁止となるのですが、
結局「中継不可」ということですべてのメールを不可にしてしまう状況が生まれます。
allow_percent_hackをyesにするとこれが回避できます。
この行を入れてもだめな場合は、 swap_bangpath = yes を一行追加してください。

おまけ
どのサイトで見たか不明になったのでリンクはつけられないのですが、正規表現を使い、
不正コードを使ったメールを排除する方法がありましたので付け加えておきます。

smtpd_recipient_restrictions= regexp:/etc/postfix/recipient_checks permit_mynetworks,
check_relay_domains
notify_classes = resource,software,policy
として、 /etc/postfixにrecipient_checksというファイル名で下記の内容を入力します。
内容
/[@!%].*[@!%]/ 550 Please use user@domain address forms only.


Let's PC の Topに戻る
ホームページのTopに戻る