Server diagnostics implemented

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Jun 30 14:24:16 BST 2011


Hi all,
I implemented a new command "diagnostics" which outputs a summary of
your configuration and server details and exits. I believe this could be
handy for e.g. bug reporting. For now it outputs: Repository names, type,
host name, port, ssl. It reports whether a user could successfully
authenticate, and outputs IMAP server capabilities, as well as the imap
server welcome string giving us the server type and version.

Finally, it outputs a list of folders that offlineimap considers for
syncing and it reports to which folder it would sync if you have
nametrans enabled. (in my example below you would see that I have
nametrans= lambda x: 'INBOX.' + x and indeed it reports 'blla -> INBOX.blla')

Would this be useful for debugging and error reporting?
Sebastian

E.g. a run with my Gmail and IMAP server looks like this:
-----------------------------------------------------------------------------
./offlineimap.py diagnostics -a test
 OfflineIMAP 6.3.4-rc2
Copyright (C) 2002 - 2010 John Goerzen <john at complete.org>

This software comes with ABSOLUTELY NO WARRANTY; see the file
COPYING for details.  This is free software, and you are welcome
to distribute it under the conditions laid out in COPYING.
 Remote repository 'Remote-test': type 'Gmail'
 Host: imap.gmail.com Port: 993 SSL: 1
 Establishing connection to imap.gmail.com:993.
 Server welcome string: * OK Gimap ready for requests from 62.48.118.215 a12if2762735faw.75
 Server capabilities: ('IMAP4REV1', 'UNSELECT', 'IDLE', 'NAMESPACE', 'QUOTA', 'ID', 'XLIST', 'CHILDREN', 'X-GM-EXT-1', 'XYZZY', 'SASL-IR', 'AUTH=XOAUTH')

 nametrans= lambda x: 'INBOX.' + x

 Folderlist: ['INBOX -> INBOX.INBOX', 'Uni -> INBOX.Uni', '[Gmail]/All Mail -> INBOX.[Gmail]/All Mail', '[Gmail]/Drafts -> INBOX.[Gmail]/Drafts', '[Gmail]/Sent Mail -> INBOX.[Gmail]/Sent Mail', '[Gmail]/Spam -> INBOX.[Gmail]/Spam', '[Gmail]/Starred -> INBOX.[Gmail]/Starred', '[Gmail]/Trash -> INBOX.[Gmail]/Trash', 'blla -> INBOX.blla']

 
 Local repository 'Local-test': type 'MappedIMAP'
 Host: sub3.mail.dreamhost.com Port: None SSL: True
 Establishing connection to sub3.mail.dreamhost.com:993.
 Server welcome string: * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc.  See COPYING for distribution information.
 Server capabilities: ('IMAP4REV1', 'UIDPLUS', 'CHILDREN', 'NAMESPACE', 'THREAD=ORDEREDSUBJECT', 'THREAD=REFERENCES', 'SORT', 'QUOTA', 'IDLE', 'STARTTLS')

 Folderlist: ['INBOX', 'INBOX.Bulk Mail', 'INBOX.Draft', 'INBOX.Drafts', 'INBOX.INBOX', 'INBOX.Inbox', 'INBOX.Sent', 'INBOX.Trash', 'INBOX.Trash.GMAIL.Spam', 'INBOX.Trash.GMAIL.Starred', 'INBOX.Trash.GMAIL.Trash', 'INBOX.Trash.INBOX', 'INBOX.Uni', 'INBOX.[Gmail].All Mail', 'INBOX.[Gmail].Drafts', 'INBOX.[Gmail].Sent Mail', 'INBOX.[Gmail].Spam', 'INBOX.[Gmail].Starred', 'INBOX.[Gmail].Trash', 'INBOX.blla', 'INBOX.old-messages']

 
 Status repository 'Local-test': type 'LocalStatus'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110630/9c9a09cd/attachment.sig>


More information about the OfflineIMAP-project mailing list