gnarwl vacation queryfilter with vacationStart and vacationEnd times checked

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.
Wordpress category: 
Wordpress tag: 

Comments

Hi trying to figure out what you used in the gnarwl.cfg file to define time?

gnarwl defines $time itself using the system time...

Which version of gnarwl you use? I can't see anything about $time in the gnarwl 3.6 source.

I have gnarwl 3.3 and $time doesn`t work.
In debug mode I see only vacationStart<=$time etc.

Add new comment

Markdown

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.