A version of this worked for me as well. Here are the steps I took that have me working again.
My published port setting are: IMAP 993 and SMTP 587.
I first deleted the account in Settings -> Delete Account -> Delete from all Devices (This option did not remove the app from my other devices???)
Settings -> Add Account -> IMAP -> Show Advanced Settings
Enter the information requested. For the IMAP and SMTP hostnames, just enter the server addresses. Do not include the :993 or :587 ports in this step.
Click the check-mark at top to process account. You will receive a dialog telling you there is not a secure connection available. Click the Login button to attempt an unsecured connection. You will receive another failure dialog telling you to check your
SMTP settings.
Return to account settings page and enter the port number for the SMTP hostname (in my case :587) immediately after the hostname address. i.e. smtp.server.com:587. Do not enter the port number for IMAP.
Click ok again to process. You will again receive the unsecure dialog. Click login to continue. After a short time, the account process should finalize and establish the account.
Check your account and see if it is communicating with the server as expected.
I attempted many different variations of this process, and this entire process is the only one that worked reliably across multiple devices. Also, trying to use the :993 port for IMAP caused repeated failures. I realize it seems cumbersome and redundant,
but it worked. Hopefully a fix to this bug can be pushed out soon. I also tried to circumvent the entire process by entering the smtp port setting during initial setup, but that produced a failure to establish a connection as well.
Good luck.