docker-offlineimap/offlineimap/folder
Sebastian Spaeth 419f27418e Simplify & document savemessage_getnewheader
savemessage_getnewheader was an undocmented, cryptic and overengineered
function. It generates a new unique value that can be used as a mail
header to be inserted. For this it used LOTS of randomness sources: hash
of the mail content, hash of the folder name, hash of the repository
name, the current time, a random() value, and the offlineimap version string.
All we need is something random. So reduce this to hash of content
appended by a random integer. Sufficient and somewhat faster to calculate.

Rename the function to actually describe accurately what it does or
would you have guessed that savemessage_getnewheader() did nothing more
than returning ('X-OfflineIMAP', <randomstring> )? Rename to
generate_randomheader() to make it clearer what this is all about.

Also document the function, describing what it does, and what it returns.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-03-05 18:02:09 +01:00
..
__init__.py Add Gmail IMAP special support. 2008-01-03 04:56:55 +01:00
Base.py Use self.ui rather than UIBase.getglobalui() 2011-02-17 19:03:29 +01:00
Gmail.py Remove unneeded imports of UIBase 2011-02-09 19:29:01 +01:00
IMAP.py Simplify & document savemessage_getnewheader 2011-03-05 18:02:09 +01:00
LocalStatus.py LocalStatus: Don't ignore Exceptions on os.fsync 2011-01-14 19:25:11 +01:00
Maildir.py Save ui as self.ui in folder/Base class 2011-01-05 19:24:00 +01:00
UIDMaps.py Remove unneeded imports of UIBase 2011-02-09 19:29:01 +01:00