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 <mailto:havra...@sea.cz>, Web: www.sea.cz <http://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


Reply via email to