RE: Sieve based a day of week

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The first idea that pops into my mind would be to write a cron job and install it into /etc/cron.daily that would simply log into the sieveshell client and activiate/deactivate the appropriate sieve scripts.


Something like:

#!/bin/sh

FLOP_DATE=`date | cut -f 1 -d ' '`

echo "Switching User 1 User 2 rules on/off"

case $FLOP_DATE in
Fri)
    sieveshell -user=User1 <<EOF
<password>
activate script_that_contains_user1_rule
EOF
    sieveshell -user=User2 <<EOF
<password>
deactivate script_that_contains_user2_rule
EOF
  ;;
Mon)
    sieveshell -user=User1 <<EOF
<password>
deactivate script_that_contains_user1_rule
EOF
    sieveshell -user=User2 <<EOF
<password>
activate script_that_contains_user2_rule
EOF
  ;;
*)
    sieveshell -user=User1 <<EOF
<password>
deactivate script_that_contains_user1_rule
EOF
    sieveshell -user=User2 <<EOF
<password>
deactivate script_that_contains_user2_rule
EOF
  ;;
esac


of course this is just off the top of my head, and the script has a major gaping hole of exposing the password. I don't think sieveshell supports any other auth mechanisms so you may need to make a special user and su before running the script.

However, the more important question is if they are going to be regularly off those days, why even bother? In general I discourage our users from even putting OOO messages as most users  have emails on their mobile devices, and can easily direct a co-worker to address any important issues that arise in their absence.




> Date: Wed, 18 Sep 2013 20:20:07 +0200
> From: lists@xxxxxxxx
> To: info-cyrus@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: Sieve based a day of week
>
> Am 13.03.2013 15:04, schrieb André Schild:
> > Hello,
> >
> > we have a customer where they have two persons working each 4 days a week.
> >
> > On friday in the email of User1 there should be a auto answer for friday
> > On Monday in the mail of User2, there should be a auto answer for monday
> >
> > I think this should be possible when RFC 5260 is implemented,
> > but according to this, we don't have it yet.
> >
> > Is there another way I could activate/deactivate the auto answers
> > on day-per-week automatically ?
> >
>
> I also need that ... any answer found yet?
>
> AFAI googled the "date" extension would be able to do that ... but I
> don't have that in my gentoo installation.
>
> Stefan
>
>
>
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux