This commit has been accessed 922 times via Git panel.
commit 90c1442ddf1b77bf6548d8173337eec724528521
tree 830c9cb1296d011e9b3fb7514de534fb04ce83ba
parent ec7b1222ee82f76fcb94c67c742551304c2d4f10
author Engels Antonio <engels@majcms.org> 1353882295 +0800
committer Engels Antonio <engels@majcms.org> 1353882295 +0800
Add sieve filter clean up for deleted accounts
diff --git a/index.php b/index.php
index 3c0a7ae..3d3e603 100644
--- a/index.php
+++ b/index.php
@@ -637,6 +637,14 @@ if (isset($_SESSION['logged_uid'])) {
if (count(glob("$mail_root/{$_SESSION['logged_uid']}/$pm_init/*")) < 1) {
rmdir("$mail_root/{$_SESSION['logged_uid']}/$pm_init");
}
+
+ if (file_exists("$mail_home/{$_SESSION['logged_uid']}/$pm_init/$pm_box")) {
+ rmdirr("$mail_home/{$_SESSION['logged_uid']}/$pm_init/$pm_box");
+ }
+
+ if (count(glob("$mail_home/{$_SESSION['logged_uid']}/$pm_init/*")) < 1) {
+ rmdir("$mail_home/{$_SESSION['logged_uid']}/$pm_init");
+ }
ack("$pm_del deleted");
}
@@ -1061,8 +1069,6 @@ if (isset($_SESSION['logged_uid'])) {
$reply_headers = $reply_headers . "Return-Receipt-To: {$reply_fenv[0]}\n";
}
- imap_createmailbox($mbox,"{$imap_host}Sent");
-
$reply_date = date ("d-M-Y H:i:s O");
$reply_body = preg_replace("#(?<!\r)\n#si", "\n", $reply_body);
@@ -1070,12 +1076,17 @@ if (isset($_SESSION['logged_uid'])) {
$reply_headers = preg_replace('#(?<!\r)\n#si', "\n", $reply_headers);
$reply_headers = str_replace("\n\n","\n",$reply_headers);
- imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
-
- mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
+ if ($_POST['reply_dm'] == "on") {
+ imap_createmailbox($mbox,"{$imap_host}Drafts");
+ imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ }
+ else {
+ imap_createmailbox($mbox,"{$imap_host}Sent");
+ imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
+ }
if ($_POST['ack'] == 1) {
-
imap_setflag_full($mbox, $_POST['msg'], '\\Answered',ST_UID);
}
}
@@ -1591,7 +1602,7 @@ echo "</tr>";
if ($pm_get_count == 1) {
- echo "1 subscriber account (";
+ echo "<b>1 subscriber account</b> (";
if ($pm_get_0 > 0) {
echo "disabled";
@@ -1603,7 +1614,7 @@ echo "</tr>";
echo ")";
}
else {
- echo "$pm_get_count subscriber accounts (";
+ echo "<b>$pm_get_count subscriber accounts</b> (";
if ($pm_get_1 > 0) {
echo "$pm_get_1 enabled";
@@ -1705,7 +1716,7 @@ echo "</tr>";
if ($get_aliases_count == 1) {
- echo "1 alias (";
+ echo "<b>1 alias</b> (";
if ($get_aliases_0 > 0) {
echo "disabled";
@@ -1717,7 +1728,7 @@ echo "</tr>";
echo ")";
}
else {
- echo "$get_aliases_count aliases (";
+ echo "<b>$get_aliases_count aliases</b> (";
if ($get_aliases_1 > 0) {
echo "$get_aliases_1 enabled";
tree 830c9cb1296d011e9b3fb7514de534fb04ce83ba
parent ec7b1222ee82f76fcb94c67c742551304c2d4f10
author Engels Antonio <engels@majcms.org> 1353882295 +0800
committer Engels Antonio <engels@majcms.org> 1353882295 +0800
Add sieve filter clean up for deleted accounts
diff --git a/index.php b/index.php
index 3c0a7ae..3d3e603 100644
--- a/index.php
+++ b/index.php
@@ -637,6 +637,14 @@ if (isset($_SESSION['logged_uid'])) {
if (count(glob("$mail_root/{$_SESSION['logged_uid']}/$pm_init/*")) < 1) {
rmdir("$mail_root/{$_SESSION['logged_uid']}/$pm_init");
}
+
+ if (file_exists("$mail_home/{$_SESSION['logged_uid']}/$pm_init/$pm_box")) {
+ rmdirr("$mail_home/{$_SESSION['logged_uid']}/$pm_init/$pm_box");
+ }
+
+ if (count(glob("$mail_home/{$_SESSION['logged_uid']}/$pm_init/*")) < 1) {
+ rmdir("$mail_home/{$_SESSION['logged_uid']}/$pm_init");
+ }
ack("$pm_del deleted");
}
@@ -1061,8 +1069,6 @@ if (isset($_SESSION['logged_uid'])) {
$reply_headers = $reply_headers . "Return-Receipt-To: {$reply_fenv[0]}\n";
}
- imap_createmailbox($mbox,"{$imap_host}Sent");
-
$reply_date = date ("d-M-Y H:i:s O");
$reply_body = preg_replace("#(?<!\r)\n#si", "\n", $reply_body);
@@ -1070,12 +1076,17 @@ if (isset($_SESSION['logged_uid'])) {
$reply_headers = preg_replace('#(?<!\r)\n#si', "\n", $reply_headers);
$reply_headers = str_replace("\n\n","\n",$reply_headers);
- imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
-
- mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
+ if ($_POST['reply_dm'] == "on") {
+ imap_createmailbox($mbox,"{$imap_host}Drafts");
+ imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ }
+ else {
+ imap_createmailbox($mbox,"{$imap_host}Sent");
+ imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
+ }
if ($_POST['ack'] == 1) {
-
imap_setflag_full($mbox, $_POST['msg'], '\\Answered',ST_UID);
}
}
@@ -1591,7 +1602,7 @@ echo "</tr>";
if ($pm_get_count == 1) {
- echo "1 subscriber account (";
+ echo "<b>1 subscriber account</b> (";
if ($pm_get_0 > 0) {
echo "disabled";
@@ -1603,7 +1614,7 @@ echo "</tr>";
echo ")";
}
else {
- echo "$pm_get_count subscriber accounts (";
+ echo "<b>$pm_get_count subscriber accounts</b> (";
if ($pm_get_1 > 0) {
echo "$pm_get_1 enabled";
@@ -1705,7 +1716,7 @@ echo "</tr>";
if ($get_aliases_count == 1) {
- echo "1 alias (";
+ echo "<b>1 alias</b> (";
if ($get_aliases_0 > 0) {
echo "disabled";
@@ -1717,7 +1728,7 @@ echo "</tr>";
echo ")";
}
else {
- echo "$get_aliases_count aliases (";
+ echo "<b>$get_aliases_count aliases</b> (";
if ($get_aliases_1 > 0) {
echo "$get_aliases_1 enabled";