[Dovecot] Moving Maildir email messages and backing things up.
I just moved to dovecot with Maildir. I think this is probably a stupid question, but I couldn't find an answer after an hour of googling and searching the wiki.
What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
What if dovecot was stopped?
,.,.,.
Where can I find a list of files in ~/Maildir/ and a note on what they are? (And similarly for a ~/Maildir/.folder)
I'm wondering if everything needs to be backed up, or if I can/should skip the indexes. What happens if any of these files changes during the backup? (I'm thinking I shouldn't have to stop dovecot for a backup).
Karl Schmidt EMail Karl@xtronics.com Transtronics, Inc. WEB http://xtronics.com 3209 West 9th Street Ph (785) 841-3089 Lawrence, KS 66049 FAX (785) 841-0434
"Give me four parameters and I can fit an elephant; Give me five and I can wag its tail." (The source of the above quote?? Variants have been attributed to C.F. Gauss, Niels Bohr, Lord Kelvin, Enrico Fermi.)
Karl Schmidt wrote:
I just moved to dovecot with Maildir. I think this is probably a stupid question, but I couldn't find an answer after an hour of googling and searching the wiki.
What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
but if it's for backup, why are you moving files?
What if dovecot was stopped?
,.,.,.
Where can I find a list of files in ~/Maildir/ and a note on what they are? (And similarly for a ~/Maildir/.folder)
I'm wondering if everything needs to be backed up, or if I can/should skip the indexes. What happens if any of these files changes during the backup? (I'm thinking I shouldn't have to stop dovecot for a backup).
mouss wrote:
karl wrote: What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
So on the server I could run something simple like:
#!/bin/bash bogofilter -Ns -B /home/karl/Maildir/.s-2B-scaned_spam mv ~/Maildir/.s-2B-scaned_spam/cur/* ~/Maildir/.archived_spam/cur/
Afterwards the MUA 'view' of the folder might not be correct until thunderbird re-caches the folder?
Is there a command line tool that would allow for moving emails that would do it in a way that dovecot and the MUA would know to update caches?
.,.,
If I have two users share a mail folder, I would think the MUA 'view' would also get behind. Is there a way to get thunderbird to re-cache a folder?
but if it's for backup, why are you moving files?
I'm looking into three separate issues: automating spam training, backup issues, and sharing folders.
I really wish I could see a list of the ~/Maildir indexing files and what they do - probably I don't need to know, but it might help me understand what problems I might run into restoring a backup.
Where can I find a list of files in ~/Maildir/ and a note on what they are? (And similarly for a ~/Maildir/.folder)
I'm wondering if everything needs to be backed up, or if I can/should skip the indexes. What happens if any of these files changes during the backup? (I'm thinking I shouldn't have to stop dovecot for a backup).
Karl Schmidt EMail Karl@xtronics.com Transtronics, Inc. WEB http://xtronics.com 3209 West 9th Street Ph (785) 841-3089 Lawrence, KS 66049 FAX (785) 841-0434
Misdirection is the key to being a good magician. Magicians tell you they are doing something while they do something quite different; much like politicians -- except we can afford magicians. -KPS
Karl Schmidt wrote:
mouss wrote:
karl wrote: What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
So on the server I could run something simple like:
#!/bin/bash bogofilter -Ns -B /home/karl/Maildir/.s-2B-scaned_spam mv ~/Maildir/.s-2B-scaned_spam/cur/* ~/Maildir/.archived_spam/cur/
you'd better use an "axuiliary" directory:
mv $dir/.Junk.Trash/cur/* $dir/.Junk.Trash/todo/ $learn_spam $dir/.Junk.Trash/todo/ && mv $dir/.Junk.Trash/todo/* $dir/.Corpus.junk/cur/
in short, first move the messages out of "imap" and then learn them.
check the right option for bogofilter so that it doesn't want the learned messages to stay in the same place.
Afterwards the MUA 'view' of the folder might not be correct until thunderbird re-caches the folder?
I just don't care since this is nothing more than a Junk folder!
Is there a command line tool that would allow for moving emails that would do it in a way that dovecot and the MUA would know to update caches?
the MUA will eventually "update" its view. so this is not really a problem.
.,.,
If I have two users share a mail folder, I would think the MUA 'view' would also get behind. Is there a way to get thunderbird to re-cache a folder?
but if it's for backup, why are you moving files?
I'm looking into three separate issues: automating spam training, backup issues, and sharing folders.
you'd better divide and conquer. you can find good solutions for each problem. if you try to find a single solution for all the problems, you'll have less choices and you run the risk to get it wrong.
I really wish I could see a list of the ~/Maildir indexing files and what they do - probably I don't need to know, but it might help me understand what problems I might run into restoring a backup.
metoo:) but given that I could copy mail from courier to dovecot, I took it that I don't care much about the "administrative" files.
On Mon, 21 Apr 2008, mouss wrote:
Karl Schmidt wrote:
mouss wrote:
karl wrote: What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
So on the server I could run something simple like:
#!/bin/bash bogofilter -Ns -B /home/karl/Maildir/.s-2B-scaned_spam mv ~/Maildir/.s-2B-scaned_spam/cur/* ~/Maildir/.archived_spam/cur/
you'd better use an "axuiliary" directory:
mv $dir/.Junk.Trash/cur/* $dir/.Junk.Trash/todo/ $learn_spam $dir/.Junk.Trash/todo/ && mv $dir/.Junk.Trash/todo/* $dir/.Corpus.junk/cur/
I think you could get away with using the Maildir built-in "tmp" directory if you wanted for this.
-- Asheesh.
-- Invest in physics -- own a piece of Dirac!
Asheesh Laroia wrote:
On Mon, 21 Apr 2008, mouss wrote:
Karl Schmidt wrote:
mouss wrote:
karl wrote: What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
So on the server I could run something simple like:
#!/bin/bash bogofilter -Ns -B /home/karl/Maildir/.s-2B-scaned_spam mv ~/Maildir/.s-2B-scaned_spam/cur/* ~/Maildir/.archived_spam/cur/
you'd better use an "axuiliary" directory:
mv $dir/.Junk.Trash/cur/* $dir/.Junk.Trash/todo/ $learn_spam $dir/.Junk.Trash/todo/ && mv $dir/.Junk.Trash/todo/* $dir/.Corpus.junk/cur/
I think you could get away with using the Maildir built-in "tmp" directory if you wanted for this.
no, because you don't want the mv .../tmp/* while mail is being delivered.
better use your own dir. it costs nothing.
mouss wrote:
Karl Schmidt wrote:
mouss wrote:
karl wrote: What would happen if I ran a script that did this:
mv ~/Maildir/.folder_one/cur/* ~/Maildir/.folder_two/cur/
My hunch is it might break things.
shouldn't break anything. if the MUA is caching "actions" (happens with thunderbird at least), then the view in the client will be different but this is not a big problem (at least for me).
So on the server I could run something simple like:
#!/bin/bash bogofilter -Ns -B /home/karl/Maildir/.s-2B-scaned_spam mv ~/Maildir/.s-2B-scaned_spam/cur/* ~/Maildir/.archived_spam/cur/
you'd better use an "axuiliary" directory:
mv $dir/.Junk.Trash/cur/* $dir/.Junk.Trash/todo/ $learn_spam $dir/.Junk.Trash/todo/ && mv $dir/.Junk.Trash/todo/* $dir/.Corpus.junk/cur/
?? not sure I understand your point?? I'm not changing any message - just scanning (bogofilter -Ns -B ~/Maildir/.s-2B-scaned_spam just reads the files in ~/Maildir/.s-2B-scaned_spam/cur. I (and many others) have this part tested and working. ( bogofilter adds the header as part of the MTA work before local delivery in my setup).
But, it would be nice if I could move the messages with the same script.
I ran a test - with thunderbird set to an open follder - I did a move - Thunderbird instantly saw the move and everything just worked. BUT!--I'm not comfortable putting this in production until I know what is going on inside dovecot during this operation. It would be really helpful to know what all the index files were about etc..
Karl Schmidt EMail Karl@xtronics.com Transtronics, Inc. WEB http://xtronics.com 3209 West 9th Street Ph (785) 841-3089 Lawrence, KS 66049 FAX (785) 841-0434
Subtle recursive jokes in signatures are funny.
participants (3)
-
Asheesh Laroia
-
Karl Schmidt
-
mouss