imap exchange 2013 not working

Check your server with this powershell command

Get-HealthReport servername | where { $_.state -eq “Offline”}

now you should see your imap proxy is offline

bring back to life with

Set-ServerComponentState -Identity servername-Component IMAPProxy -State Active -Requester HealthAPI

found here

https://nchrissos.wordpress.com/2017/01/10/reactivate-a-broken-imap-service-on-microsoft-exchange-20132016/

See Microsoft KB

https://support.microsoft.com/en-us/help/3025138/users-cannot-connect-to-pop3-or-imap4-on-exchange-server-2013-or-excha

More information about troubleshoot imap

https://technet.microsoft.com/en-us/library/ms.exch.scom.imap%28v=exchg.150%29.aspx