419f27418e
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> |
||
---|---|---|
.. | ||
__init__.py | ||
Base.py | ||
Gmail.py | ||
IMAP.py | ||
LocalStatus.py | ||
Maildir.py | ||
UIDMaps.py |