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:

<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.

About the Author...

Slides from LISA 2019 Linux systems troubleshooting #LISA2019 https://t.co/D4dMKflK6R Tue Oct 29 05:59:30 +0000 2019

https://t.co/AGeihMALAv configuring grub2 with EFI Fri Sep 13 05:20:01 +0000 2019

I published a Thing on @thingiverse! https://t.co/IYpRyEb7Hz #thingalert Tue Jul 23 19:27:57 +0000 2019

Nokogiri install on MacOSX https://t.co/v3An0miW9L Fri Jul 12 15:06:49 +0000 2019

HTML email with plain mailer plugin on Jenkins https://t.co/Z6FSDMDjy8 Thu Jul 11 21:07:25 +0000 2019