Detailed IMAP session trace, enable Dovecot rawlog

For developers (@webtop_team), but also to troubleshoot some IMAP clients it is useful to record the list of IMAP commands sent by the client and server. The procedure to enable the “Dovecot rawlog” is available here

https://github.com/NethServer/nethserver-mail/blob/master/README.rst#enable-dovecot-imap-rawlog

This is an example of output from it:

[root@vm5 ~]# sort -n /var/lib/nethserver/vmail/first.user@dpnet.nethesis.it/dovecot.rawlog/20180913-143301-6293.*
1536841981.942282 A002 OK Logged in
1536841981.942282 * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE SEARCH=FUZZY ACL RIGHTS=texk
1536841981.942796 A003 LIST "INBOX" *
1536841981.943148 A003 OK List completed.
1536841981.943148 * LIST (\HasNoChildren) "/" INBOX
1536841981.943383 A004 LOGOUT
1536841981.943943 A004 OK Logout completed.
1536841981.943943 * BYE Logging out

Edit: thanks @lucag for reviewing and patching it!

3 Likes