Skip to content

Commit

Permalink
Small tweaks to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinsf committed Jun 14, 2021
1 parent d090026 commit ec56dbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To be more exact, it *marks* the second and later occurrences of a message as 'd

Some mail clients will let you still view such messages *in situ*, so you can take a look at what's happened before 'compacting' the mailbox. Sometimes deleted messages appear in a 'Trash' folder. Sometimes they are hidden and can be displayed and un-deleted if wanted, until they are purged.

Whatever your system does, you will usually have the option to see what has been deleted, and to recover it if needed, using your email program, after running this script. (If your server purges the deleted messages automatically, you may be able to prevent this with the `--no-close` option. See also the `-t` option if your IMAP server supports custom tags.)
Whatever your system does, you will usually have the option to see what has been deleted, and to recover it if needed, using your email program, after running this script. (If your server purges the deleted messages automatically, you may be able to prevent this with the `--no-close` option.) There is also a 'dry-run' option so you can check what might happen before doing anything scary.

## How it works

Expand Down Expand Up @@ -102,23 +102,23 @@ We don't curently have a way of storing your options in a configuration file, bu

imapdedup.process(*imapdedup.get_arguments(options + mboxes))

If you on a shared machine or filesystem and you are including sensitive information such as the password in this file, you may wish to set its permissions appropriately.
If you are on a shared machine or filesystem and you are including sensitive information such as the password in this file, you may wish to set its permissions appropriately.

## Checking ALL of your mailboxes

Several people have asked for an option to check for duplicates across ALL of your mailboxes. This isn't built-in for a couple of reasons. The main one is that when you specify multiple folders on the command line, IMAPdedup will search them in order, deleting duplicate messages from the later ones if they have been found in the earlier ones. If we added an 'All folders' option, we'd need a way to specify which ones came first: if you find duplicates in two or more mailboxes, which one(s) should be deleted?

So my proposed workaround if you're in this situation is to ask the program for a list of all your folders, put those in a file, edit that file as wanted (e.g. to change the order, or exclude particular folders), and then use `xargs` to pass all the folder names in the file to IMAPdedup.

Here's a quick demo. Imagine you normally run this:
Here's a quick demo. Imagine you normally run IMAPdedup like this:

./imapdedup.py -x -s servername -u username -w password ...

You can save your list of folders to a file called folders.txt like this:

./imapdedup.py -x -s servername -u username -w password -l > folders.txt

The `xargs` utility lets you read words (or lines) from the standard input, and run any command passing those words as arguments to the command, so you can do something like this (I've included the -n so it's a dry run and should be safe if you try it!):
The standard unix `xargs` utility lets you read a list of words (or lines) from the standard input and run another command passing those words from the list as arguments. So you can do something like this (I've included the -n so it's a dry run and should be safe if you try it!):

cat folders.txt | xargs ./imapdedup.py -x -s servername -u username -w password -n

Expand Down

0 comments on commit ec56dbd

Please sign in to comment.