I keep my email on a CentOS server, in ~/Maildir/ . I run dovecot/IMAP on the server, so that I can read the email on various Fedora laptops.
I want to off-load some email folders containing old email, eg In-05, Out-05, etc, perhaps to a directory ~/Archive/ .
a) What is the best way to do this? Would simply mv-ing ~/Maildir/.In-05 to ~/Archive/ confuse dovecot?
b) If I then want to read the old email in ~/Archive/ how can I do this with KMail?
Any suggestions or advice gratefully received.
On 02/01/2011 07:01 AM, Timothy Murphy wrote:
I keep my email on a CentOS server, in ~/Maildir/ . I run dovecot/IMAP on the server, so that I can read the email on various Fedora laptops.
I want to off-load some email folders containing old email, eg In-05, Out-05, etc, perhaps to a directory ~/Archive/ .
a) What is the best way to do this? Would simply mv-ing ~/Maildir/.In-05 to ~/Archive/ confuse dovecot?
I have dovecot with with mailboxes in mbox format and when I need to move one I do the following
service dovecot stop mv ~/Mail/srcdir/mymailbox ~/Mail/destdir/.
cd ~/Mail/srcdir/.imap rm -rf mymailbox/ the last two steps is to delete the indexes maintainned by dovecot at the old location of mymailbox
if the dir ~/Mail/destdir/.imap don't exists create it
vim ~/Mail/.subscriptions and change the srcdir to the destdir where apropiate
service dovecot start
maybe you can make a test maildir mailbox and test moving it
b) If I then want to read the old email in ~/Archive/ how can I do this with KMail?
I don't use kmail but I think which it will read mailboxes from the .subscriptions file
Gabriel
Gabriel Ramirez wrote:
I want to off-load some email folders containing old email, eg In-05, Out-05, etc, perhaps to a directory ~/Archive/ .
a) What is the best way to do this? Would simply mv-ing ~/Maildir/.In-05 to ~/Archive/ confuse dovecot?
I have dovecot with with mailboxes in mbox format and when I need to move one I do the following
service dovecot stop mv ~/Mail/srcdir/mymailbox ~/Mail/destdir/.
cd ~/Mail/srcdir/.imap rm -rf mymailbox/ the last two steps is to delete the indexes maintainned by dovecot at the old location of mymailbox
Thanks for your response. I take it you are basically moving the appropriate folder and deleting the corresponding index files? (In my case the indexes seem to be in the folder .In-05 etc; I don't have a file .imap as far as I can see.)
vim ~/Mail/.subscriptions and change the srcdir to the destdir where apropiate
I have a file ~/Maildir/subscriptions (no dot). I'm not entirely clear what this contains, but it does seem that it is probably what I need, so I'll google to see exactly what it does. (I didn't see any mention of it in the KMail manual.)
On 02/01/2011 08:12 PM, Timothy Murphy wrote:
Gabriel Ramirez wrote:
I want to off-load some email folders containing old email, eg In-05, Out-05, etc, perhaps to a directory ~/Archive/ .
a) What is the best way to do this? Would simply mv-ing ~/Maildir/.In-05 to ~/Archive/ confuse dovecot?
I have dovecot with with mailboxes in mbox format and when I need to move one I do the following
service dovecot stop mv ~/Mail/srcdir/mymailbox ~/Mail/destdir/.
cd ~/Mail/srcdir/.imap rm -rf mymailbox/ the last two steps is to delete the indexes maintainned by dovecot at the old location of mymailbox
Thanks for your response. I take it you are basically moving the appropriate folder and deleting the corresponding index files?
exactly.
ls -la ~/Mail/Lists/2011
drwxr-xr-x. 3 user01 users 4096 Feb 1 00:44 . drwxr-xr-x. 16 user01 users 4096 Sep 29 14:52 .. -rw-r--r--. 1 user01 users 1427972 Feb 1 20:28 fedora-kde_S01 -rw-r--r--. 1 user01 users 918329 Feb 1 15:34 fedora-selinux -rw-r--r--. 1 user01 users 13211652 Feb 1 01:27 fedora-users_01 -rw-r--r--. 1 user01 users 255519 Feb 1 21:50 fedora-users_02 drwxr-xr-x. 13 user01 users 4096 Feb 1 00:44 .imap
in .imap:
ls -la ~/Mail/Lists/2011/.imap
drwxr-xr-x. 13 user01 users 4096 Feb 1 00:44 . drwxr-xr-x. 3 user01 users 4096 Feb 1 00:44 .. drwxr-xr-x. 2 user01 users 4096 Feb 1 14:57 fedora-kde_S01 drwxr-xr-x. 2 user01 users 4096 Jan 29 16:50 fedora-selinux drwxr-xr-x. 2 user01 users 4096 Jan 31 19:19 fedora-users_01 drwxr-xr-x. 2 user01 users 4096 Feb 1 13:31 fedora-users_02
ls -la ~/Mail/Lists/2011/.imap/fedora-users_02
drwxr-xr-x. 2 user01 users 4096 Feb 1 13:31 . drwxr-xr-x. 13 user01 users 4096 Feb 1 00:44 .. -rw-r--r--. 1 user01 users 1632 Feb 1 21:47 dovecot.index -rw-r--r--. 1 user01 users 50176 Feb 1 21:47 dovecot.index.cache -rw-r--r--. 1 user01 users 17216 Feb 1 21:50 dovecot.index.log
(In my case the indexes seem to be in the folder .In-05 etc; I don't have a file .imap as far as I can see.)
the imap is a dir as shown above, if you have the dovecot.index* files in each maildir mailbox maybe dovecot don't use the .imap dirs with them
vim ~/Mail/.subscriptions and change the srcdir to the destdir where apropiate
the .subscriptions file with a dot at the begining has:
Lists/2011/fedora-kde_S01 Lists/2011/fedora-selinux MailPost/Mktgs Lists/2011/fedora-users_02
is only a partial list but has every mbox which I have in my email reader is listed there
not all existing mbox in ~/Mail/ are shown in my email reader, some are too ancient so I don't need them in that file
I have a file ~/Maildir/subscriptions (no dot). I'm not entirely clear what this contains, but it does seem that it is probably what I need, so I'll google to see exactly what it does. (I didn't see any mention of it in the KMail manual.)
the .subscriptions or subscriptions file is created and managed by dovecot
more info well only a bit in http://wiki.dovecot.org/MissingMailboxes under subscriptions and after in migration link
Gabriel
Gabriel Ramirez wrote:
not all existing mbox in ~/Mail/ are shown in my email reader, some are too ancient so I don't need them in that file
Thanks again.
But what do you do if you want to look at ancient email? I don't see any facility in KMail to do that?
I have a file ~/Maildir/subscriptions (no dot). I'm not entirely clear what this contains, but it does seem that it is probably what I need, so I'll google to see exactly what it does. (I didn't see any mention of it in the KMail manual.)
the .subscriptions or subscriptions file is created and managed by dovecot
more info well only a bit in http://wiki.dovecot.org/MissingMailboxes under subscriptions and after in migration link
I'm using maildir format throughout, as I mentioned. Everything is stored in ~/Maildir/ , with folders like ~/Maildir/.In-08 . The file ~/Maildir/subscriptions contains entries, eg In-08, exactly corresponding to the folders I see in KMail (minus the dots).
I have a folder ~/Maildir/Archive/ where I have put some ancient email, eg the folder ~/Maildir/Archive/In-02/ is in maildir format with sub-folders cur,new,tmp (the last two being empty). But I see no way of listing the email in this folder in KMail. I can view an individual email in the folder by "kmail --msg <filename>" but this is impractical as there are dozens of files in the folder.
I looked quickly at the dovecot documentation you mention, but didn't find anything helpful. I'll have a closer look at it though.
Basically, to re-phrase my original query: How can one "archive" old email in dovecot/KMail so that it is not listed by a KMail client but can nevertheless be accessed without too much difficulty?
On Wednesday, February 02, 2011 10:22:04 am Timothy Murphy wrote:
Gabriel Ramirez wrote:
I'm using maildir format throughout, as I mentioned. Everything is stored in ~/Maildir/ , with folders like ~/Maildir/.In-08 . The file ~/Maildir/subscriptions contains entries, eg In-08, exactly corresponding to the folders I see in KMail (minus the dots).
I have a folder ~/Maildir/Archive/ where I have put some ancient email, eg the folder ~/Maildir/Archive/In-02/ is in maildir format with sub-folders cur,new,tmp (the last two being empty).
Well, if you want it to be accessible via IMAP it needs more than that. You will have to follow the maildir format for dovecot. In my case, I have: ~/Maildir.Archive. I think with dovecot IMAP sub-folder is represented as dot. So if you want something like this to show in Kmail:
Archive In-02 (this contains the mails)
Then I think you should have something like this: ~/Maildir.Archive.In-02/{cur, new, tmp} Now you can put all the mail (one file for each mail under: ~/Maildir.Archive.In-02/cur/
This should just show up in Kmail. If you don't want in to show up, right click on the Account Name (in Kmail Folder list) and edit local subscription (or you can try also server subscription).
In the past, I found it easier to set up the IMAP folder like I want it via Kmail, then look at the server side to see what's been set, and then copy the mail files manually.
AC
Armelius Cameron wrote:
I have a folder ~/Maildir/Archive/ where I have put some ancient email, eg the folder ~/Maildir/Archive/In-02/ is in maildir format with sub-folders cur,new,tmp (the last two being empty).
Well, if you want it to be accessible via IMAP it needs more than that. You will have to follow the maildir format for dovecot. In my case, I have: ~/Maildir.Archive. I think with dovecot IMAP sub-folder is represented as dot. So if you want something like this to show in Kmail:
Archive In-02 (this contains the mails)
Then I think you should have something like this: ~/Maildir.Archive.In-02/{cur, new, tmp} Now you can put all the mail (one file for each mail under: ~/Maildir.Archive.In-02/cur/
Thanks for the advice, which I shall follow.
I must say, it seems rather complicated for what must be a fairly common requirement - to archive old mail.
On 02/02/2011 09:22 AM, Timothy Murphy wrote:
I'm using maildir format throughout, as I mentioned. Everything is stored in ~/Maildir/ , with folders like ~/Maildir/.In-08 . The file ~/Maildir/subscriptions contains entries, eg In-08, exactly corresponding to the folders I see in KMail (minus the dots).
I have a folder ~/Maildir/Archive/ where I have put some ancient email, eg the folder ~/Maildir/Archive/In-02/ is in maildir format with sub-folders cur,new,tmp (the last two being empty). But I see no way of listing the email in this folder in KMail. I can view an individual email in the folder by "kmail --msg<filename>" but this is impractical as there are dozens of files in the folder.
seems maildir don't supports physical subdirectories at first so you cannot have a maildir mailbox under ~/Maildir/Archive/ you need to create a dir directly in ~/Maildir/.Archive.In-02/
if you need a maildir subfolder of another as in your example need a dovecot 1.1+ and modify the configuration
more info in:
http://wiki.dovecot.org/MailLocation/Maildir
I looked quickly at the dovecot documentation you mention, but didn't find anything helpful. I'll have a closer look at it though.
Basically, to re-phrase my original query: How can one "archive" old email in dovecot/KMail so that it is not listed by a KMail client but can nevertheless be accessed without too much difficulty?
well I don't use kmail but under a imap server the client is more or less irrelevant you only need subscribe and unsubscribe the ancient mailboxes when needed them in your email client
Gabriel
Gabriel Ramirez wrote:
seems maildir don't supports physical subdirectories at first so you cannot have a maildir mailbox under ~/Maildir/Archive/ you need to create a dir directly in ~/Maildir/.Archive.In-02/
Maildir format in dovecot/KMail _does_ support subdirectories - sorry if I gave the opposite impression. eg (in my case) ~/Maildir/.Family.Brian , which KMail sees as Gayleard/Family/Brian (Gayleard being the name of the KMail account).
On Tuesday 01 February 2011 13:01:55 Timothy Murphy wrote:
I keep my email on a CentOS server, in ~/Maildir/ . I run dovecot/IMAP on the server, so that I can read the email on various Fedora laptops.
I want to off-load some email folders containing old email, eg In-05, Out-05, etc, perhaps to a directory ~/Archive/ .
a) What is the best way to do this? Would simply mv-ing ~/Maildir/.In-05 to ~/Archive/ confuse dovecot?
b) If I then want to read the old email in ~/Archive/ how can I do this with KMail?
Any suggestions or advice gratefully received.
I did the same. In my case since I was unsure what to do I used kmail to transfer all the mail to the dovecot server I created, using an imap interface. Inefficient? No doubt, but it worked and I did not care anymore about it... :-)