1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/FAQ.d/FAQ.Archiving.txt

144 lines
5.6 KiB
Plaintext
Raw Normal View History

2016-09-19 17:17:24 +02:00
#!/bin/cat
2020-04-11 01:15:57 +02:00
$Id: FAQ.Archiving.txt,v 1.18 2019/10/23 17:56:28 gilles Exp gilles $
2016-09-19 17:17:24 +02:00
2019-07-03 01:17:46 +02:00
This documentation is also available online at
https://imapsync.lamiral.info/FAQ.d/
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
2016-09-19 17:17:24 +02:00
2019-07-03 01:17:46 +02:00
=======================================================================
Imapsync issues and tips about archiving
=======================================================================
2016-09-19 17:17:24 +02:00
2018-05-07 16:04:23 +02:00
Questions answered in this FAQ are:
2020-04-11 01:15:57 +02:00
Q. How can I archive different accounts on the same destination account,
2018-05-07 16:04:23 +02:00
each account on a separate folder?
2020-04-11 01:15:57 +02:00
Q. How can I restore a complete account archived in a subfolder, like
with the option --subfolder2?
2018-05-07 16:04:23 +02:00
Q. How to move emails from one IMAP folder to another either on the
2020-04-11 01:15:57 +02:00
same IMAP server or a different one?
For example, all messages older than 1 year, move from INBOX to Archive.
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
Q. Can imapsync be used to maintain and restore a local offline copy
of a mailbox, eg for backup purposes, using Mbox or Maildir
format, so that if the server fails, then the mailbox could be
reinstated?
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
Q. How to archive a whole year in a subfolder?
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
Q. How to archive a whole year in subfolders but without subsubfolders?
2019-07-03 01:25:47 +02:00
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
2017-09-23 23:54:48 +02:00
=======================================================================
2020-04-11 01:15:57 +02:00
Q. How can I archive different accounts on the same destination account,
2017-09-23 23:54:48 +02:00
each account on a separate folder?
2020-04-11 01:15:57 +02:00
R. Use --subfolder2
2017-09-23 23:54:48 +02:00
2019-07-03 01:17:46 +02:00
--subfolder2 str : Syncs the whole host1 folders hierarchy under the
host2 given folder str.
(It does it internally by adding two --regextrans2
options before all others.)
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
Examples:
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
imapsync ... --user1 Foo --subfolder2 FooArchiv
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
imapsync ... --user1 Bar --subfolder2 BarArchiv
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
In case you need a very strict sync, add options
--delete2 --delete2foldersonly "FooArchiv"
(or "BarArchiv" for the second example).
It will delete on account2 what is not on account1 but only in the right place,
ie, the subfolder "FooArchiv".
Examples:
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
imapsync ... --user1 Foo --subfolder2 FooArchiv --delete2 --delete2foldersonly "FooArchiv"
imapsync ... --user1 Bar --subfolder2 BarArchiv --delete2 --delete2foldersonly "BarArchiv"
=======================================================================
Q. How can I restore a complete account archived in a subfolder, like
with the option --subfolder2?
R. Use --subfolder1
--subfolder1 str : Syncs the host1 folders hierarchy under folder str
to the root hierarchy of host2.
It's the couterpart of a sync done by --subfolder2
when doing it in the reverse order.
Backup/Restore scenario:
Use --subfolder2 str for a backup to the folder str
on host2. Then use --subfolder1 str for restoring
from the folder str, after inverting
host1/host2 user1/user2 values.
Examples:
imapsync ... --user2 Foo --subfolder1 FooArchiv
imapsync ... --user2 Bar --subfolder1 BarArchiv
2016-09-19 17:17:24 +02:00
=======================================================================
Q. How to move emails from one IMAP folder to another either on the
2020-04-11 01:15:57 +02:00
same IMAP server or a different one?
For example, all messages older than 1 year, move from INBOX to Archive.
2016-09-19 17:17:24 +02:00
R1. Solution:
2019-07-03 01:17:46 +02:00
imapsync ... --minage 365 --folder Inbox --f1f2 INBOX=Archive --delete1 --noexpungeaftereach
2016-09-19 17:17:24 +02:00
Add option --noexpungeaftereach if speed is a concern.
2019-07-03 01:17:46 +02:00
Add option --delete1 if you want to move messages, instead of just copy/sync them.
2016-09-19 17:17:24 +02:00
R2. See also file FAQ.Folders_Mapping.txt
2019-07-03 01:17:46 +02:00
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
2018-05-07 16:04:23 +02:00
=======================================================================
2020-04-11 01:15:57 +02:00
Q. Can imapsync be used to maintain and restore a local offline copy
of a mailbox, eg for backup purposes, using Mbox or Maildir
format, so that if the server fails, then the mailbox could be
reinstated?
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
R1. No. Imapsync plays with IMAP servers only.
2018-05-07 16:04:23 +02:00
R2. Imapsync can't but rick-sanders-imap-tools can!
See https://github.com/andrewnimmo/rick-sanders-imap-tools
Back up and restore IMAP accounts with imapdump.pl and dumptoIMAP.pl
2019-07-03 01:17:46 +02:00
It looks like imapdump.pl has options to avoid duplicates and be
in an update mode. There are options -u -U
[-u] Don't dump messages already dumped
[-U] Don't dump message if it already exists in the dump directory
I wonder the difference, I've never used Rick's tools.
Remember that doing backups without trying the restore process
is more dangerous than doing no backups at all. No backups makes
people act in a safer way, well, usually...
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
R3. Use ImportExportTools for Mozilla Thunderbird by Paolo Kaosmos.
ImportExportTools does not do IMAP as a destination.
2017-09-23 23:54:48 +02:00
=======================================================================
2020-04-11 01:15:57 +02:00
Q. How to archive a whole year in a subfolder?
R.
imapsync ... --search "SENTSINCE 1-Jan-2018 SENTBEFORE 31-Dec-2018" \
--folder2 ARCHIVE_2018 --justfolders --dry
2018-05-07 16:04:23 +02:00
=======================================================================
2020-04-11 01:15:57 +02:00
Q. How to archive a whole year in subfolders but without subsubfolders?
imapsync ... --search "SENTSINCE 1-Jan-2018 SENTBEFORE 31-Dec-2018" \
--sep2 _ --regextrans2 's{(.*)}{Archive_$1_2018}' --justfolders --dry
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
=======================================================================
=======================================================================