Re: [Exim] help with configuration [FUN|OT]

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Nico Erfurth
Data:  
Para: gul
CC: exim-users
Tópicos Antigos: Re: [Exim] help with configuration
Assunto: Re: [Exim] help with configuration [FUN|OT]
Pavel Gulchouck wrote:

> ;-)
> Here's a solution of this issue.
> MB it can be helpful not only for me.
> I hope there is more simple solution, but this looks like working... ;)
>


[... VERY sick recursive ACL ...]

Ok, this IS OT, but maybe interesting, after reading Pavels ACL, and
seeing that he used recursion, I just had to try it....

99bottles (http://99-bottles-of-beer.ls-la.net/) with exim-acls!
Well, it works, but exim can't handle string longer than 8192 chars :-/
So I've reduced it to 33 bottles ;)

# Warning, the following text may toast your brain, I'm not responsible
# for eye cancer nor any other possible effect.
#
# acl_bottles_of_beer is the entry-point, we need to use embedded
# recursive functions, because exim limits the number of nested ACLs
# $acl_m0 holds the current amount of bottles
# $acl_m1 holds the left count of recursions for acl_bob_recurse1
# $acl_m2 holds the left count of recursions for acl_bob_recurse2
# $acl_m9 holds the current string
acl_bottles_of_beer:
   deny   set acl_m0 = 33
          set acl_m1 = 4
          message    = ${acl_m9}One bottle of beer on the wall.\n\
                       One bottle of beer.\n\
                       Take one down, pass it around, \
                       no more bottles of beer on the wall.\n
          acl = acl_bob_recurse1


acl_bob_recurse1:
   accept set acl_m1 = ${eval:$acl_m1 - 1}
          set acl_m2 = 10
          acl        = acl_bob_recurse2
          condition  = $acl_m1
          acl        = acl_bob_recurse1
   accept


acl_bob_recurse2:
   accept set acl_m2 = ${eval:$acl_m2 - 1}
          set acl_m9 = $acl_m9$acl_m0 bottles of beer on the wall.\n\
                       $acl_m0 bottles of beer.\n\
                       Take one down, pass it around.\n
          set acl_m0 = ${eval:$acl_m0 - 1}
          condition  = ${eval:$acl_m0 - 1}
          condition  = $acl_m2
          acl        = acl_bob_recurse2
   accept



Ok, back to REAL work now.

Nico

P.S.: This source is GPLed, so use it to send your favourite spammer a
nice message.... ;)
.oO(33 spammers on the wall, ....)


--
"I find this a nice feature but it is not according to the documentation.
    Or is it a BUG?"
"Let's call it an accidental feature. :-)" Larry Wall in
<6909@???>