Ran it through reindent.py

reindent.py is available on pythontrunk/Tools/scripts/reindent.py
Python3 fixes

I ran the script with --pretend on Py2.6,2.7,3.2 and 3.3
Fixed missing newline in python3
Moved the message header fetching inside the verbose flow

just like in the perl script
also, fixed the small unneeded ugliness of len(range(data))//2
Global variables are icky, and they're not even needed here

also, fixed a possible problem when accessing the config's labels multiple times
also, removed unused imports
Fix error checking

config.read doesn't raise exceptions on missing/unreadable files
but instead returns a list of successfully read filenames
Ugh, it was working only on the last label -_-

it seemed fishy at first but I trusted it... until pylint warned me about it
Included Twisted's implementation of imap4's utf7

there is a different utf7, only for imap!? I had no clue O_o

this seems completely absurd, and yet these kind of things keep happening

"do you want unicode over ascii?"
"ridiculous, the existing solution is so inefficient!"
situation: utf7 is born
"ridiculous, we can't use ascii names with '+' symbols!"
situation: imap4's utf7 is born -_-

http://xkcd.com/927/
Ported imap4_utf7 to Python3

without using something like six's u(), or dropping support for Python 3.0,3.1,3.2
this cannot work with non-unicode strings that contain unicode characters in Python2

that is, this fails: "ø".encode("imap4-utf-7")
It seemed a waste to recalculate each time the valid characters
Actually support the XDG Base Directory Specification
Support unicode labels and labels with whitespace

Also fixed the handling of missing labels
Updated README