IMAP poller does not work with ngnix

dovecot:
* OK [...]...
ONMSPOLLER LOGOUT
* BYE Logging out
ONMSPOLLER OK Logout completed.

nginx:
* OK IMAP4 ready
ONMSPOLLER LOGOUT
* BYE
ONMSPOLLER OK completed

There is no space after * BYE but opennms expect one