Noel Jones wrote:
On 3/18/2010 10:41 AM, Alex wrote:
Hi All

My problem is describe here
http://www.mail-archive.com/postfix-users@postfix.org/msg16775.html

Basically I have a mysql table with thousands recipients , on the left
hand I have recipient and on the right hand I have the action (REJECT)
and some additional text

u...@domain.tld REJECT Additional text

In case of am multi-recipient message, if I use check_recipient_access
and one of recipients is found in that table, the all message is
rejected and affects all recipients of the message.

No, that's not how postfix works. Only the "current" recipient is rejected. Every other recipient gets their own chance to be accepted or rejected.

If postfix does not behave this way for you, then you've misconfigured something. Feel free to follow these directions to ask for help:
http://www.postfix.org/DEBUG_README.html#mail


 From docs I understand that if I want to treat different every
recipient ,I have two solutions :

You're reading a different part of the docs that does not apply to smtpd_recipient_restrictions, or an action other than REJECT.


  -- Noel Jones
Hi

Thank you for you answer but I can't figure what is wrong. I review my config and make more tests. The relevant part is that :

1. if I use telnet , connect to the server

Mail From:<t...@mydomain.tld>
RCPT TO:<recipient1>
250 2.1.5 Ok
RCPT TO:<recipient2> #listed recipient
554 5.7.1 <recipient2>: Recipient address rejected: some text
DATA
354 End data with <CR><LF>.<CR><LF>
test
.
250 2.0.0 Ok: queued as A532D67CC4B

The message is delivered to the first recipient (correct and described behavior) I have put the server in verbose mode and do the same test but with thunderbird and a webmail client.

...............
postfix/smtpd[5652]: send attr protocol_state = RCPT
postfix/smtpd[5652]: < unknown[myip]: RCPT TO:<recipient1>
postfix/smtpd[5652]: dict_proxy_lookup: table=mysql:/etc/postfix/mysql-recipient.cf flags=lock|fold
_fix key=recipient1 -> status=1 result=
..................
postfix/smtpd[5652]: send attr protocol_state = RCPT
postfix/smtpd[5652]: < unknown[myip]: RCPT TO:<recipient2>
postfix/smtpd[5652]: dict_proxy_lookup: table=mysql:/etc/postfix/mysql-recipient.cf flags=lock|fold
_fix key=recipient2-> status=0 result=REJECT
postfix/smtpd[5652]: check_table_result: proxy:mysql:/etc/postfix/mysql-recipient.cf REJECT postfix/smtpd[5652]: 9BA3467CC45: reject: RCPT from unknown[myip]: 554 5.7.1 <recipient2>: text from=<myaddress> to=<recipeint2> proto=ESMTP helo=<localhost.localdomain>
postfix/smtpd[5652]: generic_checks: name=check_recipient_access status=2
postfix/smtpd[5652]: > unknown[myip]: 554 5.7.1 <recipient2>: Recipient address rejected: text


Both recipients are evaluated , the second gets rejected but no message is delivered (to the first recipient)

My relevant configs are:

smtpd_recipient_restrictions =
        check_recipient_access proxy:mysql:/etc/postfix/mysql-recipient.cf,
................
        permit_mynetworks, permit_sasl_authenticated,
....................
        permit


Viktor also wrote :
"From false premises (the above is not true), you get false conclusions.
Postfix rejects just the recipient in question. If the sending SMTP
client fails to process the rejection of a single recipient out of many
correctly, then this client is the problem. Generally, only MUAs and other
"submission" SMTP talkers have such issues. If you are an MSA for poorly"

Alex

Reply via email to