| 1 |
.. cyrusman:: unexpunge(8) |
| 2 |
|
| 3 |
.. author: Nic Bernstein (Onlight) |
| 4 |
.. author: Jeroen van Meeuwen (Kolab Systems) |
| 5 |
|
| 6 |
.. _imap-reference-manpages-systemcommands-unexpunge: |
| 7 |
|
| 8 |
============= |
| 9 |
**unexpunge** |
| 10 |
============= |
| 11 |
|
| 12 |
Recover messages the user has (accidentally) deleted. |
| 13 |
|
| 14 |
Synopsis |
| 15 |
======== |
| 16 |
|
| 17 |
.. parsed-literal:: |
| 18 |
|
| 19 |
**unexpunge** [ **-C** *config-file* ] **-l** *mailbox* [ *uid*... ] |
| 20 |
**unexpunge** [ **-C** *config-file* ] **-t** *time-interval* [ **-d** ] [ **-v** ] [ **-f** *flagname* ] **mailbox** |
| 21 |
**unexpunge** [ **-C** *config-file* ] **-a** [ **-d** ] [ **-v** ] [ **-f** *flagname* ] *mailbox* |
| 22 |
**unexpunge** [ **-C** *config-file* ] **-u** [ **-d** ] [ **-v** ] [ **-f** *flagname* ] *mailbox* *uid*... |
| 23 |
|
| 24 |
Description |
| 25 |
=========== |
| 26 |
|
| 27 |
The **unexpunge** program is used to list or restore messages which have |
| 28 |
been deleted from a mailbox, but still reside in the Cyrus IMAP mail |
| 29 |
spool. |
| 30 |
|
| 31 |
This utility is only useful when the server is configured with |
| 32 |
``expunge_mode`` set to ``delayed`` in its configuration file. |
| 33 |
|
| 34 |
**unexpunge** |default-conf-text| |
| 35 |
|
| 36 |
Options |
| 37 |
======= |
| 38 |
|
| 39 |
.. program:: unexpunge |
| 40 |
|
| 41 |
.. option:: -C config-file |
| 42 |
|
| 43 |
|cli-dash-c-text| |
| 44 |
|
| 45 |
.. option:: -l, --list |
| 46 |
|
| 47 |
List the expunged messages in the specified mailbox which are |
| 48 |
available for restoration. |
| 49 |
Optionally, only list the messages in the mailbox matching the |
| 50 |
UIDs in the space\-separated list at the end of the command invocation. |
| 51 |
|
| 52 |
.. option:: -t time-interval, --within-time-interval=time-interval |
| 53 |
|
| 54 |
Unexpunge messages which were expunged within the last |
| 55 |
``time-interval`` seconds. |
| 56 |
Use one of the trailing modifiers -- ``m`` (minutes), ``h`` (hours), |
| 57 |
``d`` (days) or ``w`` (weeks) -- to specify a different time unit. |
| 58 |
|
| 59 |
.. option:: -a, --all |
| 60 |
|
| 61 |
Restore **all** of the expunged messages in the specified mailbox. |
| 62 |
|
| 63 |
.. option:: -u, --uids |
| 64 |
|
| 65 |
Restore only messages matching the UIDs, in a space-separated list |
| 66 |
at the end of the command invocation, in the specified mailbox. |
| 67 |
|
| 68 |
.. option:: -d, --unset-deleted |
| 69 |
|
| 70 |
Unset the *\\Deleted* flag on any restored messages. |
| 71 |
|
| 72 |
.. option:: -f flagname, --set-flag=flagname |
| 73 |
|
| 74 |
Set the user flag *\\flagname* on the messages restored, making it |
| 75 |
easier for the user(s) to find the restored messages and operate on |
| 76 |
them (in a batch). |
| 77 |
|
| 78 |
.. option:: -v, --verbose |
| 79 |
|
| 80 |
Enable verbose output/logging. |
| 81 |
|
| 82 |
Examples |
| 83 |
======== |
| 84 |
|
| 85 |
.. parsed-literal:: |
| 86 |
|
| 87 |
**unexpunge -l** *user/[email protected]* |
| 88 |
|
| 89 |
.. |
| 90 |
|
| 91 |
List the messages that are expunged and could be restored for mailbox |
| 92 |
*user/[email protected]*. |
| 93 |
|
| 94 |
.. only:: html |
| 95 |
|
| 96 |
:: |
| 97 |
|
| 98 |
UID: 278786 |
| 99 |
Size: 2548 |
| 100 |
Sent: Sat Mar 7 12:00:00 2015 |
| 101 |
Recv: Sat Mar 7 12:42:52 2015 |
| 102 |
Expg: Sun Mar 8 14:37:43 2015 |
| 103 |
From: <[email protected]> |
| 104 |
To : <[email protected]> |
| 105 |
Cc : |
| 106 |
Bcc : |
| 107 |
Subj: "pghmcfc submitted milter-greylist-4.5.12-2.fc21 to testing" |
| 108 |
|
| 109 |
UID: 278787 |
| 110 |
Size: 2545 |
| 111 |
Sent: Sat Mar 7 12:00:00 2015 |
| 112 |
Recv: Sat Mar 7 12:42:52 2015 |
| 113 |
Expg: Sun Mar 8 14:37:43 2015 |
| 114 |
From: <[email protected]> |
| 115 |
To : <[email protected]> |
| 116 |
Cc : |
| 117 |
Bcc : |
| 118 |
Subj: "pghmcfc submitted milter-greylist-4.5.12-2.el7 to testing" |
| 119 |
|
| 120 |
UID: 278788 |
| 121 |
Size: 2548 |
| 122 |
Sent: Sat Mar 7 12:00:00 2015 |
| 123 |
Recv: Sat Mar 7 12:42:53 2015 |
| 124 |
Expg: Sun Mar 8 14:37:43 2015 |
| 125 |
From: <[email protected]> |
| 126 |
To : <[email protected]> |
| 127 |
Cc : |
| 128 |
Bcc : |
| 129 |
Subj: "pghmcfc submitted milter-greylist-4.5.12-2.fc20 to testing" |
| 130 |
|
| 131 |
.. parsed-literal:: |
| 132 |
|
| 133 |
**unexpunge -u** *user/[email protected] 278787 278788* |
| 134 |
|
| 135 |
.. |
| 136 |
|
| 137 |
Unexpunge two of these messages. |
| 138 |
|
| 139 |
.. only:: html |
| 140 |
|
| 141 |
:: |
| 142 |
|
| 143 |
restoring expunged messages in mailbox 'example/org!user/john' |
| 144 |
restored 2 expunged messages |
| 145 |
|
| 146 |
.. NOTE:: |
| 147 |
The output of the unexpunge command may not match the input |
| 148 |
terms, in the case above, the mailbox ``user/[email protected]`` |
| 149 |
appears in the output as ``example/org!user/john``. |
| 150 |
|
| 151 |
.. parsed-literal:: |
| 152 |
|
| 153 |
**mbexamine** *user/[email protected]* |
| 154 |
|
| 155 |
.. |
| 156 |
|
| 157 |
Examine the mailbox for the two restored messages. |
| 158 |
|
| 159 |
.. only:: html |
| 160 |
|
| 161 |
:: |
| 162 |
|
| 163 |
(...snip...) |
| 164 |
000001> UID:00278862 INT_DATE:1425728572 SENTDATE:1425726000 SIZE:2545 |
| 165 |
> HDRSIZE:2259 LASTUPD :1425912731 SYSFLAGS:00000014 LINES:6 |
| 166 |
> CACHEVER:3 GUID:95349cd5d1cf21b55e6e0930b2ee5754f977ba8c MODSEQ:274250 CID: 0 |
| 167 |
> USERFLAGS: 00000000 00000000 00000000 00000000 |
| 168 |
Envel>{369}("Sat, 7 Mar 2015 11:42:47 +0000 (UTC)" "pghmcfc submitted milter-greylist-4.5.12-2.el7 to testing" (...snip...) |
| 169 |
BdyStr>{76}("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 286 6 NIL NIL NIL NIL) |
| 170 |
Body>{60}("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 286 6) |
| 171 |
CacHdr>{98}X-Spam-Score: -6.909 |
| 172 |
Message-Id: <[email protected]> |
| 173 |
|
| 174 |
From>{33}<[email protected]> |
| 175 |
To>{32}<[email protected]> |
| 176 |
Cc>{0} |
| 177 |
Bcc>{0} |
| 178 |
Subjct>{59}"pghmcfc submitted milter-greylist-4.5.12-2.el7 to testing" |
| 179 |
000001> UID:00278863 INT_DATE:1425728573 SENTDATE:1425726000 SIZE:2548 |
| 180 |
> HDRSIZE:2260 LASTUPD :1425912743 SYSFLAGS:00000014 LINES:6 |
| 181 |
> CACHEVER:3 GUID:e503646e389f507777fb75eeacc2da0d2156016a MODSEQ:274251 CID: 0 |
| 182 |
> USERFLAGS: 00000000 00000000 00000000 00000000 |
| 183 |
Envel>{370}("Sat, 7 Mar 2015 11:42:51 +0000 (UTC)" "pghmcfc submitted milter-greylist-4.5.12-2.fc20 to testing" (...snip...) |
| 184 |
BdyStr>{76}("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 288 6 NIL NIL NIL NIL) |
| 185 |
Body>{60}("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 288 6) |
| 186 |
CacHdr>{98}X-Spam-Score: -6.909 |
| 187 |
Message-Id: <[email protected]> |
| 188 |
|
| 189 |
From>{33}<[email protected]> |
| 190 |
To>{32}<[email protected]> |
| 191 |
Cc>{0} |
| 192 |
Bcc>{0} |
| 193 |
Subjct>{60}"pghmcfc submitted milter-greylist-4.5.12-2.fc20 to testing" |
| 194 |
(...snip...) |
| 195 |
|
| 196 |
.. parsed-literal:: |
| 197 |
|
| 198 |
**unexpunge -u -d** *user.johnsmith 46908* |
| 199 |
|
| 200 |
.. |
| 201 |
|
| 202 |
Unexpunge a select message based on its UID, clearing the |
| 203 |
*\\Deleted* flag. |
| 204 |
|
| 205 |
.. parsed-literal:: |
| 206 |
|
| 207 |
**unexpunge -a** *user.johnsmit.Trash* |
| 208 |
|
| 209 |
.. |
| 210 |
|
| 211 |
Unexpunge all messages in a user's Trash, but leave them |
| 212 |
flagged *\\Deleted*. |
| 213 |
|
| 214 |
.. parsed-literal:: |
| 215 |
|
| 216 |
**unexpunge -a -f** *\Flagged user.johnsmith.Trash* |
| 217 |
|
| 218 |
.. |
| 219 |
|
| 220 |
The same, but setting user flag *\\Flagged* to facilitate later |
| 221 |
bulk operations. |
| 222 |
|
| 223 |
.. parsed-literal:: |
| 224 |
|
| 225 |
**unexpunge -t** *24h* **-d -f** *\Flagged user.johnsmith* |
| 226 |
|
| 227 |
.. |
| 228 |
|
| 229 |
Unexpunge messages matching only a given time period. |
| 230 |
|
| 231 |
.. parsed-literal:: |
| 232 |
|
| 233 |
**unexpunge -t** *24h* **-d -f** *\Flagged user/johnsmith* |
| 234 |
|
| 235 |
.. |
| 236 |
|
| 237 |
The same command, supporting the ``unixhierarchysep: yes`` |
| 238 |
option in :cyrusman:`imapd.conf(5)`. |
| 239 |
|
| 240 |
Files |
| 241 |
===== |
| 242 |
/etc/imapd.conf |
| 243 |
|
| 244 |
See Also |
| 245 |
======== |
| 246 |
:cyrusman:`imapd.conf(5)` |