Re: [exim] Exim ACLs

Top Page
Delete this message
Reply to this message
Author: Dave Evans
Date:  
To: exim-users
Subject: Re: [exim] Exim ACLs
On Sat, Mar 01, 2008 at 03:49:32PM +0530, Gaurav Pruthi wrote:
> Hi,
>
> I want to create 3 ACL's as per requirement. Though i have created one but
> is not working as per it should.
>
> The Requirement is:
>
> 1). Message body should not be more than 160 characters. Mail should fail in
> case message_body is more than 160 characters.


"deny" using an ACL which reads $message_body_size.
http://www.exim.org/exim-html-current/doc/html/spec_html/ch40.html
http://www.exim.org/exim-html-current/doc/html/spec_html/ch11.html#SECTexpvar

You might also like to use a router which redirects to :fail: with an
appropriate message.

> 2). Special Characters are not allowed in message_body i.e. `,#,+,&
>      I created one ACL but it isn't working i.e.

>
> deny   message        = Restricted characters in the message body
>          domains        = +relay_to_domains
>          condition      =  ${if match{${lc:$message_body}} \
>                         {\N( \`|\#|\+|\&)$\N} \
>                      {yes}{no}}


Firstly, I suggest you negate that - have the condition check that the body
only contains allowable characters. Secondly, your condition will be more
readable if you use [...] in the regex instead of (...|...|...).

For example, something based on:

${if match{$message_body}{\N\A[A-Za-z0-9 ,.-]\z\N} ...}

but you'll probably want to allow more characters than that, and maybe you'll
also want to automatically fold NL/CR/TAB to spaces. In which case, look for
"${sg" in the documentation.

> 3). Sender's local_part should not exceed 10 characters.


And, let me guess, should contain only 0-9 ?
Add something like "local_parts = \N^[0-9]{1,10}$\N" to your router.



All untested. Testing, and fixing my errors, I leave as an exercise for you.

--
Dave Evans
http://djce.org.uk/
http://djce.org.uk/pgpkey