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

[Web] Set default relayhost to 0 when adding a mailbox; add missing lang strings

fcbd4e76
andryyy <[email protected]> 5 years ago
data/web/edit.php                      | 4 ++--
 data/web/inc/functions.mailbox.inc.php | 2 ++
 data/web/lang/lang.de.json             | 1 +
 data/web/lang/lang.en.json             | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

Diff

diff --git a/data/web/edit.php b/data/web/edit.php
index 3908c160..ba582292 100644
--- a/data/web/edit.php
+++ b/data/web/edit.php
@@ -291,7 +291,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
                     <?php
                     }
                     ?>
-                    <option value="" <?=($result['relayhost'] == "0") ? 'selected' : null;?>>None</option>
+                    <option value="" <?=($result['relayhost'] == "0") ? 'selected' : null;?>><?=$lang['edit']['none_inherit'];?></option>
                   </select>
                 </div>
               </div>
@@ -718,7 +718,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
                 <?php
                 }
                 ?>
-                <option value="" <?=($result['attributes']['relayhost'] == "0") ? 'selected' : null;?>>None</option>
+                <option value="" <?=($result['attributes']['relayhost'] == "0" || empty($result['attributes']['relayhost'])) ? 'selected' : null;?>><?=$lang['edit']['none_inherit'];?></option>
               </select>
               <p class="visible-xs" style="margin: 0;padding: 0">&nbsp;</p>
               <small class="help-block"><?=$lang['edit']['mailbox_relayhost_info'];?></small>
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php
index 3d96d303..c2654319 100644
--- a/data/web/inc/functions.mailbox.inc.php
+++ b/data/web/inc/functions.mailbox.inc.php
@@ -956,6 +956,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
           $imap_access = (isset($_data['imap_access'])) ? intval($_data['imap_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['imap_access']);
           $pop3_access = (isset($_data['pop3_access'])) ? intval($_data['pop3_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['pop3_access']);
           $smtp_access = (isset($_data['smtp_access'])) ? intval($_data['smtp_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['smtp_access']);
+          $relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : 0;
           $quarantine_notification = (isset($_data['quarantine_notification'])) ? strval($_data['quarantine_notification']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']);
           $quarantine_category = (isset($_data['quarantine_category'])) ? strval($_data['quarantine_category']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category']);
           $quota_b		= ($quota_m * 1048576);
@@ -968,6 +969,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
               'imap_access' => strval($imap_access),
               'pop3_access' => strval($pop3_access),
               'smtp_access' => strval($smtp_access),
+              'relayhost' => strval($relayhost),
               'passwd_update' => time(),
               'mailbox_format' => strval($MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format']),
               'quarantine_notification' => strval($quarantine_notification),
diff --git a/data/web/lang/lang.de.json b/data/web/lang/lang.de.json
index f6f04394..fb8e9f38 100644
--- a/data/web/lang/lang.de.json
+++ b/data/web/lang/lang.de.json
@@ -568,6 +568,7 @@
         "mins_interval": "Intervall (min)",
         "multiple_bookings": "Mehrfaches Buchen",
         "nexthop": "Next Hop",
+        "none_inherit": "Keine Auswahl / Erben",
         "password": "Passwort",
         "password_repeat": "Passwort wiederholen",
         "previous": "Vorherige Seite",
diff --git a/data/web/lang/lang.en.json b/data/web/lang/lang.en.json
index d21ad1c4..db9338fe 100644
--- a/data/web/lang/lang.en.json
+++ b/data/web/lang/lang.en.json
@@ -570,6 +570,7 @@
         "mbox_rl_info": "This rate limit is applied on the SASL login name, it matches any \"from\" address used by the logged-in user. A mailbox rate limit overrides a domain-wide rate limit.",
         "mins_interval": "Interval (min)",
         "multiple_bookings": "Multiple bookings",
+        "none_inherit": "None / Inherit",
         "nexthop": "Next hop",
         "password": "Password",
         "password_repeat": "Confirmation password (repeat)",