2016-09-19 17:17:24 +02:00
|
|
|
#!/bin/cat
|
2019-07-03 01:17:46 +02:00
|
|
|
$Id: FAQ.Archiving.txt,v 1.13 2018/12/09 21:26:25 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:
|
|
|
|
|
|
|
|
Q. Can I archive different accounts on the same destination account,
|
|
|
|
each account on a separate folder?
|
|
|
|
|
|
|
|
Q. How to move emails from one IMAP folder to another either on the
|
|
|
|
same IMAP server or a different one?
|
|
|
|
For example, all messages older than 1 year, move from INBOX to Archive.
|
|
|
|
|
|
|
|
Q. Can imapsync be used to maintain a local offline copy of a
|
|
|
|
mailbox from host1, eg for backup purposes, so that if the
|
|
|
|
server fails, then the mailbox could be reinstated,
|
|
|
|
ideally without requiring a second IMAP host?
|
|
|
|
|
|
|
|
|
2017-09-23 23:54:48 +02:00
|
|
|
=======================================================================
|
|
|
|
Q. Can I archive different accounts on the same destination account,
|
|
|
|
each account on a separate folder?
|
|
|
|
|
|
|
|
R. Yes. Use --subfolder2
|
|
|
|
|
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
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
imapsync ... --user1 foo --subfolder2 foo
|
|
|
|
|
|
|
|
imapsync ... --user1 bar --subfolder2 bar
|
|
|
|
|
|
|
|
In case you need a strict sync, add --delete2 --delete2foldersonly "foo"
|
|
|
|
(or "bar"), il will delete on account2 what is not on account1 but only
|
|
|
|
in the right place, ie, the subfolder "foo".
|
|
|
|
|
|
|
|
imapsync ... --user1 foo --subfolder2 foo --delete2 --delete2foldersonly "foo"
|
|
|
|
|
2016-09-19 17:17:24 +02:00
|
|
|
=======================================================================
|
|
|
|
Q. How to move emails from one IMAP folder to another either on the
|
|
|
|
same IMAP server or a different one?
|
2019-07-03 01:17:46 +02:00
|
|
|
For example, move all messages older than 1 year 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
|
|
|
=======================================================================
|
|
|
|
Q. Can imapsync be used to maintain a local offline copy of a
|
|
|
|
mailbox from host1, eg for backup purposes, so that if the
|
|
|
|
server fails, then the mailbox could be reinstated,
|
|
|
|
ideally without requiring a second IMAP host?
|
|
|
|
|
|
|
|
R1. No. Imapsync plays with imap servers only.
|
|
|
|
|
|
|
|
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
|
|
|
|
2017-09-23 23:54:48 +02:00
|
|
|
=======================================================================
|
2018-05-07 16:04:23 +02:00
|
|
|
=======================================================================
|
|
|
|
|