diff --git a/interface/web/mail/mail_alias_edit.php b/interface/web/mail/mail_alias_edit.php
index b6ce17f11699ec6689cee94967f7d0030d78af6d..ead9bc277cc712a4e8d830b92947083e09e75355 100644
--- a/interface/web/mail/mail_alias_edit.php
+++ b/interface/web/mail/mail_alias_edit.php
@@ -120,8 +120,8 @@ class page_action extends tform_actions {
unset($this->dataRecord["email_local_part"]);
unset($this->dataRecord["email_domain"]);
- //* Check if there is no mailbox with this address
- $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["source"])."'");
+ //* Check if there is no active mailbox with this address
+ $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = '".$app->db->quote($this->dataRecord["source"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_mailbox_txt")."
";
unset($tmp);
diff --git a/interface/web/mail/mail_forward_edit.php b/interface/web/mail/mail_forward_edit.php
index f89cd3606f03d4488bb8c711be69efccfaae37e2..33f86f5d6eb72e3371e05245d22d01374a94996f 100644
--- a/interface/web/mail/mail_forward_edit.php
+++ b/interface/web/mail/mail_forward_edit.php
@@ -117,8 +117,8 @@ class page_action extends tform_actions {
unset($this->dataRecord["email_local_part"]);
unset($this->dataRecord["email_domain"]);
- //* Check if there is no mailbox with this address
- $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["source"])."'");
+ //* Check if there is no active mailbox with this address
+ $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = '".$app->db->quote($this->dataRecord["source"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_mailbox_txt")."
";
unset($tmp);
diff --git a/interface/web/mail/mail_user_edit.php b/interface/web/mail/mail_user_edit.php
index 9289eeba25bfd9ca5b1ce2cf69993fa75debd3c0..05ddeebb596193827cd320311b28680b4cbff997 100644
--- a/interface/web/mail/mail_user_edit.php
+++ b/interface/web/mail/mail_user_edit.php
@@ -182,7 +182,7 @@ class page_action extends tform_actions {
$this->dataRecord["gid"] = $mail_config["mailuser_gid"];
//* Check if there is no alias or forward with this address
- $tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE source = '".$app->db->quote($this->dataRecord["email"])."'");
+ $tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE active = 'y' AND source = '".$app->db->quote($this->dataRecord["email"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_alias_or_forward_txt")."
";
unset($tmp);