Merge pull request #92 from andryyy/dev

Dev
This commit is contained in:
André Peters 2017-03-05 13:20:20 +01:00 committed by GitHub
commit aa7d0083d7
3 changed files with 6 additions and 6 deletions

View File

@ -21,8 +21,7 @@ ADD antivirus.conf /etc/rspamd/modules.d/antivirus.conf
RUN pip install -U oletools RUN pip install -U oletools
# Give Nginx/PHP time to restart CMD /usr/bin/rspamd -f -u _rspamd -g _rspamd
CMD /bin/sleep 30; /usr/bin/rspamd -f -u _rspamd -g _rspamd
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View File

@ -1470,7 +1470,7 @@ function user_get_alias_details($username) {
WHERE `goto` LIKE :username_goto WHERE `goto` LIKE :username_goto
AND `address` NOT LIKE '@%' AND `address` NOT LIKE '@%'
AND `address` != :username_address"); 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); $run = $stmt->fetchAll(PDO::FETCH_ASSOC);
while ($row = array_shift($run)) { while ($row = array_shift($run)) {
$data['aliases'] = $row['aliases']; $data['aliases'] = $row['aliases'];
@ -4719,8 +4719,8 @@ function mailbox_delete_mailbox($postarray) {
':username' => $username ':username' => $username
)); ));
$stmt = $pdo->prepare("SELECT `address`, `goto` FROM `alias` $stmt = $pdo->prepare("SELECT `address`, `goto` FROM `alias`
WHERE `goto` LIKE :username"); WHERE `goto` REGEXP :username");
$stmt->execute(array(':username' => '%'.$username.'%')); $stmt->execute(array(':username' => '(^|,)'.$username.'($|,)'));
$GotoData = $stmt->fetchAll(PDO::FETCH_ASSOC); $GotoData = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($GotoData as $gotos) { foreach ($GotoData as $gotos) {
$goto_exploded = explode(',', $gotos['goto']); $goto_exploded = explode(',', $gotos['goto']);
@ -4879,7 +4879,7 @@ function mailbox_get_sender_acl_handles($mailbox) {
try { try {
// Fixed addresses // Fixed addresses
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` LIKE :goto AND `address` NOT LIKE '@%'"); $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); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
while ($row = array_shift($rows)) { while ($row = array_shift($rows)) {
$data['fixed_sender_aliases'][] = $row['address']; $data['fixed_sender_aliases'][] = $row['address'];

View File

@ -58,6 +58,7 @@ services:
rspamd-mailcow: rspamd-mailcow:
image: andryyy/mailcow-dockerized:rspamd image: andryyy/mailcow-dockerized:rspamd
build: ./data/Dockerfiles/rspamd build: ./data/Dockerfiles/rspamd
command: "sleep 25; /usr/bin/rspamd -f -u _rspamd -g _rspamd"
depends_on: depends_on:
nginx-mailcow: nginx-mailcow:
condition: service_healthy condition: service_healthy