Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-27 Thread havra...@sea.cz

We use our own solution to set vacation auto-reply in SOGo.
It is written as web form and do everything automatically.

S pozdravem

*Ing. Zdeněk Havránek*
vedoucí střediska automatizace a IT

*SEA - Chomutov, s.r.o.*
Tel.:+420 474 624 048, Mobil: +420 777 717 303
E-mail: havra...@sea.cz , Web: www.sea.cz 



Dne 27.05.2021 v 15:34 Pierre Fumet (p...@zdn.fr) napsal(a):

Thks for sharing,
but this solution is not convenient for a production environnement, 
nor it is possible if you want users to manage their own auto-reply - 
what you definitly want as an adminsys !


On 27 May 2021 at 11:12, from Ing. Zdeněk Havránek, HAF :
Hi, We use our own solution to set vacation auto-reply in SOGo. You 
can use the same every day with cron.


We set vacation directly in database:

SOGo has settings in one string (attribute c_defaults). We read this 
string to variable $json, change this sting and then update in 
database. Format of this string is 'easy' readable: '{...,"Vacation": 
{...},...}'


    public function getDataFromSogo($mail) {
    return $this->sogodb->query("SELECT c_defaults FROM 
sogo_user_profile WHERE c_uid = %s",$mail)->fetch();

    }

    public function updateDataInSogo($mail,$json) {
    return $this->sogodb->query("UPDATE sogo_user_profile SET 
c_defaults = %s WHERE c_uid = %s",$json,$mail)->fetch();

    }

Immediately after changes in database:

  systemctl force-reload memcached
  /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.cred
   >/dev/null 2>&1

sogo-tool update-autoreply is called periodically at midnight by cron 
also. It is used to autoreply swith on/off.


S pozdravem


--
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-27 Thread Pierre Fumet

Thks for sharing,
but this solution is not convenient for a production environnement, nor it is 
possible if you want users to manage their own auto-reply - what you definitly 
want as an adminsys !

On 27 May 2021 at 11:12, from Ing. Zdeněk Havránek, HAF :
Hi, We use our own solution to set vacation auto-reply in SOGo. You 
can use the same every day with cron.


We set vacation directly in database:

SOGo has settings in one string (attribute c_defaults). We read this 
string to variable $json, change this sting and then update in 
database. Format of this string is 'easy' readable: '{...,"Vacation": 
{...},...}'


    public function getDataFromSogo($mail) {
    return $this->sogodb->query("SELECT c_defaults FROM 
sogo_user_profile WHERE c_uid = %s",$mail)->fetch();

    }

    public function updateDataInSogo($mail,$json) {
    return $this->sogodb->query("UPDATE sogo_user_profile SET 
c_defaults = %s WHERE c_uid = %s",$json,$mail)->fetch();

    }

Immediately after changes in database:

  systemctl force-reload memcached
  /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.cred
   >/dev/null 2>&1

sogo-tool update-autoreply is called periodically at midnight by cron 
also. It is used to autoreply swith on/off.


S pozdravem

--
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-27 Thread havra...@sea.cz
Hi, We use our own solution to set vacation auto-reply in SOGo. You can 
use the same every day with cron.


We set vacation directly in database:

SOGo has settings in one string (attribute c_defaults). We read this 
string to variable $json, change this sting and then update in database. 
Format of this string is 'easy' readable: '{...,"Vacation": {...},...}'


    public function getDataFromSogo($mail) {
    return $this->sogodb->query("SELECT c_defaults FROM 
sogo_user_profile WHERE c_uid = %s",$mail)->fetch();

    }

    public function updateDataInSogo($mail,$json) {
    return $this->sogodb->query("UPDATE sogo_user_profile SET 
c_defaults = %s WHERE c_uid = %s",$json,$mail)->fetch();

    }

Immediately after changes in database:

   systemctl force-reload memcached
   /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.cred
>/dev/null 2>&1

sogo-tool update-autoreply is called periodically at midnight by cron 
also. It is used to autoreply swith on/off.


S pozdravem

*Ing. Zdeněk Havránek*
vedoucí střediska automatizace a IT

*SEA - Chomutov, s.r.o.*
Tel.:+420 474 624 048, Mobil: +420 777 717 303
E-mail: havra...@sea.cz , Web: www.sea.cz 



Dne 21.05.2021 v 7:18 "J. Echter" (j.ech...@echter-kuechen-elektro.de) 
napsal(a):
I thought it only gets overriden if you enter mail options and click 
save, what you wouldn't do if you not there, so it should survive the 
off day at least.


Am 20. Mai 2021 18:19:14 MESZ schrieb Pierre Fumet :

Thanks for your proposal,
but that's not appropriate IMHO :
- SOGo does not manage sieve via sogo.sieve file but in DB, so changes 
would be overrided soon
- I'm looking for (the possibility of) a clean (eg. managed by SOGo) way of 
implementing this feature

On 20 May 2021 at 16:59, from Jürgen Echter :

Hi, maybe you can write a small bash script and run it with
cron. #!/bin/bash DAYOFWEEK=$(date +"%u") if [[ ($DAYOFWEEK
-eq 3) ]]; then grep -qsxF '{ vacation :days 1 :addresses
["your@mail.address"] text: I'm out of office.; }'
/path/to/your/sieve/sogo.sieve || printf "{ vacation :days 1
:addresses ["your@mail.address"] text: I'm out of office.; }"
>> /path/to/your/sieve/sogo.sieve elif sed -i '{ vacation
:days 1 :addresses ["your@mail.address"] text: I'm out of
office.; }/d' /path/to/your/sieve/sogo.sieve fi untested :)
Juergen Am Donnerstag, Mai 20, 2021 10:31 CEST, "Pierre Fumet"
(p...@zdn.fr)  schrieb:  Hi all, SOGo webmail can
activate vacation auto-reply and schedule beginning and end
for this activation. But would it be possible to schedule
auto-reply only one day each week, eg. on wednesday ? 



--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
--
users@sogo.nu
https://inverse.ca/sogo/lists


--
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-21 Thread "J. Echter"
I thought it only gets overriden if you enter mail options and click save, what 
you wouldn't do if you not there, so it should survive the off day at least.

Am 20. Mai 2021 18:19:14 MESZ schrieb Pierre Fumet :
>Thanks for your proposal,
>but that's not appropriate IMHO :
>- SOGo does not manage sieve via sogo.sieve file but in DB, so changes
>would be overrided soon
>- I'm looking for (the possibility of) a clean (eg. managed by SOGo)
>way of implementing this feature
>
>On 20 May 2021 at 16:59, from Jürgen Echter :
>>
>>Hi,
>>
>>maybe you can write a small bash script and run it with cron.
>>
>>#!/bin/bash
>>
>>DAYOFWEEK=$(date +"%u")
>>
>>if [[ ($DAYOFWEEK -eq 3) ]]; then
>>grep -qsxF '{ vacation :days 1 :addresses ["your@mail.address"] text:
>I'm out of office.; }' /path/to/your/sieve/sogo.sieve || printf "{
>vacation :days 1 :addresses ["your@mail.address"] text: I'm out of
>office.; }" >> /path/to/your/sieve/sogo.sieve
>>
>>elif
>>sed -i '{ vacation :days 1 :addresses ["your@mail.address"] text: I'm
>out of office.; }/d' /path/to/your/sieve/sogo.sieve
>>
>>fi
>>
>>untested :)
>>
>>Juergen
>>
>>Am Donnerstag, Mai 20, 2021 10:31 CEST, "Pierre Fumet" (p...@zdn.fr)
> schrieb:
>> Hi all,
>>
>>SOGo webmail can activate vacation auto-reply and schedule beginning
>and end for this activation.
>>
>>But would it be possible to schedule auto-reply only one day each
>week, eg. on wednesday ?
>
>-- 
>Pierre Fumet
>-- 
>users@sogo.nu
>https://inverse.ca/sogo/lists

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-20 Thread Pierre Fumet

Thanks for your proposal,
but that's not appropriate IMHO :
- SOGo does not manage sieve via sogo.sieve file but in DB, so changes would be 
overrided soon
- I'm looking for (the possibility of) a clean (eg. managed by SOGo) way of 
implementing this feature

On 20 May 2021 at 16:59, from Jürgen Echter :


Hi,

maybe you can write a small bash script and run it with cron.

#!/bin/bash

DAYOFWEEK=$(date +"%u")

if [[ ($DAYOFWEEK -eq 3) ]]; then
grep -qsxF '{ vacation :days 1 :addresses ["your@mail.address"] text: I'm out of office.; }' 
/path/to/your/sieve/sogo.sieve || printf "{ vacation :days 1 :addresses ["your@mail.address"] text: 
I'm out of office.; }" >> /path/to/your/sieve/sogo.sieve

elif
sed -i '{ vacation :days 1 :addresses ["your@mail.address"] text: I'm out of 
office.; }/d' /path/to/your/sieve/sogo.sieve

fi

untested :)

Juergen

Am Donnerstag, Mai 20, 2021 10:31 CEST, "Pierre Fumet" (p...@zdn.fr) 
 schrieb:
 Hi all,

SOGo webmail can activate vacation auto-reply and schedule beginning and end 
for this activation.

But would it be possible to schedule auto-reply only one day each week, eg. on 
wednesday ?


--
Pierre Fumet
--
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Vacation auto-reply only one day per week ?

2021-05-20 Thread j.ech...@echter-kuechen-elektro.de

Hi,

maybe you can write a small bash script and run it with cron.

#!/bin/bash

DAYOFWEEK=$(date +"%u")

if [[ ($DAYOFWEEK -eq 3) ]]; then
grep -qsxF '{ vacation :days 1 :addresses ["your@mail.address"] text: I'm out 
of office.; }' /path/to/your/sieve/sogo.sieve || printf "{ vacation :days 1 
:addresses ["your@mail.address"] text: I'm out of office.; }" >> 
/path/to/your/sieve/sogo.sieve

elif
sed -i '{ vacation :days 1 :addresses ["your@mail.address"] text: I'm out of 
office.; }/d' /path/to/your/sieve/sogo.sieve

fi

untested :)

Juergen

Am Donnerstag, Mai 20, 2021 10:31 CEST, "Pierre Fumet" (p...@zdn.fr) 
 schrieb:
 Hi all,

SOGo webmail can activate vacation auto-reply and schedule beginning and end 
for this activation.

But would it be possible to schedule auto-reply only one day each week, eg. on 
wednesday ?

Cheers,

--
Pierre Fumet
--
users@sogo.nu
https://inverse.ca/sogo/lists


--
Mit freundlichen GrÃŒssen
JÃŒrgen EchterECHTER KÃŒchen & Elektro GmbH
Augsburger Str. 49

86529 Schrobenhausen

Tel: 08252 / 8976 - 0
Fax: 08252 / 8976 - 10
e-mail: i...@echter-kuechen-elektro.de
web: www.echter-kuechen-elektro.deReg.-Gericht: Ingolstadt Nr. HR B 101907

Ust.-Id. Nr.: DE234419866

Steuernummer: 124/125/51166

GeschÀftsfÌhrer: Thomas Echter
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

[SOGo] Vacation auto-reply only one day per week ?

2021-05-20 Thread Pierre Fumet

Hi all,

SOGo webmail can activate vacation auto-reply and schedule beginning and end 
for this activation.

But would it be possible to schedule auto-reply only one day each week, eg. on 
wednesday ?

Cheers,

--
Pierre Fumet
--
users@sogo.nu
https://inverse.ca/sogo/lists