Usernames containing special characters like '@' were included verbatim in IMAP/SMTP URLs, producing invalid URIs. Apply 'lib.strings.escapeURL' to the username so that these characters are properly encoded.