forked from imapsync/imapsync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FAQ.Archiving.txt
143 lines (98 loc) · 5.6 KB
/
FAQ.Archiving.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/cat
$Id: FAQ.Archiving.txt,v 1.18 2019/10/23 17:56:28 gilles Exp gilles $
This documentation is also available online at
https://imapsync.lamiral.info/FAQ.d/
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
=======================================================================
Imapsync issues and tips about archiving
=======================================================================
Questions answered in this FAQ are:
Q. How can I archive different accounts on the same destination account,
each account on a separate folder?
Q. How can I restore a complete account archived in a subfolder, like
with the option --subfolder2?
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 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?
Q. How to archive a whole year in a subfolder?
Q. How to archive a whole year in subfolders but without subsubfolders?
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
=======================================================================
Q. How can I archive different accounts on the same destination account,
each account on a separate folder?
R. Use --subfolder2
--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.)
Examples:
imapsync ... --user1 Foo --subfolder2 FooArchiv
imapsync ... --user1 Bar --subfolder2 BarArchiv
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:
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
=======================================================================
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.
R1. Solution:
imapsync ... --minage 365 --folder Inbox --f1f2 INBOX=Archive --delete1 --noexpungeaftereach
Add option --noexpungeaftereach if speed is a concern.
Add option --delete1 if you want to move messages, instead of just copy/sync them.
R2. See also file FAQ.Folders_Mapping.txt
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt
=======================================================================
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?
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
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...
R3. Use ImportExportTools for Mozilla Thunderbird by Paolo Kaosmos.
ImportExportTools does not do IMAP as a destination.
=======================================================================
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
=======================================================================
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
=======================================================================
=======================================================================