Change format for filenames

It seems some tools try to interpret the filename of message files,
even though they shouldn't:
   "Do not try to extract information from unique names."

In particular, they seem to interpret the first part of the name (before
the first dot) as the # of seconds since the Unix epoch (ie.,
time(NULL)). That's not what mu/mu4e put there.

So, let's conform a bit more to the expected filename (as per the
maildir spec), so we're not confusing those tools.
This commit is contained in:
djcb
2015-10-02 17:43:38 +03:00
parent 4774429ad6
commit a350e2047d
3 changed files with 20 additions and 14 deletions

View File

@ -309,9 +309,10 @@ You can append flags."
(save-match-data
(substring system-name
(string-match "^[^.]+" system-name) (match-end 0))))))
(format "%s-%02x%04x-%s:2,%s"
(format-time-string "%Y%m%d" (current-time))
(random 255) (random 65535) hostname (or flagstr ""))))
(format "%s.%04x%04x%04x%04x.%s:2,%s"
(format-time-string "%s" (current-time))
(random 65535) (random 65535) (random 65535) (random 65535)
hostname (or flagstr ""))))
(defun mu4e~draft-common-construct ()
"Construct the common headers for each message."