On 3/3/2011 7:21 AM, Pascal Volk wrote:
Hello,

I'm trying reject messages for recipients which are over quota or will
be over quota when the current message would be accepted and delivered.
That works fine as long as there is only one recipient.

Now I have the following idea:
        smtpd_recipient_restrictions =
          …
          reject_unauth_destination
          check_policy_service inet:127.0.0.1:12345

        smtpd_end_of_data_restrictions =
          check_policy_service inet:127.0.0.1:12345

In the "RCPT TO" stage the policy_service will create a list with all
recipients of the current message.

Then in the "END-OF-MESSAGE" stage the policy_service will return:
if recipient_count == 1&&  recipient_has_quota_reached:
        action=552 5.2.2 Quota exceeded (mailbox for recipient is full)

OK.

if recipient_count>  1&&  any_recipient_has_quota_reached:
        (do not deliver to recipients which are still under quota)
        action=552 5.2.2 Quota … (mailbox for one or recipients is full)

This will reject mail for everyone on the message if anyone is over quota. Seems like poor service for the clients.


else:
        action=dunno

OK.


Would this be correct? Are there any other/better (recommended) procedures?


Better to find some way to reject over quota recipients during smtpd_recipient_restrictions. Maybe have the IMAP system update a table that postfix can query.


  -- Noel Jones

Reply via email to