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

Reply via email to