Sieve based a day of week

Shawn Bakhtiar shashaness at hotmail.com
Thu Sep 19 13:03:37 EDT 2013


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 at xunil.at
> To: info-cyrus at lists.andrew.cmu.edu
> 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-

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20130919/b11ca8a5/attachment.html 


More information about the Info-cyrus mailing list