public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Rspamd] 2.5 RC3
3e2cbac7
data/web/inc/functions.inc.php | 27 +++++++++++++++++++--------
data/web/inc/functions.mailbox.inc.php | 20 +++++++++++++++++++-
docker-compose.yml | 2 +-
3 files changed, 39 insertions(+), 10 deletions(-)
Diff
diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php
index 75ed8eb0..69fbb3bb 100644
--- a/data/web/inc/functions.inc.php
+++ b/data/web/inc/functions.inc.php
@@ -1638,20 +1638,31 @@ function solr_status() {
}
function cleanupJS($ignore = '', $folder = '/tmp/*.js') {
- foreach (glob($folder) as $filename) {
- if(strpos($filename, $ignore) !== false) {
- continue;
- }
+ $now = time();
+ foreach (glob($folder) as $filename) {
+ if(strpos($filename, $ignore) !== false) {
+ continue;
+ }
+ if (is_file($filename)) {
+ if ($now - filemtime($filename) >= 60 * 60) {
unlink($filename);
+ }
}
+ }
}
function cleanupCSS($ignore = '', $folder = '/tmp/*.css') {
- foreach (glob($folder) as $filename) {
- if(strpos($filename, $ignore) !== false) {
- continue;
- }
+ $now = time();
+ foreach (glob($folder) as $filename) {
+ if(strpos($filename, $ignore) !== false) {
+ continue;
+ }
+ if (is_file($filename)) {
+ if ($now - filemtime($filename) >= 60 * 60) {
unlink($filename);
+ }
}
+ }
}
+
?>
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php
index a60f472b..deaebbbc 100644
--- a/data/web/inc/functions.mailbox.inc.php
+++ b/data/web/inc/functions.mailbox.inc.php
@@ -3262,7 +3262,8 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
if ($last_mail_login === false) {
$last_mail_login = '';
}
- $stmt = $pdo->prepare("SELECT
+ if (preg_match('/y|yes/i', getenv('MASTER'))) {
+ $stmt = $pdo->prepare("SELECT
`domain`.`backupmx`,
`mailbox`.`username`,
`mailbox`.`name`,
@@ -3276,6 +3277,23 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
`quota2`.`messages`
FROM `mailbox`, `quota2`, `domain`
WHERE `mailbox`.`kind` NOT REGEXP 'location|thing|group' AND `mailbox`.`username` = `quota2`.`username` AND `domain`.`domain` = `mailbox`.`domain` AND `mailbox`.`username` = :mailbox");
+ }
+ else {
+ $stmt = $pdo->prepare("SELECT
+ `domain`.`backupmx`,
+ `mailbox`.`username`,
+ `mailbox`.`name`,
+ `mailbox`.`active` AS `active_int`,
+ CASE `mailbox`.`active` WHEN 1 THEN '".$lang['mailbox']['yes']."' ELSE '".$lang['mailbox']['no']."' END AS `active`,
+ `mailbox`.`domain`,
+ `mailbox`.`local_part`,
+ `mailbox`.`quota`,
+ `quota2replica`.`bytes`,
+ `attributes`,
+ `quota2replica`.`messages`
+ FROM `mailbox`, `quota2replica`, `domain`
+ WHERE `mailbox`.`kind` NOT REGEXP 'location|thing|group' AND `mailbox`.`username` = `quota2replica`.`username` AND `domain`.`domain` = `mailbox`.`domain` AND `mailbox`.`username` = :mailbox");
+ }
$stmt->execute(array(
':mailbox' => $_data,
));
diff --git a/docker-compose.yml b/docker-compose.yml
index 90032e74..a83d5f60 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -71,7 +71,7 @@ services:
- clamd
rspamd-mailcow:
- image: mailcow/rspamd:1.65
+ image: mailcow/rspamd:1.66
stop_grace_period: 30s
depends_on:
- nginx-mailcow