<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><br><span></span></div><div><span>========Stefan wrote:=======================================</span></div><br><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;">Hi all,<br>I implemented a new command "diagnostics" which outputs a summary of<br>your configuration and server details and exits. I believe this could be<br>handy for e.g. bug reporting. For now it outputs: Repository names, type,<br>host name, port, ssl. It reports whether a user could successfully<br>authenticate, and outputs IMAP server capabilities, as well as the imap<br>server welcome string giving us the server type and version.<br><br>Finally, it outputs a list of folders that offlineimap considers for<br>syncing and it reports to which
folder it would sync if you have<br>nametrans enabled. (in my example below you would see that I have<br>nametrans= lambda x: 'INBOX.' + x and indeed it reports 'blla -> INBOX.blla')<br><br>Would this be useful for debugging and error reporting?<br>Sebastian<br><br>E.g. a run with my Gmail and IMAP server looks like this:<br>-----------------------------------------------------------------------------<br>./offlineimap.py diagnostics -a test<br> OfflineIMAP 6.3.4-rc2<br>Copyright (C) 2002 - 2010 John Goerzen <<a ymailto="mailto:john@complete.org" href="mailto:john@complete.org">john@complete.org</a>><br><br>This software comes with ABSOLUTELY NO WARRANTY; see the file<br>COPYING for details. This is free software, and you are welcome<br>to distribute it under the conditions laid out in COPYING.<br> Remote repository 'Remote-test': type 'Gmail'<br> Host: imap.gmail.com Port: 993 SSL: 1<br> Establishing connection to imap.gmail.com:993.<br>
Server welcome string: * OK Gimap ready for requests from 62.48.118.215 a12if2762735faw.75<br> Server capabilities: ('IMAP4REV1', 'UNSELECT', 'IDLE', 'NAMESPACE', 'QUOTA', 'ID', 'XLIST', 'CHILDREN', 'X-GM-EXT-1', 'XYZZY', 'SASL-IR', 'AUTH=XOAUTH')<br><br> nametrans= lambda x: 'INBOX.' + x<br><br> 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']<br><br> <br> Local repository 'Local-test': type 'MappedIMAP'<br> Host: sub3.mail.dreamhost.com Port: None SSL: True<br> Establishing connection to sub3.mail.dreamhost.com:993.<br> 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.<br> Server capabilities: ('IMAP4REV1', 'UIDPLUS', 'CHILDREN', 'NAMESPACE', 'THREAD=ORDEREDSUBJECT', 'THREAD=REFERENCES', 'SORT', 'QUOTA', 'IDLE', 'STARTTLS')<br><br> 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']<br><br> <br> Status repository 'Local-test': type 'LocalStatus'<br><br>===================================================<br><br><br>@Stefan, Very good idea to do this. This should definitely be helpful for troubleshooting. It
would be a good idea to automatically include this diagnostics output when the user runs the -d debug command line option, so they don't have to run 2 debug commands when they have to submit the log file.<br><br>Already it's obvious that the Gmail capabilities is not showing uidplus, so it's working.<br><br>This is such a good idea that it makes you think, is it possible to get this diagnostics to produce more information, with just a few more method calls. I'd be against writing any code more than just simple calls to existing methods because you want to be calling the same code that you run with.<br><br>Are there methods already written that could, for example, match up the remote/local folderlists, and show which folders would not get processed at all, and which folders will be created on the local or remote sides.<br><br>A method to match the remote and local capabilities, and say which are matching as expected, and also say if it's forced to
fallback to an inefficient technique to do a particular operation on moving messages.<br><br>Detect and output mail server type and version, and generate a Rating based on capabilities and age of the release, and flag that so the user can see if their mailserver is outdated and should be upgraded.<br><br>Counts of messages, seen, deleted, other flags, in each folder of all the folderlists. The date of the newest and oldest messages. Whatever can be done to show a minimum expected amount of messages to be sync'd.<br><br>Anything else that the code can easily output, to indicate what it's intending to do, and if it's expected success, without actually changing any data on either server.<br><br><br>Chris<br><br></div></div></div></body></html>