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:
$recepient - receiver of the message
$time - current time in seconds since the epoch
vacationActive - attribute for start time of the vacation in seconds since the epoch
vacationEnd - attribute for end time of the vacation in seconds since the epoch
mail
mailAlternateAddress - attribute for email address of an account
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.