I deleted all my emails by accident
May. 29th, 2025 10:52 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
All I need to do to restore them is to "cd into ~/.maildir" to pick a snapshot. In this context, what does that mean? Online search is not helpful.
OK, further explanation followed:
"You may well have deleted the *contents* of your inbox, but the inbox
itself is still there, as is that link in your home directory. So
(from your home directory):
cd .maildir
snapshot
look at the timestamps and pick the most recent one pre-deletion.
Inbox messages will be in the directory 'cur' once you are in a
snapshot. You can copy the files into ~/.maildir/cur (or
/users/jdnicoll/.maildir/cur"
Ok, so the literal command is
cd .maildir
snapshot
NOT
cd .maildir
and then
snapshot
This gets me a list of snapshots.
if I pick one, I get
Changing directory to /net/mail/spool/panix/7/.zfs/snapshot/2025-05-28-2000.hourly/3/jdnicoll@panix.com
What do I do next?
OK, further explanation followed:
"You may well have deleted the *contents* of your inbox, but the inbox
itself is still there, as is that link in your home directory. So
(from your home directory):
cd .maildir
snapshot
look at the timestamps and pick the most recent one pre-deletion.
Inbox messages will be in the directory 'cur' once you are in a
snapshot. You can copy the files into ~/.maildir/cur (or
/users/jdnicoll/.maildir/cur"
Ok, so the literal command is
cd .maildir
snapshot
NOT
cd .maildir
and then
snapshot
This gets me a list of snapshots.
if I pick one, I get
Changing directory to /net/mail/spool/panix/7/.zfs/snapshot/2025-05-28-2000.hourly/3/jdnicoll@panix.com
What do I do next?
no subject
Date: 2025-05-29 03:06 pm (UTC)~/.maildir probably is a file folder on whatever computer you're using.
~ may mean, and may resolve as something like /usr/jdnicoll in your case.
"cd" implies using a command shell program - you type strange words, and the computer does things.
Like: cd ~/.maildir
I have no idea if you've got any snapshots, there or anywhere, or how to do anything about them. But it sounds like "an occasional automatic backup".
Robert Carnegie
no subject
Date: 2025-05-29 03:19 pm (UTC)Ok, 1) I'm a zfs expert and you can always call me you know. Or zoom. 2) Once you've changed into that directory there, you can do
cp -Rv * ~/.maildir/cur
ZFS snapshots are read-only, so you aren't in risk of deleting any of the snapshotted files.
no subject
Date: 2025-05-29 03:24 pm (UTC)no subject
Date: 2025-05-29 03:27 pm (UTC)That cp command: "cp -Rv * ~/.maildir/cur"
I assume you're at a shell prompt, anyway.
no subject
Date: 2025-05-29 03:29 pm (UTC)Changing directory to /net/mail/spool/panix/7/.zfs/snapshot/2025-05-28-2000.hourly/3/jdnicoll@panix.com
no subject
Date: 2025-05-29 03:31 pm (UTC)Right. Then you run the cp command. You can also run
ls -CF
and paste in the output. I just emailed you my phone numbers but that won't work will it. :blush:no subject
Date: 2025-05-29 03:37 pm (UTC)cp -Rv * ~/.maildir/cur
no subject
Date: 2025-05-29 03:40 pm (UTC)Yes. If you want to run
ls -CF
first, and send me the output (say, in bsky dm) that'll confirm that it's doing wha I'd expect.no subject
Date: 2025-05-29 03:43 pm (UTC)no subject
Date: 2025-05-29 03:45 pm (UTC)Correct: at the shell prompt, tpe
ls -CF
and hit return.no subject
Date: 2025-05-29 03:35 pm (UTC)It is a command line. "cp" is copy. "-Rv" means recursive (copies subdirectories) and verbose (logs everything it is doing to the terminal). "*" means copy everything in the current directory (the snapshot). "~/.maildir/cur" means copy to a "cur" directory in "~/.maildir".
To invoke the command, make sure you're in the right directory (the snapshot you want to copy from), type it in, hit enter, and cross your fingers.
To get the documentation for the cp command, type in "man cp" (without the quotes).