Updating to 7.14.2 causes issues with any imap port longer than 3 digits

My IMAP server uses a reverse proxy and I connect via port 7993. The issue is that adding 4 digits to the Inbound Email server port adds a comma so 7,993. I had this issue a few releases ago and with the awesome help of the community we were able to discover that the vardefs file in InboundEmail had a character type of int. Chaning this to varchar or text fixed my issue.

Link To Original issue

This obviously wasn’t upgrade safe, but it was an acceptable fix. After upgrading to 7.14.2 however this fix no longer works. After making changes to the vardef file, I know get an invalid port message on the Inbound Email settings.

Any ideas what’s going on?

Running PHP 8.1

After changing the vardefs, did you run a QR&R and scroll down to the bottom, and run any queries proposed there?

I did, yes a couple of times.

I see these errors in the log:

Tue Jan 2 07:55:01 2024 [8647][1][FATAL] InboundEmail::connectMailserver - Invalid port provided: ‘7993’. See valid_imap_ports config.
Tue Jan 2 07:55:01 2024 [8647][1][FATAL] InboundEmail::connectMailserver - Invalid port provided: ‘7993’. See valid_imap_ports config.

I’ve figured it out.

There’s a section in the config.php file for valid IMAP ports. I just added 7993, did a quick repair and all is good now.

1 Like

You could share your config.php file’s updated code here. Thank you!

Sure, below are the relevant changes for both files:

/modules/InboundEmail/vardefs.php

 'port' => [
            'name' => 'port',
            'vname' => 'LBL_SERVER_PORT',
            'type' => 'varchar',
            'len' => '5',
            'default' => '143',
            'required' => true,
            'reportable' => false,
            'massupdate' => false,
            'inline_edit' => false,
            'importable' => false,
            'exportable' => false,
            'unified_search' => false,
            'validation' => ['type' => 'range', 'min' => '110', 'max' => '65535'],
            'comment' => 'Port used to access mail server'

***search for lbl_server_port, and change the type to varchar

/config.php

'valid_imap_ports' =>
  array (
    0 => '110',
    1 => '143',
    2 => '993',
    3 => '995',
    4 => '7993',

***search for valid_imap_ports in your config.php file and add your IMAP port here, like I did with 7993

I hope this helps.