Skip to content

Commit

Permalink
fix(Tinebase/EmailUser): make backup work for multi-instance destinat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
pschuele committed Nov 27, 2024
1 parent 457c953 commit 167081e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tine20/Tinebase/EmailUser/Smtp/Postfix.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,14 @@ public function backup($option)
exec($cmd, $output);
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . 'backexecoutput ' . print_r($output, true));

//smtp_destinations (select all rows belonging to users that belong to our installation)
$where = "userid IN (SELECT userid FROM ". $this->_userTable . " WHERE client_idnr='" . $clientId . "')";
// smtp_destinations (select all rows belonging to users that belong to our installation)
if ($this instanceof Tinebase_EmailUser_Smtp_PostfixMultiInstance) {
// TODO make this configurable / put into member var
$where = "users_id IN (SELECT id FROM ". $this->_userTable . " WHERE client_idnr='" . $clientId . "')";
} else {
$where = "userid IN (SELECT userid FROM ". $this->_userTable . " WHERE client_idnr='" . $clientId . "')";
}

$cmd = "mysqldump --defaults-extra-file=$mycnf "
."--no-create-info "
."--single-transaction --max_allowed_packet=512M "
Expand Down

0 comments on commit 167081e

Please sign in to comment.