Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: In read_string: expected config create_mailbox_subdirs_hostport to be a string #437

Closed
tempixx opened this issue Jan 25, 2021 · 2 comments

Comments

@tempixx
Copy link

tempixx commented Jan 25, 2021

The config file parameter 'create_mailbox_subdirs_hostport' must be corrected:
// Normally, the TCP port number does not have to be specified.
// $CONF['create_mailbox_subdirs_hostport']=143;
Until 3.2 was fine, since 3.3 must be:
// $CONF['create_mailbox_subdirs_hostport']='143';

PHP Fatal error: In read_string: expected config create_mailbox_subdirs_hostport to be a string, but received a integer in /var/www/localhost/htdocs/postfixadmin-3.3.4/model/Config.php on line 70,
referer: https://XXX/postfixadmin/public/edit.php?table=mailbox

@DavidGoodwin
Copy link
Member

Would this fix it for you ?

diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php
index 4608247a..0fea63e8 100644
--- a/model/MailboxHandler.php
+++ b/model/MailboxHandler.php
@@ -702,14 +702,16 @@ class MailboxHandler extends PFAHandler {
         }
 
         $s_port='';
-        $create_mailbox_subdirs_hostport = Config::read_string('create_mailbox_subdirs_hostport');
-        if (!empty($create_mailbox_subdirs_hostport)) {
-            $s_port = $create_mailbox_subdirs_hostport;
-            if (intval($s_port)!=$s_port) {
-                trigger_error('The $CONF["create_mailbox_subdirs_hostport"] parameter must be an integer', E_USER_ERROR);
-                return false;
+        if (Config::has('create_mailbox_subdirs_hostport')) {
+            $create_mailbox_subdirs_hostport = Config::read('create_mailbox_subdirs_hostport');
+            if (!empty($create_mailbox_subdirs_hostport)) {
+                $s_port = $create_mailbox_subdirs_hostport;
+                if (intval($s_port)!=$s_port) {
+                    trigger_error('The $CONF["create_mailbox_subdirs_hostport"] parameter must be an integer', E_USER_ERROR);
+                    return false;
+                }
+                $s_port=':'.$s_port;
             }
-            $s_port=':'.$s_port;
         }
 
         $s='{'.$s_host.$s_port.$s_options.'}';

@DavidGoodwin
Copy link
Member

fix merged. Should be part of 3.3.5 ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants