How to copy messages between mailboxes?

Raymond T. Sundland raymond at sundland.com
Wed Feb 25 18:12:55 EST 2009


I think it would be (better|easier|more effective) to:

1) Assign necessary permissions to mailbox A and mailbox B to user doing 
the moving.
2) Login to the imap server and move the mail
3) Unassign the permissions, if no longer needed.

It may even be possible to do this with sieve, automatically if needed?  
I haven't looked, I'm just guessing this is possible, maybe not.


Jason Voorhees wrote:
> Hi people:
>
> I'm trying to create a script to copy "certain" messages from a
> mailbox of user A to mailbox of user B. These are the steps I have in
> mind:
>
> 1. Select what messages to copy from mailbox of user A. They can
> message files located at different folders within its mailbox.
>
> 2. Choose where to copy messages in mailbox of user B.
>
> 3. Make the copy with cp and assign appropiate perms.
>
> 4. Reconstruct the mailbox of user B
>
> These would be the commands:
>
> # mkdir /var/spool/imap/a/user/B/Recent
> # cd /var/spool/imap/a/user/A
> # cp 234. 235. 236. Drafts/12* /var/spool/imap/a/user/B/Recent
> # chown -R cyrus:mail /var/spool/imap/a/user/B/Recent
> # su cyrus -c '/usr/lib/cyrus-imapd/reconstruct -r user/B'
>
> I thought this it would be enough, but I know I'm missing some things:
>
> 1. What name should I assign to message files being copied from A to
> B? I know that their name is equal to its UID. So, what's the value of
> the major UID? Does every folder mantain its own UID sequence?
> 2. There are no cyrus.header, cyrus.index nor cyrus.cache files at
> /var/spool/imap/a/user/B/Recent because I just created that directory.
> So... I don't need to copy those files from A because reconstruct will
> create them... is this right?
>
> I know my English isn't very good yet to explain my question
> correctly, but I hope someone can understands me to help me a bit with
> this.
>
> Thanks, bye
> ----
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
>   


More information about the Info-cyrus mailing list