docker-offlineimap/offlineimap
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
..
folder Simplify & document savemessage_getnewheader 2011-03-05 18:02:09 +01:00
repository Merge branch 'ss/debug-folderfilter' into next 2011-03-03 19:07:35 +01:00
ui restore compatibilty with python 2.5 for ui TTY 2011-02-18 20:00:19 +01:00
__init__.py v6.3.2 2011-02-21 12:26:48 +01:00
accounts.py Merge branch 'ss/abstract-repository-class' into next 2011-03-03 18:22:19 +01:00
CustomConfig.py Improve CustomConfig documentation 2011-01-20 19:46:01 +01:00
imaplibutil.py Allow SSL connections to send keep-alive messages 2011-03-01 18:55:29 +01:00
imapserver.py Merge branch 'ss/remove-uneeded-darwin-workaround' into next 2011-03-05 16:37:35 +01:00
imaputil.py Remove over-verbose debug options 2011-03-03 18:23:32 +01:00
init.py Make profiling mode really enforce singlethreading 2011-03-03 19:08:49 +01:00
localeval.py Update FSF address 2006-08-12 05:15:55 +01:00
mbnames.py Update FSF address 2006-08-12 05:15:55 +01:00
syncmaster.py Implement true single-threading 2011-01-14 19:25:11 +01:00
threadutil.py Remove MultiLock implementation 2011-01-25 19:19:14 +01:00