Re: [Exim] dated addresses (ACL version)

Pàgina inicial
Delete this message
Reply to this message
Autor: Kirill Miazine
Data:  
A: Kevin Reed
CC: exim-users
Assumpte: Re: [Exim] dated addresses (ACL version)
* Kirill Miazine [2003-12-25 12:59]:
> ACL version, more features!

[..]
> ACLs (modify domains to suit your needs):
>
> === start ACL ===

[...]
> === end ACL ===


Uh-oh. The original ACL contained had a bug. In short, I forgot that
$acl_m[0-9] are only reset after MAIL, DATA and RSET. New version:

=== start ACL ===
accept domains = +local_domains
       local_parts = ^.+-(exp|dated)-0*(\\d{4,12})\$
       verify = recipient
       set acl_m0 = ${if match{$tod_log}{^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)}\
                      {y=$1 m=$1$2 d=$1$2$3}{}}
       set acl_m1 = ${if match{$local_part}{-(exp|dated)-0*(\\d\{4,12\})\$}\
                      {$2}{}}
       set acl_m2 = ${strlen:$acl_m1}
       set acl_m3 = ${if =={$acl_m2}{4}\
                      {${if <{$acl_m1}{${extract{y}{$acl_m0}}}{no}{yes}}}\
                      {${if =={$acl_m2}{6}\
                         {${if <{$acl_m1}{${extract{m}{$acl_m0}}}{no}{yes}}}\
                         {${if =={$acl_m2}{8}\
                            {${if <{$acl_m1}{${extract{d}{$acl_m0}}}{no}{yes}}}\
                            {${if <{$acl_m1}{$tod_epoch}{no}{yes}}}\
                           }\
                         }\
                        }\
                      }\
                     }
       endpass
       message = Invalid/expired address
       condition = ${if eq{$acl_m3}{yes}{yes}{no}}
=== end ACL ===


--
Kirill Miazine
mailto:km@krot.org
http://km.krot.org/