2023-01-26 22:14:55 +01:00
|
|
|
This is mboxgrep.info, produced by makeinfo version 6.7 from
|
2018-10-04 21:28:05 +02:00
|
|
|
mboxgrep.texi.
|
|
|
|
|
|
|
|
|
|
INFO-DIR-SECTION Mail
|
|
|
|
|
START-INFO-DIR-ENTRY
|
|
|
|
|
* mboxgrep: (mboxgrep). A mail folder scanning utility.
|
|
|
|
|
END-INFO-DIR-ENTRY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Top, Up: (dir)
|
|
|
|
|
|
2023-01-26 22:14:55 +01:00
|
|
|
This file documents 'mboxgrep' (version 0.7.10), a mailbox scanning
|
2018-10-04 21:28:05 +02:00
|
|
|
utility.
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2000, 2001, 2002, 2003 Daniel Spiljar
|
|
|
|
|
|
|
|
|
|
* Menu:
|
|
|
|
|
|
|
|
|
|
* Introduction:: A short preface.
|
|
|
|
|
* Invoking:: Command-line arguments.
|
|
|
|
|
* Examples:: A few examples of usage.
|
|
|
|
|
* Bugs:: What to do with bugs and similar vermin.
|
|
|
|
|
|
|
|
|
|
* To Vicky:: Author's dedication.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Introduction, Next: Invoking, Up: Top
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
1 Introduction
|
|
|
|
|
**************
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'mboxgrep' is a small, non-interactive utility that scans mail folders
|
2018-10-04 22:07:27 +02:00
|
|
|
for messages matching regular expressions.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
It supports basic and extended POSIX regular expressions.
|
2018-10-04 22:32:37 +02:00
|
|
|
'Perl'-style regular expressions are supported as well, if 'mboxgrep' is
|
|
|
|
|
linked with PCRE library.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
Found messages can be either displayed on standard output, counted,
|
|
|
|
|
deleted, piped to a specified command, or copied to another mailbox.
|
|
|
|
|
|
|
|
|
|
It can read and write a variety of folder formats:
|
|
|
|
|
|
|
|
|
|
* mbox folders, either plain or compressed
|
|
|
|
|
* MH folders
|
|
|
|
|
* nnml and nnmh folders used by Gnus
|
2018-10-04 22:32:37 +02:00
|
|
|
* 'qmail'-style maildirs
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
Additionally, it can read mbox folders or output from another
|
2018-10-04 22:32:37 +02:00
|
|
|
'mboxgrep' process from standard input. It does so if a single dash (-)
|
|
|
|
|
is given as a file name.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Invoking, Next: Examples, Prev: Introduction, Up: Top
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
2 Command-Line Arguments
|
|
|
|
|
************************
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
The syntax of 'mboxgrep' invocation is:
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
mboxgrep [OPTIONS] PATTERN [MAILBOX]
|
|
|
|
|
|
|
|
|
|
* Menu:
|
|
|
|
|
|
|
|
|
|
* Miscellaneous::
|
|
|
|
|
* File locking::
|
|
|
|
|
* Regexp selection::
|
|
|
|
|
* Output control::
|
|
|
|
|
* Search scope selection::
|
|
|
|
|
* Mailbox type selection::
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Miscellaneous, Next: File locking, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--help'
|
|
|
|
|
'-h'
|
2018-10-04 21:28:05 +02:00
|
|
|
Display a brief help screen and exit.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--version'
|
|
|
|
|
'-V'
|
2018-10-04 21:28:05 +02:00
|
|
|
Display program version and copyright information and exit.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--recursive'
|
|
|
|
|
'-r'
|
2018-10-04 21:28:05 +02:00
|
|
|
Descend into directories recursively.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: File locking, Next: Regexp selection, Prev: Miscellaneous, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
When accessing mbox folders, 'mboxgrep' puts a shared lock on files by
|
|
|
|
|
default. Note that mbox folders normally should not be accessed without
|
|
|
|
|
locking.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--file-lock=METHOD'
|
|
|
|
|
'-l METHOD'
|
|
|
|
|
Specify file locking METHOD. 'mboxgrep' supports 'flock' and
|
|
|
|
|
'fcntl' file locking. However, one of these methods may be
|
2018-10-04 21:28:05 +02:00
|
|
|
unimplemented on your operating system and thus not available in
|
2018-10-04 22:32:37 +02:00
|
|
|
'mboxgrep' at run time. To disable file locking, specify 'none'.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--no-file-lock'
|
|
|
|
|
'-nl'
|
2018-10-04 21:28:05 +02:00
|
|
|
Do not attempt to lock mbox folder files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Regexp selection, Next: Output control, Prev: File locking, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--extended-regexp'
|
|
|
|
|
'-E'
|
2018-10-04 21:28:05 +02:00
|
|
|
PATTERN is an extended regular expression.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--basic-regexp'
|
|
|
|
|
'-G'
|
2018-10-04 21:28:05 +02:00
|
|
|
PATTERN is a basic regular expression.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--perl-regexp'
|
|
|
|
|
'-P'
|
2018-10-04 21:28:05 +02:00
|
|
|
PATTERN is a Perl regular expression.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--regexp=PATTERN'
|
|
|
|
|
'-e PATTERN'
|
2018-10-04 21:28:05 +02:00
|
|
|
Use PATTERN as a regular expression.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--ignore-case'
|
|
|
|
|
'-i'
|
2018-10-04 21:28:05 +02:00
|
|
|
Perform case-insensitive search.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--invert-match'
|
|
|
|
|
'-v'
|
|
|
|
|
Invert the sense of matching, i.e. select only non-matching
|
2018-10-04 21:28:05 +02:00
|
|
|
messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Output control, Next: Search scope selection, Prev: Regexp selection, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
By default, 'mboxgrep' writes found messages to standard output. The
|
|
|
|
|
options below change such behavior.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--count'
|
|
|
|
|
'-c'
|
2018-10-04 21:28:05 +02:00
|
|
|
Suppress normal output and print the count of matching (or
|
2018-10-04 22:32:37 +02:00
|
|
|
non-matching, if used with the '-v' option) messages.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--delete'
|
|
|
|
|
'-d'
|
2018-10-04 21:28:05 +02:00
|
|
|
Suppress normal output and delete selected messages.
|
|
|
|
|
|
|
|
|
|
Use with extreme caution.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--no-duplicates'
|
|
|
|
|
'-nd'
|
2018-10-04 21:28:05 +02:00
|
|
|
Ignore duplicate messages.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--output=FOLDER'
|
|
|
|
|
'-o FOLDER'
|
2018-10-04 21:28:05 +02:00
|
|
|
Suppress normal output and write messages to destination folder
|
|
|
|
|
FOLDER instead.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Note that 'mboxgrep' assumes the output folder is of the same
|
2018-10-04 21:28:05 +02:00
|
|
|
format as the input folder. Currently there is no possibility to
|
|
|
|
|
convert folders.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--pipe=COMMAND'
|
|
|
|
|
'-p COMMAND'
|
2018-10-04 21:28:05 +02:00
|
|
|
Suppress normal output and pipe each selected message to a separate
|
|
|
|
|
instance of COMMAND.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--no-messages'
|
|
|
|
|
'-s'
|
2018-10-04 21:28:05 +02:00
|
|
|
Suppress error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Search scope selection, Next: Mailbox type selection, Prev: Output control, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--headers'
|
|
|
|
|
'-H'
|
2018-10-04 21:28:05 +02:00
|
|
|
Match PATTERN against message headers.
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--body'
|
|
|
|
|
'-B'
|
2018-10-04 21:28:05 +02:00
|
|
|
Match PATTERN against message body.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Mailbox type selection, Prev: Search scope selection, Up: Invoking
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'--mailbox-format=FORMAT'
|
|
|
|
|
'-m FORMAT'
|
|
|
|
|
Specify mailbox FORMAT. Supported formats are 'mbox' (default),
|
|
|
|
|
'zmbox' (gzip compressed mbox), 'bz2mbox' (bzip2 compressed mbox)
|
|
|
|
|
'mh', 'nnml', 'nnmh', and 'maildir'.
|
2018-10-04 22:07:27 +02:00
|
|
|
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Examples, Next: Bugs, Prev: Invoking, Up: Top
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
3 Examples
|
|
|
|
|
**********
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Scan '$MAIL' for messages from Dirty Harry:
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2023-02-10 09:35:50 +01:00
|
|
|
mboxgrep -H '^From:.*callahan@sanfranciscopolice\.org' $MAIL
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
Re-mail to George messages that mention his name:
|
|
|
|
|
|
|
|
|
|
mboxgrep --pipe="/usr/lib/sendmail george" --ignore-case george ~/Mail/*
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Display all messages in folder '~/Mail/incoming', except those that
|
2018-10-04 21:28:05 +02:00
|
|
|
appear to originate from AOL:
|
|
|
|
|
|
|
|
|
|
mboxgrep -v -H '^Received:.*aol\.com' ~/Mail/incoming
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Do a case-insensitive scan of '~/Mail/incoming' for messages with
|
|
|
|
|
subject "Weekly News" and write them to folder '~/Mail/archive':
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
mboxgrep -o ~/Mail/archive -H -i '^Subject: Weekly News' ~/Mail/incoming
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Count _all_ messages stored in folder 'spam', ignoring duplicates:
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
mboxgrep -nd -c . spam
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: Bugs, Next: To Vicky, Prev: Examples, Up: Top
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
4 Detecting Vermin
|
|
|
|
|
******************
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Shortly, if 'mboxgrep' crashes and/or works differently than described
|
2023-02-10 09:35:50 +01:00
|
|
|
in this manual, you have found a bug.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
Please report bugs to <dspiljar@datatipp.se>. Instructions how to
|
|
|
|
|
reproduce the bug or output from a debugger would be highly appreciated.
|
2023-02-10 09:35:50 +01:00
|
|
|
Please do not, however, send any core dumps.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
File: mboxgrep.info, Node: To Vicky, Prev: Bugs, Up: Top
|
|
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
5 Author's Dedication
|
|
|
|
|
*********************
|
2018-10-04 21:28:05 +02:00
|
|
|
|
2018-10-04 22:32:37 +02:00
|
|
|
'Mboxgrep' is dedicated in loving memory of Vicky, my cat who died of
|
2018-10-04 22:07:27 +02:00
|
|
|
tumor on Sep 12, 2002.
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
You haven't been long with us, but you gave us a lot of joy and all
|
2018-10-04 22:32:37 +02:00
|
|
|
your big heart that stopped ticking too early. I will never forget you.
|
2018-10-04 21:28:05 +02:00
|
|
|
Sleep well, little friend.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tag Table:
|
|
|
|
|
Node: Top197
|
2023-01-26 22:14:55 +01:00
|
|
|
Node: Introduction596
|
|
|
|
|
Node: Invoking1465
|
|
|
|
|
Node: Miscellaneous1827
|
|
|
|
|
Node: File locking2112
|
|
|
|
|
Node: Regexp selection2749
|
|
|
|
|
Node: Output control3301
|
|
|
|
|
Node: Search scope selection4292
|
|
|
|
|
Node: Mailbox type selection4533
|
|
|
|
|
Node: Examples4854
|
2023-02-10 09:35:50 +01:00
|
|
|
Node: Bugs5678
|
|
|
|
|
Node: To Vicky6096
|
2018-10-04 21:28:05 +02:00
|
|
|
|
|
|
|
|
End Tag Table
|
2023-01-26 22:14:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
coding: utf-8
|
|
|
|
|
End:
|