Injecting a mail folder into a users inbox/restore from backup

2012-12-05 Thread Lars Schimmer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi!

Aas I never needed to do it yet, I want to ask for the best way to
restore users email which got lost...

Situation: running cyrus on debian with users and mailboxes.
User deleted on accident a folder in his INBOX (and cyrus did unlinked
the files and removed the folder from disk already).
I do backup from the INBOX structures on disk every night (in a basic
simple way, see it as a snapshot of the mail disks of cyrus).

Now I need a good way to inject the "old" folder user.xyz.INBOX.Folder
into the live cyrus system.
Is it easier to create a new user and copy with imap client?
Or just copy the folder content into a new created folder on users inbox?

Thank you.

MfG,
Lars Schimmer
- -- 
- -
TU Graz, Institut für ComputerGraphik & WissensVisualisierung
Tel: +43 316 873-5405   E-Mail: l.schim...@cgv.tugraz.at
Fax: +43 316 873-5402   PGP-Key-ID: 0x4A9B1723


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlC/JkoACgkQmWhuE0qbFyNrNACfRD7QalOcmmiW2SNAZt+2aVWL
zVIAniytUVV294hPPfHHBJ9o+rSZDgOu
=t7W7
-END PGP SIGNATURE-

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-05 Thread Adam Tauno Williams
On Wed, 2012-12-05 at 11:47 +0100, Lars Schimmer wrote:
> Hi!
> Aas I never needed to do it yet, I want to ask for the best way to
> restore users email which got lost...
> Situation: running cyrus on debian with users and mailboxes.
> User deleted on accident a folder in his INBOX (and cyrus did unlinked
> the files and removed the folder from disk already).
> I do backup from the INBOX structures on disk every night (in a basic
> simple way, see it as a snapshot of the mail disks of cyrus).
> Now I need a good way to inject the "old" folder user.xyz.INBOX.Folder
> into the live cyrus system.
> Is it easier to create a new user and copy with imap client?
> Or just copy the folder content into a new created folder on users inbox?

I typically just copy the message file(s) back, or in this case the
folder, and run "reconstruct -r -f -k -s user.dude".  Hasn't failed me
yet.

A more elegant way would be nice, but until there is some type of
dump/restore format, moving files around is what you've got.
-- 
Adam Tauno Williams 
System Administrator, OpenGroupware Developer, LPI / CNA
Fingerprint 8C08 209A FBE3 C41A DD2F A270 2D17 8FA4 D95E D383


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-05 Thread Marc Patermann
Lars,

Lars Schimmer schrieb (05.12.2012 11:47 Uhr):

> Aas I never needed to do it yet, I want to ask for the best way to
> restore users email which got lost...
best is to try before you need it! ;)

> Situation: running cyrus on debian with users and mailboxes.
> User deleted on accident a folder in his INBOX (and cyrus did unlinked
> the files and removed the folder from disk already).
> I do backup from the INBOX structures on disk every night (in a basic
> simple way, see it as a snapshot of the mail disks of cyrus).
> 
> Now I need a good way to inject the "old" folder user.xyz.INBOX.Folder
> into the live cyrus system.
> Is it easier to create a new user and copy with imap client?
> Or just copy the folder content into a new created folder on users inbox?
Just copy back the file to the uses mailspool. Since mails are numbered 
in ascending order no file may be overwriten. Check for ownership and 
rights!
Reconstruct the mailbox with "-rf".
reconstruct should discover the now new mailboxes (if you restore whole 
folders), if not you may create them with cyradm.
Sometime we create a new mailbox - like user.foo.restore - where we 
restore the file, so the user see what was restored and can move it to 
the place he wants it himself.

Marc

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-05 Thread John Wade
We typically create a subfolder of the user's mailbox via cyradm or IMAP 
commands, restore the files from the backup into this subdirectory and 
run reconstruct.

Requires no thought.   Have used this far less since the delayed expunge 
was introduced.

Hope this helps,
John Wade
Oakton Community College

On 12/5/2012 5:03 AM, Adam Tauno Williams wrote:
> On Wed, 2012-12-05 at 11:47 +0100, Lars Schimmer wrote:
>> Hi!
>> Aas I never needed to do it yet, I want to ask for the best way to
>> restore users email which got lost...
>> Situation: running cyrus on debian with users and mailboxes.
>> User deleted on accident a folder in his INBOX (and cyrus did unlinked
>> the files and removed the folder from disk already).
>> I do backup from the INBOX structures on disk every night (in a basic
>> simple way, see it as a snapshot of the mail disks of cyrus).
>> Now I need a good way to inject the "old" folder user.xyz.INBOX.Folder
>> into the live cyrus system.
>> Is it easier to create a new user and copy with imap client?
>> Or just copy the folder content into a new created folder on users inbox?
> I typically just copy the message file(s) back, or in this case the
> folder, and run "reconstruct -r -f -k -s user.dude".  Hasn't failed me
> yet.
>
> A more elegant way would be nice, but until there is some type of
> dump/restore format, moving files around is what you've got.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-11 Thread Michael Neumann
Am 05.12.2012 15:19, schrieb John Wade:
> We typically create a subfolder of the user's mailbox via cyradm or IMAP 
> commands, restore the files from the backup into this subdirectory and 
> run reconstruct.
> 
> Requires no thought.   Have used this far less since the delayed expunge 
> was introduced.

Hello,

delayed expunge sounds interesting to me, so far we used reconstruct to
recover deleted mail from our backups. So i need the option expunge_mode
set to delayed. Do i also need to set the option delete_mode to delayed?
Most restore operations we have to do are about whole folders that have
been deleted.

Best regards
Michael
-- 
Michael Neumann
michael.neum...@ub.tu-dortmund.de
Universitaetsbibliothek Dortmund
Bibliotheks-IT
Telefon: +49 231 755 4773

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-11 Thread Michael Menge

Hi,

Quoting Michael Neumann :


Am 05.12.2012 15:19, schrieb John Wade:

We typically create a subfolder of the user's mailbox via cyradm or IMAP
commands, restore the files from the backup into this subdirectory and
run reconstruct.

Requires no thought.   Have used this far less since the delayed expunge
was introduced.


Hello,

delayed expunge sounds interesting to me, so far we used reconstruct to
recover deleted mail from our backups. So i need the option expunge_mode
set to delayed. Do i also need to set the option delete_mode to delayed?
Most restore operations we have to do are about whole folders that have
been deleted.


expunge_mode is only for mails, delete_mode is the option for
folders but works slightly different. The deleted folder is
moved to a special folder (option deletedprefix in imapd.conf)
You can restore the folder with cyradm by movin it to the old
place.

cyr_expire will remove the old mails an folders. Take a look at
the options and configure a cyr_expire run in the EVENT section
of cyrus.conf

Regards

   Michael Menge




M.MengeTel.: (49) 7071/29-70316
Universität Tübingen   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung  mail:  
michael.me...@zdv.uni-tuebingen.de

Wächterstraße 76
72074 Tübingen

smime.p7s
Description: S/MIME Signatur

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-11 Thread Michael Neumann
Am 12.12.2012 08:35, schrieb Michael Menge:
> 
> expunge_mode is only for mails, delete_mode is the option for
> folders but works slightly different. The deleted folder is
> moved to a special folder (option deletedprefix in imapd.conf)
> You can restore the folder with cyradm by movin it to the old
> place.
> 
> cyr_expire will remove the old mails an folders. Take a look at
> the options and configure a cyr_expire run in the EVENT section
> of cyrus.conf

Thanks, so the delete_duration for mailboxes is set using the -D option
of cyr_expire. I am now unsure about expunge_mode, there is an option
expunge_days in imapd.conf and the -X option of cyr_expire, how do those
two options work together?

Best Regards
Michael
-- 
Michael Neumann
michael.neum...@ub.tu-dortmund.de
Universitaetsbibliothek Dortmund
Bibliotheks-IT
Telefon: +49 231 755 4773

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-12 Thread Sebastian Hagedorn
--On 12. Dezember 2012 08:51:58 +0100 Michael Neumann 
 wrote:



Am 12.12.2012 08:35, schrieb Michael Menge:


expunge_mode is only for mails, delete_mode is the option for
folders but works slightly different. The deleted folder is
moved to a special folder (option deletedprefix in imapd.conf)
You can restore the folder with cyradm by movin it to the old
place.

cyr_expire will remove the old mails an folders. Take a look at
the options and configure a cyr_expire run in the EVENT section
of cyrus.conf


Thanks, so the delete_duration for mailboxes is set using the -D option
of cyr_expire. I am now unsure about expunge_mode, there is an option
expunge_days in imapd.conf and the -X option of cyr_expire, how do those
two options work together?


It pays to read the archive:


--
   .:.Sebastian Hagedorn - Weyertal 121 (Gebäude 133), Zimmer 2.02.:.
.:.Regionales Rechenzentrum (RRZK).:.
  .:.Universität zu Köln / Cologne University - ✆ +49-221-470-89578.:.

p7skE32wXDfpi.p7s
Description: S/MIME cryptographic signature

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-12 Thread Michael Neumann
Am 12.12.2012 10:20, schrieb Sebastian Hagedorn:
> 
> It pays to read the archive:
> 
> 

Yes, sorry and thanks, that clarifies it.

Best Regards
Michael
-- 
Michael Neumann
michael.neum...@ub.tu-dortmund.de
Universitaetsbibliothek Dortmund
Bibliotheks-IT
Telefon: +49 231 755 4773

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Injecting a mail folder into a users inbox/restore from backup

2012-12-12 Thread Nic Bernstein

On 12/12/2012 08:16 AM, Michael Neumann wrote:

Am 12.12.2012 10:20, schrieb Sebastian Hagedorn:

It pays to read the archive:



Yes, sorry and thanks, that clarifies it.


For what it's worth, you can also set expire times, for specific 
mailboxes, via annotations.  We frequently use a script like this to 
handle such a task on a regular basis, to accommodate users who delete 
and recreate mailboxes we wish to handle exceptionally:

-
#!/bin/sh
#
# set_cyrus_annotations.sh - Set the standard annotations for the Spam,
#Trash and systems mailboxes so they expire
#properly.
#
USER=
PASS=secret
HOST=localhost

cyradm -u $USER -w "$PASS" $HOST << _EOF_
mboxcfg systems expire 60
mboxcfg user/%/Spam expire 7
mboxcfg user/%/Trash expire 2
_EOF_
-

Also, as to documentation, the Kolab folks have some good info available 
here 
, 
including a step-by-step guide to locating and restoring (via cyradm 
rename) deleted mailboxes.  This is the way to go, and the Perl example 
there shows how to make sense of the datestamp on folders in the DELETED 
hierarchy.


Cheers,
-nic

--
Nic Bernstein n...@onlight.com
Onlight, Inc. www.onlight.com
219 N. Milwaukee St., Suite 2av. 414.272.4477
Milwaukee, Wisconsin  53202


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus