Re: [exim] Limit No. of recipients in email client

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Jan Ingvoldstad
Fecha:  
A: exim users
Asunto: Re: [exim] Limit No. of recipients in email client
On Mon, May 14, 2012 at 12:40 PM, Muhammad Irfan <mirfan1981@???>wrote:

> Hello,
>


Hello!


>
> I have couple of requirements.
>
> 1- I need to restrict no. of recipients in email client
> (outlook/thunderbird). Let say a user can't send email if he has no. of
> recipients greater than 100 regardless in To, CC, BCC.
>


This is default behaviour in exim, you do not need to change anything.



> Also. Sender should get an bouce back with customized message.
>


That is not advisable. When a client connects via SMTP, the error should
happen in SMTP time, not as a separate error email.

The client will, if properly made, display the error from the webserver.

If you wish to increase the limit above the default 100, see the
documentation for max_rcpt in
http://www.exim.org/exim-html-current/doc/html/spec_html/ch30.html


>
> 2- I need to block sender email address temporarily if no. of emails sent
> from his email address on specific threshold per hour. And sender email
> address should get an customized bounce back message. e.g. No user can send
> emails if 50 mails/hour send already from his account.
>


This is called rate limiting, and is handled by acl_check_rcpt. I advise
logging the current rate regardless, here is a configuration example for
authenticated users, which also ensures that the email client receives a
somewhat understandable error message. The rate limit is per
authenticated_id, that is, per login, not necessarily per sender address.


# Begin example

acl_check_rcpt:

  warn ratelimit = 0 / 1h / strict
       logwrite = :main: \
                  Rate: $sender_rate/$sender_rate_period \
                  $message_id \
                  $sender_address ($sender_host_name[$sender_host_address])
\
                   -> $local_part@$domain


  deny authenticated = *
       ratelimit = 50 / 1h / strict / ${authenticated_id}_hourly
       message = Sending rate exceeded, $sender_rate/$sender_rate_period \
                 (max $sender_rate_limit/$sender_rate_period)
       logwrite = :main,reject: \
                  Rate exceeded:  $sender_rate/$sender_rate_period \
                  (max $sender_rate_limit) $message_id \
                  $sender_address ($sender_host_name[$sender_host_address])
\
                   -> $local_part@$domain


   accept
    hosts = :
    control = dkim_disable_verify


  .ifdef CHECK_RCPT_LOCAL_LOCALPARTS
  deny
    domains = +local_domains
    local_parts = CHECK_RCPT_LOCAL_LOCALPARTS
    message = restricted characters in address
  .endif


# End example

--
Jan