NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
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

[Dovecot] Update to 2.3.5.2 [Compose] Update Dovecot image

3e3e5265
andryyy <[email protected]> 7 years ago
data/Dockerfiles/dovecot/Dockerfile       |  2 +-
 data/web/inc/functions.transports.inc.php | 18 +++++++++++++++++-
 data/web/lang/lang.de.php                 |  1 +
 data/web/lang/lang.en.php                 |  1 +
 docker-compose.yml                        |  2 +-
 5 files changed, 21 insertions(+), 3 deletions(-)

Diff

diff --git a/data/Dockerfiles/dovecot/Dockerfile b/data/Dockerfiles/dovecot/Dockerfile
index 51852d29..9d95b4e0 100644
--- a/data/Dockerfiles/dovecot/Dockerfile
+++ b/data/Dockerfiles/dovecot/Dockerfile
@@ -3,7 +3,7 @@ LABEL maintainer "Andre Peters <[email protected]>"
 
 ARG DEBIAN_FRONTEND=noninteractive
 ENV LC_ALL C
-ENV DOVECOT_VERSION 2.3.5.1
+ENV DOVECOT_VERSION 2.3.5.2
 ENV PIGEONHOLE_VERSION 0.5.5
 
 RUN apt-get update && apt-get -y --no-install-recommends install \
diff --git a/data/web/inc/functions.transports.inc.php b/data/web/inc/functions.transports.inc.php
index e45fab78..e007f94d 100644
--- a/data/web/inc/functions.transports.inc.php
+++ b/data/web/inc/functions.transports.inc.php
@@ -193,7 +193,7 @@ function transport($_action, $_data = null) {
       $username = str_replace(':', '\:', trim($_data['username']));
       $password = str_replace(':', '\:', trim($_data['password']));
       // ".domain" is a valid destination, "..domain" is not
-      if (empty($destination) || (is_valid_domain_name(preg_replace('/^' . preg_quote('.', '/') . '/', '', $destination)) === false && $destination != '*')) {
+      if (empty($destination) || (is_valid_domain_name(preg_replace('/^' . preg_quote('.', '/') . '/', '', $destination)) === false && $destination != '*' && filter_var($destination, FILTER_VALIDATE_EMAIL) === false)) {
         $_SESSION['return'][] = array(
           'type' => 'danger',
           'log' => array(__FUNCTION__, $_action, $_data_log),
@@ -223,6 +223,14 @@ function transport($_action, $_data = null) {
             );
             return false;
           }
+          if ($transport_data['destination'] == $destination) {
+            $_SESSION['return'][] = array(
+              'type' => 'danger',
+              'log' => array(__FUNCTION__, $_action, $_data_log),
+              'msg' => 'transport_dest_exists'
+            );
+            return false;
+          }
         }
       }
       if (isset($next_hop_matches[1])) {
@@ -319,6 +327,14 @@ function transport($_action, $_data = null) {
             }
             $existing_nh[] = $transport_data['nexthop'];
             preg_match('/\[(.+)\].*/', $transport_data['nexthop'], $existing_clean_nh[]);
+            if ($transport_data['destination'] == $destination) {
+              $_SESSION['return'][] = array(
+                'type' => 'danger',
+                'log' => array(__FUNCTION__, $_action, $_data_log),
+                'msg' => 'transport_dest_exists'
+              );
+              return false;
+            }
           }
         }
         if (isset($next_hop_matches[1])) {
diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php
index 4d0352d0..aeb38c9b 100644
--- a/data/web/lang/lang.de.php
+++ b/data/web/lang/lang.de.php
@@ -19,6 +19,7 @@ $lang['footer']['cancel'] = 'Abbrechen';
 $lang['footer']['hibp_nok'] = 'Übereinstimmung gefunden! Dieses Passwort ist potentiell gefährlich!';
 $lang['footer']['hibp_ok'] = 'Keine Übereinstimmung gefunden.';
 
+$lang['danger']['transport_dest_exists'] = "Transport Maps Ziel existiert bereits";
 $lang['danger']['unlimited_quota_acl'] = "Unendliche Quota untersagt durch ACL";
 $lang['danger']['mysql_error'] = "MySQL Fehler: %s";
 $lang['danger']['redis_error'] = "Redis Fehler: %s";
diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php
index 3efe810e..be92b389 100644
--- a/data/web/lang/lang.en.php
+++ b/data/web/lang/lang.en.php
@@ -20,6 +20,7 @@ $lang['footer']['cancel'] = 'Cancel';
 $lang['footer']['hibp_nok'] = 'Matched! This is a potentially dangerous password!';
 $lang['footer']['hibp_ok'] = 'No match found.';
 
+$lang['danger']['transport_dest_exists'] = "Transport destination exists";
 $lang['danger']['unlimited_quota_acl'] = "Unlimited quota prohibited by ACL";
 $lang['danger']['mysql_error'] = "MySQL error: %s";
 $lang['danger']['redis_error'] = "Redis error: %s";
diff --git a/docker-compose.yml b/docker-compose.yml
index 804ba749..d782660b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -169,7 +169,7 @@ services:
             - sogo
 
     dovecot-mailcow:
-      image: mailcow/dovecot:1.67
+      image: mailcow/dovecot:1.68
       build: ./data/Dockerfiles/dovecot
       cap_add:
         - NET_BIND_SERVICE