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
[Web] Database schema test
2bdc3f94
data/Dockerfiles/postfix/postfix.sh | 4 ++--
data/web/inc/functions.mailbox.inc.php | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
Diff
diff --git a/data/Dockerfiles/postfix/postfix.sh b/data/Dockerfiles/postfix/postfix.sh
index 0620404d..2d3d0e64 100755
--- a/data/Dockerfiles/postfix/postfix.sh
+++ b/data/Dockerfiles/postfix/postfix.sh
@@ -39,7 +39,7 @@ query = SELECT IF(EXISTS(
SELECT CONCAT('%u', '@', target_domain) FROM alias_domain
WHERE alias_domain='%d'
)
- ) AND mailbox.tls_enforce_in = '1' AND mailbox.active = '1'
+ ) AND json_extract(`attributes`, '$.tls_enforce_in') = '1' AND mailbox.active = '1'
), 'reject_plaintext_session', NULL) AS 'tls_enforce_in';
EOF
@@ -58,7 +58,7 @@ query = SELECT GROUP_CONCAT(transport SEPARATOR '') AS transport_maps
WHERE alias_domain = '%d'
)
)
- AND mailbox.tls_enforce_out = '1'
+ AND json_extract(`attributes`, '$.tls_enforce_out') = '1'
AND mailbox.active = '1'
), 'smtp_enforced_tls:', 'smtp:') AS 'transport'
UNION ALL
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php
index c6f3cff2..89e02166 100644
--- a/data/web/inc/functions.mailbox.inc.php
+++ b/data/web/inc/functions.mailbox.inc.php
@@ -511,8 +511,8 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
if (in_array($address, $gotos)) {
continue;
}
- $domain = idn_to_ascii(substr(strrchr($address, '@'), 1));
- $local_part = substr($address, 0, strripos($address, '@'));
+ $domain = idn_to_ascii(substr(strstr($address, '@'), 1));
+ $local_part = strstr($address, '@', true);
$address = $local_part.'@'.$domain;
$stmt = $pdo->prepare("SELECT `address` FROM `alias`
WHERE `address`= :address OR `address` IN (
@@ -1713,8 +1713,8 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
$gotos = array_filter($gotos);
$goto = implode(",", $gotos);
}
- $domain = idn_to_ascii(substr(strrchr($address, '@'), 1));
- $local_part = substr($address, 0, strripos($address, '@'));
+ $domain = idn_to_ascii(substr(strstr($address, '@'), 1));
+ $local_part = strstr($address, '@', true);
if (!hasDomainAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $domain)) {
$_SESSION['return'] = array(
'type' => 'danger',
@@ -3470,7 +3470,7 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
$addresses = $_data['address'];
}
foreach ($addresses as $address) {
- $local_part = substr($address, 0, strripos($address, '@'));
+ $local_part = strstr($address, '@', true);
$domain = mailbox('get', 'alias_details', $address)['domain'];
try {
$stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :address");