2

Ok, I was having a bug with my mail. Basically a while ago I got hacked and needed to completely reinstall ubuntu server. I managed to save most of my data, but for some reason wasn't able to copy my home Maildir. I'm guessing it's something to do with the file format used in Maildir. What I did manage to copy I copied into my home directory after the clean install. After this, once I'd gotten everything set up. I kept getting a strange error. I couldn't find an answer, but assumed it was something to do with the home Maildir so deleted it. I now need a way of putting one back in. I can't find any advise anywhere. How would I go about putting one back in.

Any advise would be appreciated, thanks.

1 Answers1

3

The Maildir is actually very simple. It's just a directory with three subdirs: new, cur, and tmp. You can create them all with a single command:

mkdir -p Maildir/{cur,new,tmp}
philsf
  • 854
  • 6
  • 22
  • I'm surprised whatever you're using to handle mail didn't auto-create one for you. – philsf Jan 31 '16 at 11:17
  • No, I think it's more than that. I had dovecot files in it and other stuff. Even the autocreate file is in the Maildir for some reason, I get an error, can't find file when sending emails to the home directory – Tom Albanese Jan 31 '16 at 11:23
  • I don't understand what you're asking now. I answered the question you asked before. Maybe you should ask a different question, and provide more information on what exactly is the problem you want to solve? – philsf Jan 31 '16 at 11:29
  • BTW, my answer **does** solve the problem of creating a new, empty Maildir. ;-) – philsf Jan 31 '16 at 11:30
  • Basically, I think that there is more in a Maildir. Mine had other files in it that I hadn't put there. – Tom Albanese Jan 31 '16 at 11:50
  • [There isn't](https://en.wikipedia.org/wiki/Maildir) anything more in a maildir, except, maybe, other maildirs (subfolders). If you execute the command above in the user's homedir you will have an empty maildir, that should be accessible by any MUA (I just tested with mutt) or MTA (including dovecot). – philsf Jan 31 '16 at 11:57