Re: [exim] Time based conditionals in ACLs

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Marc Perkel
Date:  
À: Chris Lightfoot
CC: exim-users
Sujet: Re: [exim] Time based conditionals in ACLs


Chris Lightfoot wrote:
> On Mon, Nov 13, 2006 at 09:53:30PM +0000, Stephen Gran wrote:
>
>> On Mon, Nov 13, 2006 at 01:39:47PM -0800, Marc Perkel said:
>>
>>> Is there a way to do a time based conditional in an ACL? Like I want to
>>> do something different for one minute out of every 5?
>>>
>> Yes, use modulo on a time operator.
>>
>
> probably easier to do a regex match on $tod_zulu, for
> instance,
>
>     ${if match{$tod_zulu}{[05]Z\$}{ ... }fail}

>
> or similar.
>
>


Thanks Chris - that works. What I want to do is basically leave message
in the logs of hosts with bad reverse lookup with the hope that they
will fix it. Here's my code.

defer    message = DEFER - Your REVERSE DNS is broken on IP 
$sender_host_address Please FIX IT!
    condition = ${if eq{$sender_host_name}{}}
    condition = ${if match{$tod_zulu}{[05]Z\$}{yes}{no}}



The idea here is I return a temp error 1 in 5 times. Not enough to block
them. But enough to maybe get people's attention when they look at their
logs. Hopefully someone will notice it and fix it.

I recommend that everyone do this and if they did it would improve
things in general.