define('ERROR_INVALID_EMAIL', 3);
define('ERROR_LOOP_EMAIL', 4);
-function add_to_list_alias(User $user, $local_part, $domain)
+// Checks if an email update is required in MLs and aliases.
+// This occurs when the user don't have email permissions and her email has changed.
+function require_email_update(User $user, $new_email)
{
- Platal::assert($user !== null);
+ Platal::assert(!is_null($user), 'User cannot be null.');
+
+ return !$user->checkPerms(User::PERM_MAIL) && $new_email != $user->forlifeEmail();
+}
+
+function format_email_alias($email)
+{
+ if ($user = User::getSilent($email)) {
+ return $user->forlifeEmail();
+ }
+ if (isvalid_email($email)) {
+ return $email;
+ }
+ return null;
+}
+
+function add_to_list_alias($email, $local_part, $domain, $type = 'alias')
+{
+ $email = format_email_alias($email);
+ if (is_null($email)) {
+ return false;
+ }
XDB::execute('INSERT IGNORE INTO email_virtual (email, domain, redirect, type)
SELECT {?}, id, {?}, {?}
FROM email_virtual_domains
WHERE name = {?}',
- $local_part, $user->forlifeEmail(), $type, $domain);
+ $local_part, $email, $type, $domain);
+ return true;
}
-function delete_from_list_alias(User $user, $local_part, $domain)
+function delete_from_list_alias($email, $local_part, $domain, $type = 'alias')
{
- Platal::assert($user !== null);
+ $email = format_email_alias($email);
+ if (is_null($email)) {
+ return false;
+ }
XDB::execute('DELETE v
FROM email_virtual AS v
INNER JOIN email_virtual_domains AS m ON (v.domain = m.id)
INNER JOIN email_virtual_domains AS d ON (d.aliasing = m.id)
WHERE v.email = {?} AND d.name = {?} AND v.redirect = {?} AND type = {?}',
- $local_part, $domain, $user->forlifeEmail(), $type);
+ $local_part, $domain, $email, $type);
+ return true;
+}
+
+function update_list_alias($email, $former_email, $local_part, $domain, $type = 'alias')
+{
+ $email = format_email_alias($email);
+ if (is_null($email)) {
+ return false;
+ }
+
+ XDB::execute('UPDATE email_virtual AS v
+ INNER JOIN email_virtual_domains AS d ON (v.domain = d.id)
+ SET v.redirect = {?}
+ WHERE v.redirect = {?} AND d.name = {?} AND v.email = {?} AND v.type = {?}',
+ $email, $former_email, $domain, $local_part, $type);
+ return true;
+}
+
+// Updates an email in all aliases (groups and events).
+function update_alias_user($former_email, $new_email)
+{
+ XDB::execute('UPDATE email_virtual
+ SET redirect = {?}
+ WHERE redirect = {?} AND (type = \'alias\' OR type = \'event\')',
+ $new_email, $former_email);
}
function list_alias_members($local_part, $domain)
FROM email_virtual AS v
INNER JOIN email_virtual_domains AS m ON (v.domain = m.id)
INNER JOIN email_virtual_domains AS d ON (d.aliasing = m.id)
- WHERE v.email = {?} AND d.name = {?} AND type = \'user\'',
+ WHERE v.email = {?} AND d.name = {?} AND type = \'alias\'',
$local_part, $domain);
- $members = array();
+ $users = array();
+ $nonusers = array();
foreach ($emails as $email) {
- $members[] = User::getSilent($email);
+ if ($user = User::getSilent($email)) {
+ $users[] = $user;
+ } else {
+ $nonusers[] = $email;
+ }
}
- return $members;
+ return array(
+ 'users' => $users,
+ 'nonusers' => $nonusers
+ );
}
function delete_list_alias($local_part, $domain)
FROM email_virtual AS v
INNER JOIN email_virtual_domains AS m ON (v.domain = m.id)
INNER JOIN email_virtual_domains AS d ON (d.aliasing = m.id)
- WHERE v.email = {?} AND d.name = {?} AND type = \'user\'',
+ WHERE v.email = {?} AND d.name = {?} AND type = \'alias\'',
$local_part, $domain);
}
return XDB::fetchColumn('SELECT CONCAT(v.email, \'@\', m.name)
FROM email_virtual AS v
INNER JOIN email_virtual_domains AS m ON (v.domain = m.id)
- WHERE m.name = {?} AND v.type = \'user\'
+ WHERE m.name = {?} AND v.type = \'alias\'
GROUP BY v.email',
$domain);
}
$redirect = $domain . '_' . $local_part . '+';
foreach(array('post', 'owner', 'admin', 'bounces', 'unsubscribe') as $suffix) {
- XDB::execute('DELETE email_virtual
- WHERE redirect = {?} AND type = \'list\'',
+ XDB::execute('DELETE FROM email_virtual
+ WHERE redirect = {?} AND type = \'list\'',
$redirect . $suffix . '@' . $globals->lists->redirect_domain);
}
}
return;
}
- $user = XDB::fetchOneAssoc('SELECT r1.uid, r1.broken_level != 0 AS broken, a.hruid, COUNT(r2.uid) AS nb_mails, a.full_name, s.email AS alias
+ $user = XDB::fetchOneAssoc('SELECT r1.uid, r1.broken_level != 0 AS broken, COUNT(r2.uid) AS nb_mails,
+ s.email AS alias, DATE_ADD(r1.last, INTERVAL 14 DAY) < CURDATE() as notify
FROM email_redirect_account AS r1
INNER JOIN accounts AS a ON (a.uid = r1.uid)
INNER JOIN email_source_account AS s ON (a.uid = s.uid AND s.flags = \'bestalias\')
WHERE redirect = {?}', $email);
} elseif ($admin) {
XDB::execute('UPDATE email_redirect_account
- SET last = CURDATE(), broken_level = IF(broken_level > 1, 3, 2)
+ SET last = CURDATE(), broken_level = broken_level + 1
WHERE redirect = {?} AND DATE_ADD(last, INTERVAL 14 DAY) < CURDATE()',
$email);
} else {
// eventually selects a new bestalias when required.
function fix_bestalias(User $user)
{
- $count = XDB::fetchOneCell('SELECT COUNT(*)
- FROM email_source_account
- WHERE uid = {?} AND FIND_IN_SET(\'bestalias\', flags)',
- $user->id());
+ // First check if the bestalias is properly set.
+ $alias_count = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM email_source_account
+ WHERE uid = {?} AND FIND_IN_SET(\'bestalias\', flags) AND expire IS NULL',
+ $user->id());
- if ($count == 1) {
- return;
- } elseif ($count > 1) {
+ if ($alias_count > 1) {
// If too many bestaliases, delete the bestalias flag from all this
// user's emails (this should never happen).
XDB::execute("UPDATE email_source_account
WHERE uid = {?}",
$user->id());
}
+ if ($alias_count != 1) {
+ // If no bestalias is selected, we choose the shortest email which is not
+ // related to a usage name and contains a '.'.
+ XDB::execute("UPDATE email_source_account
+ SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'bestalias')
+ WHERE uid = {?} AND expire IS NULL
+ ORDER BY NOT FIND_IN_SET('usage', flags), email LIKE '%.%', LENGTH(email)
+ LIMIT 1",
+ $user->id());
+ }
+
+ // First check if best_domain is properly set.
+ $domain_count = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM accounts AS a
+ INNER JOIN email_source_account AS s ON (s.uid = a.uid AND FIND_IN_SET(\'bestalias\', s.flags))
+ INNER JOIN email_virtual_domains AS d ON (d.id = a.best_domain)
+ INNER JOIN email_virtual_domains AS m ON (d.aliasing = m.id)
+ INNER JOIN email_virtual_domains AS v ON (v.aliasing = m.id AND v.id = s.domain)
+ WHERE a.uid = {?} AND (m.name = {?} OR m.name = {?})',
+ $user->id(), $user->mainEmailDomain(), Platal::globals()->mail->alias_dom);
+
+ if ($domain_count == 0) {
+ XDB::execute('UPDATE accounts AS a
+ INNER JOIN email_source_account AS s ON (s.uid = a.uid AND FIND_IN_SET(\'bestalias\', s.flags))
+ INNER JOIN email_virtual_domains AS d ON (d.aliasing = s.domain AND (d.name = {?} OR d.name = {?}))
+ SET a.best_domain = d.id
+ WHERE a.uid = {?}',
+ $user->mainEmailDomain(), Platal::globals()->mail->alias_dom, $user->id());
+ }
+
- // If no bestalias is selected, we choose the shortest email which is not
- // related to a usage name and contains a '.'.
- XDB::execute("UPDATE email_source_account
- SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'bestalias')
- WHERE uid = {?}
- ORDER BY NOT FIND_IN_SET('usage', flags), email LIKE '%.%', LENGTH(email)
- LIMIT 1",
- $user->id());
}
// function valide_email() {{{1
return;
}
list($ident, $dom) = explode('@', $em);
- if ($dom == $globals->mail->domain || $dom == $globals->mail->domain2) {
+ if (User::isMainMailDomain($dom)) {
list($ident1) = explode('_', $ident);
list($ident) = explode('+', $ident1);
}
*/
function isvalid_email_redirection($email)
{
- return isvalid_email($email) &&
- !preg_match("/@(polytechnique\.(org|edu)|melix\.(org|net)|m4x\.org)$/", $email);
+ return isvalid_email($email) && !preg_match("/@polytechnique\.edu$/", $email) && User::isForeignEmailAddress($email);
}
// function ids_from_mails() {{{1
// given email when we found a matching user.
function ids_from_mails(array $emails)
{
- global $globals;
-
// Removes duplicates, if any.
$emails = array_unique($emails);
// Formats and splits by domain type (locally managed or external) emails.
- $domain_emails = array();
- $other_emails = array();
+ $main_domain_emails = array();
+ $aux_domain_emails = array();
+ $other_emails = array();
foreach ($emails as $email) {
if (strpos($email, '@') === false) {
- $user = $email;
- $domain = $globals->mail->domain2;
- } else {
- list($user, $domain) = explode('@', $email);
- }
- if ($domain == $globals->mail->alias_dom || $domain == $globals->mail->alias_dom2
- || $domain == $globals->mail->domain || $domain == $globals->mail->domain2) {
- list($user) = explode('+', $user);
- list($user) = explode('_', $user);
- $domain_emails[$email] = strtolower($user . '@' . $domain);
+ $main_domain_emails[] = $email;
} else {
- $other_emails[$email] = strtolower($user . '@' . $domain);
+ if (User::isForeignEmailAddress($email)) {
+ $other_emails[$email] = strtolower($user . '@' . $domain);
+ } else {
+ list($local_part, $domain) = explode('@', $email);
+ list($local_part) = explode('+', $local_part);
+ list($local_part) = explode('_', $local_part);
+ if (User::isMainMailDomain($domain)) {
+ $main_domain_emails[$email] = strtolower($local_part);
+ } elseif (User::isAliasMailDomain($domain)) {
+ $aux_domain_emails[$email] = strtolower($local_part);
+ }
+ }
}
}
// Retrieves emails from our domains.
- $domain_uids = XDB::fetchAllAssoc('email',
- 'SELECT email, uid
- FROM email_source_account
- WHERE email IN {?}',
- array_unique($domain_emails));
+ $main_domain_uids = XDB::fetchAllAssoc('email',
+ 'SELECT email, uid
+ FROM email_source_account
+ WHERE email IN {?} AND type != \'alias_aux\'',
+ array_unique($main_domain_emails));
+ $aux_domain_uids = XDB::fetchAllAssoc('email',
+ 'SELECT email, uid
+ FROM email_source_account
+ WHERE email IN {?} AND type = \'alias_aux\'',
+ array_unique($aux_domain_emails));
// Retrieves emails from redirections.
$other_uids = XDB::fetchAllAssoc('redirect',
// Associates given emails with the corresponding uid.
$uids = array();
- foreach (array_merge($domain_emails, $other_emails) as $email => $canonical_email) {
- if (array_key_exists($canonical_email, $domain_uids)) {
- $uids[$email] = $domain_uids[$canonical_email];
- } elseif (array_key_exists($canonical_email, $other_uids)) {
- $uids[$email] = $other_uids[$canonical_email];
- }
+ foreach ($main_domain_emails as $email => $key) {
+ $uids[$email] = $main_domain_uids[$key];
+ }
+ foreach ($aux_domain_emails as $email => $key) {
+ $uids[$email] = $aux_domain_uids[$key];
+ }
+ foreach ($other_emails as $email => $key) {
+ $uids[$email] = $other_uids[$key];
}
- return $uids;
+ return array_unique($uids);
}
// class Bogo {{{1
// The Bogo class represents a spam filtering level in plat/al architecture.
class Bogo
{
- private static $states = array('let_spams', 'tag_spams', 'tag_and_drop_spams', 'drop_spams');
+ const MAIN_DEFAULT = 'default';
+ const IMAP_DEFAULT = 'let_spams';
+
+ public static $states = array(
+ 0 => 'default',
+ 1 => 'let_spams',
+ 2 => 'tag_spams',
+ 3 => 'tag_and_drop_spams',
+ 4 => 'drop_spams'
+ );
private $user;
- private $state;
+ public $state;
+ public $single_state;
+ public $redirections;
+ public $single_redirection;
public function __construct(User $user)
{
}
$this->user = &$user;
- $res = XDB::query('SELECT action
- FROM email_redirect_account
- WHERE uid = {?} AND (type = \'smtp\' OR type = \'googleapps\')',
- $user->id());
- if ($res->numRows() == 0) {
+ $res = XDB::fetchOneAssoc('SELECT COUNT(DISTINCT(action)) AS action_count, COUNT(redirect) AS redirect_count, action
+ FROM email_redirect_account
+ WHERE uid = {?} AND (type = \'smtp\' OR type = \'googleapps\') AND flags = \'active\'
+ GROUP BY uid',
+ $user->id());
+ if ($res['redirect_count'] == 0) {
return;
}
- $this->state = $res->fetchOneCell();
+
+ $this->single_redirection = ($res['redirect_count'] == 1);
+ $this->redirections = XDB::fetchAllAssoc('SELECT IF(type = \'googleapps\', type, redirect) AS redirect, type, action
+ FROM email_redirect_account
+ WHERE uid = {?} AND (type = \'smtp\' OR type = \'googleapps\')
+ ORDER BY type, redirect',
+ $user->id());
+
+ foreach ($this->redirections AS &$redirection) {
+ $redirection['filter'] = array_search($redirection['action'], self::$states);
+ }
+ if ($res['action_count'] == 1) {
+ $this->state = array_search($res['action'], self::$states);
+ $this->single_state = true;
+ } else {
+ $this->single_state = $this->state = false;
+ }
}
- public function change($state)
+ public function changeAll($state)
{
- $this->state = is_int($state) ? self::$states[$state] : $state;
+ Platal::assert($state >= 0 && $state < count(self::$states), 'Unknown antispam level.');
+
+ $this->state = $state;
XDB::execute('UPDATE email_redirect_account
SET action = {?}
WHERE uid = {?} AND (type = \'smtp\' OR type = \'googleapps\')',
- $this->state, $this->user->id());
+ self::$states[$this->state], $this->user->id());
}
- public function level()
+ public function change($redirection, $state)
{
- return array_search($this->state, self::$states);
+ Platal::assert($state >= 0 && $state < count(self::$states), 'Unknown antispam level.');
+
+ XDB::execute('UPDATE email_redirect_account
+ SET action = {?}
+ WHERE uid = {?} AND (type = {?} OR redirect = {?})',
+ self::$states[$state], $this->user->id(), $redirection, $redirection);
}
}
// Basic email properties; $sufficient indicates if the email can be used as
// an unique redirection; $redirect contains the delivery email address.
+ public $id;
public $type;
public $sufficient;
public $email;
public $display_email;
public $domain;
public $action;
+ public $filter_level;
// Redirection status properties.
public $active;
$this->$status = ($status == $row['flags']);
}
$this->sufficient = ($this->type == 'smtp' || $this->type == 'googleapps');
+ $this->filter_level = ($this->type == 'imap') ? null : array_search($this->action, Bogo::$states);
+ if (array_key_exists($this->type , self::$storage_domains)) {
+ $this->id = $this->type;
+ } else {
+ $this->id = str_replace(array('@', '.'), array('_at_', '_dot_'), $this->email);
+ }
$this->user = &$user;
}
public function activate()
{
if ($this->inactive) {
- XDB::execute('UPDATE email_redirect_account
- SET broken_level = IF(flags = \'broken\', broken_level - 1, broken_level), flags = \'active\'
- WHERE uid = {?} AND redirect = {?}',
- $this->user->id(), $this->email);
+ if (in_array($this->type, self::get_allowed_storages($this->user))) {
+ self::activate_storage($this->user, $this->type, $this->action);
+ } else {
+ XDB::execute('UPDATE email_redirect_account
+ SET broken_level = IF(flags = \'broken\', broken_level - 1, broken_level), flags = \'active\'
+ WHERE uid = {?} AND redirect = {?}',
+ $this->user->id(), $this->email);
+ }
S::logger()->log('email_on', $this->email . ($this->user->id() != S::v('uid') ? "(admin on {$this->user->login()})" : ''));
$this->inactive = false;
$this->active = true;
public function deactivate()
{
if ($this->active) {
- XDB::execute('UPDATE email_redirect_account
- SET flags = \'inactive\'
- WHERE uid = {?} AND redirect = {?}',
- $this->user->id(), $this->email);
+ if (in_array($this->type, self::get_allowed_storages($this->user))) {
+ self::deactivate_storage($this->user, $this->type);
+ } else {
+ XDB::execute('UPDATE email_redirect_account
+ SET flags = \'inactive\'
+ WHERE uid = {?} AND redirect = {?}',
+ $this->user->id(), $this->email);
+ }
S::logger()->log('email_off', $this->email . ($this->user->id() != S::v('uid') ? "(admin on {$this->user->login()})" : "") );
$this->inactive = true;
$this->active = false;
}
// Returns the list of allowed storages for the @p user.
- static private function get_allowed_storages(User $user)
+ static public function get_allowed_storages(User $user)
{
global $globals;
$storages = array();
// Google Apps storage is available for users with valid Google Apps account.
require_once 'googleapps.inc.php';
- if ($globals->mailstorage->googleapps_domain &&
+ if ($user->checkPerms('gapps') &&
+ $globals->mailstorage->googleapps_domain &&
GoogleAppsAccount::account_status($user->id()) == 'active') {
$storages[] = 'googleapps';
}
return $storages;
}
- static public function activate_storage(User $user, $storage)
+ static public function make_storage_redirection(User $user, $storage)
{
- Platal::assert(in_array($storage, self::get_allowed_storages($user)));
+ return $user->hruid . '@' . self::$storage_domains[$storage] . '.' . Platal::globals()->mail->domain;
+ }
- if (!self::is_active_storage($user, $storage)) {
- global $globals;
+ static public function activate_storage(User $user, $storage, $action = null)
+ {
+ Platal::assert(in_array($storage, self::get_allowed_storages($user)), 'Unknown storage.');
- XDB::execute('INSERT INTO email_redirect_account (uid, type, redirect, flags)
- VALUES ({?}, {?}, {?}, \'active\')',
- $user->id(), $storage,
- $user->hruid . '@' . self::$storage_domains[$storage] . '.' . $globals->mail->domain);
+ // We first need to retrieve the value for the antispam filter if not
+ // provided: it is either the user's redirections common value, or if
+ // they differ, our default value.
+ if (is_null($action)) {
+ $bogo = new Bogo($user);
+ $action = ($bogo->single_state ? Bogo::$states[$bogo->state] : Bogo::MAIN_DEFAULT);
+ }
+
+ if (!self::is_active_storage($user, $storage)) {
+ XDB::execute('INSERT INTO email_redirect_account (uid, type, action, redirect, flags)
+ VALUES ({?}, {?}, {?}, {?}, \'active\')',
+ $user->id(), $storage, $action, self::make_storage_redirection($user, $storage));
}
}
static public function deactivate_storage(User $user, $storage)
{
- if (in_array($storage, self::$storage_domains)) {
+ if (in_array($storage, self::get_allowed_storages($user))) {
XDB::execute('DELETE FROM email_redirect_account
WHERE uid = {?} AND type = {?}',
$user->id(), $storage);
static public function is_active_storage(User $user, $storage)
{
- if (!in_array($storage, self::$storage_domains)) {
+ if (!in_array($storage, self::get_allowed_storages($user))) {
return false;
}
$res = XDB::fetchOneCell('SELECT COUNT(*)
FROM email_redirect_account
- WHERE uid = {?} AND type = {?} AND flags = \'active\')',
+ WHERE uid = {?} AND type = {?} AND flags = \'active\'',
$user->id(), $storage);
return !is_null($res) && $res > 0;
}
private $user;
public $emails;
- public $bogo;
public function __construct(User $user)
{
$this->user = &$user;
- $this->bogo = new Bogo($user);
// Adds third-party email redirections.
$res = XDB::iterator('SELECT redirect, rewrite, type, action, broken_date, broken_level, last, flags, hash, allow_rewrite
while ($row = $res->next()) {
$this->emails[] = new Email($user, $row);
}
+
+ if ($storages = Email::get_allowed_storages($user)) {
+ // We first need to retrieve the value for the antispam filter: it is
+ // either the user's redirections common value, or if they differ, our
+ // default value.
+ $bogo = new Bogo($user);
+ $filter = ($bogo->single_state ? Bogo::$states[$bogo->state] : Bogo::MAIN_DEFAULT);
+
+ foreach ($storages as $storage) {
+ if (!Email::is_active_storage($user, $storage)) {
+ $this->emails[] = new Email($user, array(
+ 'redirect' => Email::make_storage_redirection($user, $storage),
+ 'rewrite' => '',
+ 'type' => $storage,
+ 'action' => $filter,
+ 'broken_date' => 0,
+ 'broken_level' => '0000-00-00',
+ 'last' => '0000-00-00',
+ 'flags' => 'inactive',
+ 'hash' => '',
+ 'allow_rewrite' => 0));
+ }
+ }
+ }
}
public function other_active($email)
}
}
check_redirect($this);
+ $this->update_imap();
return SUCCESS;
}
if (!isvalid_email_redirection($email_stripped)) {
return ERROR_LOOP_EMAIL;
}
+ // We first need to retrieve the value for the antispam filter: it is
+ // either the user's redirections common value, or if they differ, our
+ // default value.
+ $bogo = new Bogo($this->user);
+ $filter = ($bogo->single_state ? Bogo::$states[$bogo->state] : Bogo::MAIN_DEFAULT);
// If the email was already present for this user, we reset it to the default values, we thus use REPLACE INTO.
- XDB::execute('REPLACE INTO email_redirect_account (uid, redirect, flags)
- VALUES ({?}, {?}, \'active\')',
- $this->user->id(), $email);
+ XDB::execute('REPLACE INTO email_redirect_account (uid, redirect, flags, action)
+ VALUES ({?}, {?}, \'active\', {?})',
+ $this->user->id(), $email, $filter);
if ($logger = S::v('log', null)) { // may be absent --> step4.php
S::logger()->log('email_add', $email . ($this->user->id() != S::v('uid') ? " (admin on {$this->user->login()})" : ""));
}
'redirect' => $email,
'rewrite' => '',
'type' => 'smtp',
- 'action' => 'default',
+ 'action' => $filter,
'broken_date' => '0000-00-00',
'broken_level' => 0,
'last' => '0000-00-00',
// security stuff
check_email($email, "Ajout d'une adresse surveillée aux redirections de " . $this->user->login());
check_redirect($this);
+ $this->update_imap();
return SUCCESS;
}
$email->set_rewrite($emails_rewrite[$email->email]);
}
check_redirect($this);
+ $this->update_imap();
return SUCCESS;
}
$this->emails[$thisone]->deactivate();
}
check_redirect($this);
+ $this->update_imap();
if ($allinactive && !$activate) {
return ERROR_INACTIVE_REDIRECTION;
}
if ($mail->email == $email) {
$mail->set_rewrite($redirect);
check_redirect($this);
+ $this->update_imap();
return;
}
}
foreach ($this->emails as &$mail) {
if ($mail->email == $email) {
check_redirect($this);
+ $this->update_imap();
return $mail->clean_errors();
}
}
}
}
check_redirect($this);
+ $this->update_imap();
}
public function enable()
}
check_redirect($this);
}
+ $this->update_imap();
}
public function get_broken_mx()
{
return $this->user->id();
}
+
+ private function update_imap()
+ {
+ // Imaps must bounce if and only if the user has no active redirection.
+ if (!$this->other_active('')) {
+ XDB::execute('UPDATE email_redirect_account
+ SET action = \'imap_and_bounce\'
+ WHERE type = \'imap\' AND uid = {?}',
+ $this->user->id());
+ } else {
+ XDB::execute('UPDATE email_redirect_account
+ SET action = \'let_spams\'
+ WHERE type = \'imap\' AND uid = {?}',
+ $this->user->id());
+ }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: