Messageserver5 keeps old connection (IMAP-idle problem)

REPRODUCIBILITY: 100%
OS VERSION: 4.4.0.68 and many previous
HARDWARE: XA2 Plus Dual SIM (H4493)
UI LANGUAGE: Doesn’t matter
REGRESSION: ?

DESCRIPTION:

After changing the IP address for some reason (e.g. switching on/off/between networks), messageserver5 doesn’t immediately reconnect through the new source IP, but keeps the TCP connection with the old source IP. Eventually, after some variable (but usually long) time, the old TCP connection dies and it reconnects through the active source IP. This causes email boxes with IMAP-idle (always in sync) option to not be able to sync until messageserver5 reconnects.

PRECONDITIONS:

IMAP (not Exchange) email box with IMAP-idle (always in sync) setting set and no constant connection to some network.

STEPS TO REPRODUCE:

  1. Set your IMAP email box with IMAP-idle (always in sync)
  2. Change your IP address by switching between 4G and wifi
  3. Send an email to this email box

EXPECTED RESULT:

To receive the sent email near immediately.

ACTUAL RESULT:

The email is received long after the sending or when you connect back to the original network with the original IP address.

MODIFICATIONS:

Nothing related.

ADDITIONAL INFORMATION:

After network switching you can see that the IP addresses are different in the outputs of these two commands (you need Developer mode enabled):

/sbin/ip a

where you can find your actual IP address, and

devel-su netstat -tpeno | grep messageserver

where you can find the current TCP connection of messageserver5 and check the source IP address.

The workaround that I use is to restart the messageserver5 service on every network switch with this command:

systemctl --user restart messageserver5

You can use the Situations app (available in Jolla store) to do this for you automatically. Just enable the Command plug-in in the Situations menu and create scenes for cases of switching on or between 4G and wifi networks.

1 Like