diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 9f4c4c95..13185fd9 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -275,7 +275,7 @@ class m_mail { $err->raise("mail",_("The email %s is special, it can't be deleted"),$mail); return false; } - if ($db->f("mailbox_action")!="" || $db->f("mail_action")!="") { // will be deleted soon ... + if ($db->f("mailbox_action")!="OK" || $db->f("mail_action")!="OK") { // will be deleted soon ... $err->raise("mail",_("The email %s is already marked for deletion, it can't be deleted"),$mail); return false; } @@ -338,8 +338,8 @@ class m_mail { if ($db->f("islocal")) { // If it's a pop/imap mailbox, mark it for deletion - $db->query("UPDATE address SET mail_action='', `enabled`=1 WHERE id='$mail_id';"); - $db->query("UPDATE mailbox SET mail_action='' WHERE address_id='$mail_id';"); + $db->query("UPDATE address SET mail_action='OK', `enabled`=1 WHERE id='$mail_id';"); + $db->query("UPDATE mailbox SET mail_action='OK' WHERE address_id='$mail_id';"); $err->raise("mail",_("The email %s has been undeleted"),$mail); return true; } else { diff --git a/install/mysql.sql b/install/mysql.sql index 5a8937e2..50920047 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -246,7 +246,7 @@ CREATE TABLE IF NOT EXISTS `address` ( `enabled` int(1) unsigned NOT NULL DEFAULT '1', -- Enabled flag. `expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. - `mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron + `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron PRIMARY KEY (`id`), UNIQUE INDEX `fk_domain_id` (`domain_id`,`address`) ) COMMENT = 'This is the main address table. It represents an address as in RFC2822'; @@ -266,7 +266,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` ( `bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot `messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot `lastlogin` datetime NOT NULL, -- Last login, filled by dovecot - `mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron + `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron PRIMARY KEY (`id`), UNIQUE KEY `address_id` (`address_id`) ) COMMENT = 'Table containing local deliverd mailboxes.'; diff --git a/install/upgrades/1.1.sql b/install/upgrades/1.1.sql index 5a7e63d3..2e997fd8 100644 --- a/install/upgrades/1.1.sql +++ b/install/upgrades/1.1.sql @@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS `address` ( `enabled` int(1) unsigned NOT NULL DEFAULT '1', -- Enabled flag. `expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. - `mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron + `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron PRIMARY KEY (`id`), UNIQUE INDEX `fk_domain_id` (`domain_id`,`address`) ) COMMENT = 'This is the main address table. It represents an address as in RFC2822'; @@ -111,7 +111,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` ( `bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot `messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot `lastlogin` datetime NOT NULL, -- Last login, filled by dovecot - `mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron + `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron PRIMARY KEY (`id`), UNIQUE KEY `address_id` (`address_id`) ) COMMENT = 'Table containing local deliverd mailboxes.';