From 3e91d06d7337b62010a6beab1fc46a82354305a4 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 4 Mar 2017 15:07:07 +0100 Subject: [PATCH 1/4] Change maintainer --- data/Dockerfiles/rspamd/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/Dockerfiles/rspamd/Dockerfile b/data/Dockerfiles/rspamd/Dockerfile index bd94f25e9..3503b4a7e 100644 --- a/data/Dockerfiles/rspamd/Dockerfile +++ b/data/Dockerfiles/rspamd/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:xenial -MAINTAINER Andre Peters +MAINTAINER Andre Peters ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL C From 3fbbece85727b192c3b0d62525fa41d27381793e Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 4 Mar 2017 15:56:24 +0100 Subject: [PATCH 2/4] Minor intval fix --- data/web/inc/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index a56a7ca6c..c62421c54 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -3599,7 +3599,7 @@ function mailbox_edit_mailbox($postarray) { ); return false; } - $quota_m = $postarray['quota']; + $quota_m = intval($postarray['quota']); $quota_b = $quota_m*1048576; $username = $postarray['username']; $name = $postarray['name']; From 67bb037b3685b0904aa8a86fbccbfe7b436cc3bb Mon Sep 17 00:00:00 2001 From: andryyy Date: Sun, 5 Mar 2017 12:24:28 +0100 Subject: [PATCH 3/4] Use regexp instead of like in goto query --- data/web/inc/functions.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 5ae5196f8..39e0fe357 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -1470,7 +1470,7 @@ function user_get_alias_details($username) { WHERE `goto` LIKE :username_goto AND `address` NOT LIKE '@%' AND `address` != :username_address"); - $stmt->execute(array(':username_goto' => '%' . $username . '%', ':username_address' => $username)); + $stmt->execute(array(':username_goto' => '(^|,)'.$username.'($|,)', ':username_address' => $username)); $run = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($run)) { $data['aliases'] = $row['aliases']; @@ -4719,8 +4719,8 @@ function mailbox_delete_mailbox($postarray) { ':username' => $username )); $stmt = $pdo->prepare("SELECT `address`, `goto` FROM `alias` - WHERE `goto` LIKE :username"); - $stmt->execute(array(':username' => '%'.$username.'%')); + WHERE `goto` REGEXP :username"); + $stmt->execute(array(':username' => '(^|,)'.$username.'($|,)')); $GotoData = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($GotoData as $gotos) { $goto_exploded = explode(',', $gotos['goto']); @@ -4879,7 +4879,7 @@ function mailbox_get_sender_acl_handles($mailbox) { try { // Fixed addresses $stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` LIKE :goto AND `address` NOT LIKE '@%'"); - $stmt->execute(array(':goto' => '%' . $mailbox . '%')); + $stmt->execute(array(':goto' => '(^|,)'.$mailbox.'($|,)')); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($rows)) { $data['fixed_sender_aliases'][] = $row['address']; From be8031d8ff4522375a9bb0333f44105b970024a0 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sun, 5 Mar 2017 12:25:46 +0100 Subject: [PATCH 4/4] Move sleep to docker-compose --- data/Dockerfiles/rspamd/Dockerfile | 3 +-- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/Dockerfiles/rspamd/Dockerfile b/data/Dockerfiles/rspamd/Dockerfile index 3503b4a7e..d27220047 100644 --- a/data/Dockerfiles/rspamd/Dockerfile +++ b/data/Dockerfiles/rspamd/Dockerfile @@ -21,8 +21,7 @@ ADD antivirus.conf /etc/rspamd/modules.d/antivirus.conf RUN pip install -U oletools -# Give Nginx/PHP time to restart -CMD /bin/sleep 30; /usr/bin/rspamd -f -u _rspamd -g _rspamd +CMD /usr/bin/rspamd -f -u _rspamd -g _rspamd RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker-compose.yml b/docker-compose.yml index 3e1a34c7b..8812a7047 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,6 +58,7 @@ services: rspamd-mailcow: image: andryyy/mailcow-dockerized:rspamd build: ./data/Dockerfiles/rspamd + command: "sleep 25; /usr/bin/rspamd -f -u _rspamd -g _rspamd" depends_on: nginx-mailcow: condition: service_healthy