We are using gnarwl for vacation notification and I would like gnarwl to only reply if the current time is in the vacationStart vacationEnd window.
Here is the queryfilter to do that using the following information:
<br /> $recepient - receiver of the message<br /> $time - current time in seconds since the epoch<br /> vacationActive - attribute for start time of the vacation in seconds since the epoch<br /> vacationEnd - attribute for end time of the vacation in seconds since the epoch<br /> mail<br /> mailAlternateAddress - attribute for email address of an account<br />
queryfilter
queryfilter (&(|(mail=$recepient@*)(mailAlternateAddress=$recepient@*))(vacationActive=TRUE)(|(!(vacationStart=*))(&(vacationStart<=$time)(vacationEnd>=$time))))
Broken down this does the following:
(&
(|
(mail=$recepient@*)
(mailAlternateAddress=$recepient@*)
)
(vacationActive=TRUE)
(|
(!(vacationStart=*))
(&
(vacationStart<=$time)
(vacationEnd>=$time)
)
)
)
There's a few things going on here.
Check that all these conditions are met (that is the outer and (&).
- Match either mail or mailAternateAddress on the recepient address
- Make sure vacationActive is TRUE
- Check that either vacationStart is not present or
- vacationStart is less than the current time and
- vacationEnd is greater than the current time.
Comments
time var in gnarl.cfg
$time
$time
Add new comment