Till Brehm
2014-07-27 0df5269cc6432cf5eb1a47e846912e70a2949605
Fixed: FS#3499 - fetchmail to address not updated after domainname change
1 files modified
11 ■■■■■ changed files
interface/web/mail/mail_domain_edit.php 11 ●●●●● patch | view | raw | blame | history
interface/web/mail/mail_domain_edit.php
@@ -359,7 +359,16 @@
            //* Update the mailinglist
            $app->db->query("UPDATE mail_mailinglist SET sys_userid = $client_user_id, sys_groupid = $sys_groupid WHERE domain = '".$app->db->quote($this->oldDataRecord['domain'])."'");
            //* Update fetchmail accounts
            $fetchmail = $app->db->queryAllRecords("SELECT * FROM mail_get WHERE destination like '%@".$app->db->quote($this->oldDataRecord['domain'])."'");
            if(is_array($fetchmail)) {
                foreach($fetchmail as $rec) {
                    $destination = $app->db->quote(str_replace($this->oldDataRecord['domain'], $this->dataRecord['domain'], $rec['destination']));
                    $app->db->datalogUpdate('mail_get', "destination = '$destination', sys_userid = $client_user_id, sys_groupid = '$sys_groupid'", 'mailget_id', $rec['mailget_id']);
                }
            }
            //* Delete the old spamfilter record
            $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".$app->db->quote($this->oldDataRecord["domain"])."'");
            $app->db->datalogDelete('spamfilter_users', 'id', $tmp["id"]);