It it possible for IMAP protocol to forward messages to different folders (after they have are fetched) depending on their final status. You should provide a correct path to folder:
- imap folder - default path
- move on success - path to folder where you want to move successfully fetched messages (if there were no errors, if contact was created/found and new issue/comment from message is added to Redmine - message will be moved to success folder)
- move on failure - path to folder where you want to move failed messages
In order to set it, go to project settings, Helpdesk tab. You will find Mail server settings on the right.
- Google account: to find correct path, just hover the coursor over folder name and copy the last words, e.g. "/inbox"
- Yandex account: e.g. INBOX|Helpdesk_error, INBOX|Helpdesk_succes