Want command line program to selectively delete emails
Marcus C. Gottwald
mcg at cheers.de
Sun Aug 6 14:04:34 UTC 2023
googly.negotiator862 at aceecat.org wrote (Sat 2023-Aug-05 09:16:35 -0700):
> I think an mtime test is not the same as "date received" test.
My understanding of the Maildir format was that the mtime of a
file containing an email message is the timestamp of when the
message was stored by the delivering process. (Though I could
not find a reference doc.) Of course, if that's not the desired
timestamp, then the mtime may or may not be of help. :-)
As far as I knew, when copying messages between Maildirs using
the Dovecot IMAP server, the files' mtimes (and filenames) are
retained. Dovecot also retains those mtimes (and filenames) when
replicating among Dovecot servers.
I performed a quick test using Mutt 2.0.5, moving a message
between two Maildir folders using local file access. It looked
like Mutt is creating a new file in the destination folder, with a
new file name (including a current timestamp) and a current mtime.
That seems reasonable (since the abstraction layer for copying
from one folder of arbitrary type and protocol to some other
folder of arbitrary type and protocol probably is much higher),
but it came to me as a surprise -- you never stop learning.
> You may have created the folder by recursive copy from somewhere
> else, just to take the most obvious problem.
My thinking (based on my understanding described above) is that
if someone copies files from or to a Maildir folder, he should
include the files' mtimes, since at least some programs reading
Maildirs do ascribe some informational value to those mtimes.
> I think for a true date received test, you have to look at the
> timestamp part of the filename.
Well, it looks like both mtime and timestamp-as-part-of-filename
may change when copying messages between Maildirs, at least when
using Mutt and a local filesystem. So if mtimes do not reflect the
desired timestamp, neither might timestamp-as-part-of-filename.
Cheers, Marcus
--
Marcus C. Gottwald · <mcg at cheers.de> · @mcg:cheers.de
More information about the Mutt-users
mailing list