The problem only appears when SSL is activated. If you check the logs, you see that the command can not be read properly.
How it appears:
Aug 24 15:07:38 rs201444 imapd: Connection, ip=[::ffff:xx.xx.xx.xx]
Aug 24 15:07:38 rs201444 imapd: LOGIN: DEBUG: ip=[::ffff:xx.xx.xx.xx], command=...