Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 53 additions & 63 deletions docs/imapproc.1
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
.\" Automatically generated by Pandoc 2.5
.\" Automatically generated by Pandoc 3.1.9
.\"
.TH "IMAPPROC" "1" "" "User Commands" "User Commands"
.hy
.SH NAME
.PP
imapproc \- filter emails in remote IMAP folders
imapproc - filter emails in remote IMAP folders
.SH SYNOPSIS
.IP
.nf
\f[C]
imapproc \-H <host> \-u <user> \-\-password <password> [options]
imapproc \-H <host> \-u <user> \-\-password\-command <cmd> [options]
\f[R]
.fi
.EX
imapproc -H <host> -u <user> --password <password> [options]
imapproc -H <host> -u <user> --password-command <cmd> [options]
.EE
.SH DESCRIPTION
.PP
imapproc continuously monitors one or more remote IMAP folders and
processes mail in them according to user defined Python code in an
\f[I]rc file\f[R], a user defined piece of Python code.
It also logs its actions to a log file.
When there is no more mail to process, imaproc sleeps one second and
then checks again.
And so on.
To make imapproc exit after the first filtering run, pass the \-\-once
To make imapproc exit after the first filtering run, pass the --once
option.
.PP
imapproc keeps a list of folders in the IMAP account to process.
Expand All @@ -33,109 +28,107 @@ options, or by setting attributes on the processor object in the rc
file.
The rc file has priority over the command line options.
.PP
The typical folder to run imapproc on is \f[C]INBOX\f[R] but you can of
The typical folder to run imapproc on is \f[CR]INBOX\f[R] but you can of
course specify multiple folders to process.
.PP
The default location of the rc file for imapproc is
\f[C]\[ti]/.mailprocessing/imap.rc\f[R] and the default location of its
log file is \f[C]\[ti]/.mailprocessing/log\-imap\f[R].
\f[CR]\[ti]/.mailprocessing/imap.rc\f[R] and the default location of its
log file is \f[CR]\[ti]/.mailprocessing/log-imap\f[R].
.PP
imapproc can optionally reload the rc file whenever a modification is
detected (that is, the file\[aq]s mtime has changed).
This automatic reloading is turned off by default and can be enabled
either by passing the \f[C]\-\-auto\-reload\-rcfile\f[R] command line
option or by setting the \f[C]auto_reload_rcfile\f[R] property to
\f[C]True\f[R] on the processor object in the rc file.
either by passing the \f[CR]--auto-reload-rcfile\f[R] command line
option or by setting the \f[CR]auto_reload_rcfile\f[R] property to
\f[CR]True\f[R] on the processor object in the rc file.
.PP
imapproc writes its process ID to
\f[C]\[ti]/.mailprocessing/imapproc.pid\f[R] and uses that PID file for
\f[CR]\[ti]/.mailprocessing/imapproc.pid\f[R] and uses that PID file for
locking as well.
If you want to run multiple imapproc instances in parallel, use the
\f[C]\-\-pidfile\f[R] and \f[C]\-\-logfile\f[R] options to give each
\f[CR]--pidfile\f[R] and \f[CR]--logfile\f[R] options to give each
process a different PID and log file.
.SH OPTIONS
.SS Common options
.PP
maildirproc and imapproc both take the following common command line
options:
.TP
.B \-\-version
--version
show program\[aq]s version number and exit
.TP
.B \-h, \-\-help
-h, --help
show this help message and exit
.TP
.B \-\-auto\-reload\-rcfile
--auto-reload-rcfile
turn on automatic reloading of the rc file when it has been modified
.TP
.B \-\-dry\-run
just log what should have been done; implies \-\-once
--dry-run
just log what should have been done; implies --once
.TP
.B \-l FILE, \-\-logfile=FILE
send log to FILE instead of the default (\[ti]/.maildirproc/log\-imap
for imapproc and \[ti]/.maildirproc/log\-maildir for maildirproc).
-l FILE, --logfile=FILE
send log to FILE instead of the default (\[ti]/.maildirproc/log-imap for
imapproc and \[ti]/.maildirproc/log-maildir for maildirproc).
If you are running multiple maildirproc or imapproc instances, you must
specify a dedicated log file for each of these.
.TP
.B \-\-log\-level=INTEGER
--log-level=INTEGER
only include log messages with this log level or lower; defaults to 1
.TP
.B \-\-once
--once
only process the maildirs once and then exit; without this flag,
maildirproc will scan the maildirs continuously
.TP
.B \-r FILE, \-\-rcfile=FILE
-r FILE, --rcfile=FILE
use the given rc file instead of the default
(\[ti]/.maildirproc/default.rc)
.TP
.B \-\-test
test mode; implies \-\-dry\-run, \-\-once, \-\-logfile=\- and
\-\-verbose
--test
test mode; implies --dry-run, --once, --logfile=- and --verbose
.TP
.B \-v, \-\-verbose
-v, --verbose
increase log level one step
.SS imapproc specific options
.TP
.B \-C, \-\-cache\-headers
-C, --cache-headers
Whether to cache the email headers retrieved from the IMAP server.
By default caching is disabled.
.TP
.B \-\-cache\-file FILE
--cache-file FILE
Store the email header cache in FILE if caching is enabled.
If this is not specified explicitly,
\[ti]/.maildirproc/\f[I]HOST\f[R].cache will be used, where
\f[I]HOST\f[R] is the IMAP server\[aq]s host name passed set with the
\-\-host option.
--host option.
.TP
.B \-c CERT, \-\-certfile
-c CERT, --certfile
Use SSL certificate file CERT to verify IMAP server\[aq]s SSL
certificate (only relevant for IMAPS)
.TP
.B \-H HOST, \-\-host
-H HOST, --host
Connect to IMAP server HOST.
This option is mandatory
.TP
.B \-i INTERVAL, \-\-interval
-i INTERVAL, --interval
Scan IMAP folders for new email every INTERVAL seconds; defaults to 300;
will be ignored if \-\-once is specified as well
will be ignored if --once is specified as well
.TP
.B \-\-flag\-batchsize SIZE
--flag-batchsize SIZE
Batch size to use when fetching message flags.
Defaults to 200.
When there are more messages to fetch flags for, multiple FETCH commands
will be issued, each with SIZE or fewer messages.
Reduce this value if you experience session expiry during message flag
retrieval.
.TP
.B \-\-header\-batchsize SIZE
--header-batchsize SIZE
Batch size to use when fetching message headers.
Defaults to 200.
When there are more messages to fetch headers for, multiple FETCH
commands will be issued, each with SIZE or fewer messages.
Reduce this value if you experience session expiry during message header
retrieval.
.TP
.B \-\-folder\-prefix PREFIX
--folder-prefix PREFIX
Prefix folder names with the string PREFIX.
This is relevant for some IMAP servers that store all folders as
subfolders of INBOX.
Expand All @@ -144,59 +137,56 @@ not work with all server side IMAP implementations.
If this is the case for your IMAP server, use this option to specify a
prefix explicitly.
.TP
.B \-\-folder\-separator SEP
--folder-separator SEP
Use SEP as a separator for folder hierarchies.
By default, imapproc will determine the folder separator from the
server\[aq]s LIST response.
This should work fine for most IMAP servers.
.TP
.B \-p PW, \-\-interval
-p PW, --interval
Use password PW to authenticate against IMAP server; since this will
show up in the process list, this is mainly intended for debugging.
Use \-\-password\-command otherwise.
Either this option or \-\-password\-command is mandatory.
Use --password-command otherwise.
Either this option or --password-command is mandatory.
.TP
.B \-\-pidfile FILE
--pidfile FILE
Write the imapproc process\[aq] PID to FILE rather than the default
location \[ti]/.imapproc/imapproc.pid.
This file is also used for locking so if you need to run multiple
different imapproc processes in parallel you need to specify different
PID and log files for these.
.TP
.B \-\-password\-command CMD
--password-command CMD
Run command CMD and send use its output as the password to authenticate
against the IMAP server with.
This is the recommended approach for specifying the IMAP password.
Either this option or \-\-password is mandatory.
Either this option or --password is mandatory.
.TP
.B \-P PORT \-\-port
-P PORT --port
IMAP port to use.
Defaults to 143 if \-\-use\-ssl is not specified and 993 if it is.
Defaults to 143 if --use-ssl is not specified and 993 if it is.
.TP
.B \-s \-\-use\-ssl
-s --use-ssl
Use SSL to connect to the IMAP server (default: no).
.TP
.B \-U USER \-\-user
-U USER --user
Log in to the IMAP server with user name USER.
This option is mandatory.
.TP
.B \-\-insecure
--insecure
Do no certificate validation when connecting to an SSL IMAP server
(default: no).
This means the certificate subject names will be ignored, as will any
certificate authorities.
Your connection will not be protected from active attackers.
.SH EXAMPLES
.PP
For some examples, see the examples directory.
.SH SIGNALS
.PP
Both SIGINT and SIGTERM will cause imapproc to shut down cleanly, i.e.
it will close the IMAP connection and write the current in\-memory cache
it will close the IMAP connection and write the current in-memory cache
to disk upon receiving either of these signals.
.PP
SIGHUP will cause imapproc to close and re\-open its log file.
SIGHUP will cause imapproc to close and re-open its log file.
This can be used for online log rotation in continuous mode.
.SH SEE ALSO
.PP
maildirproc(1), mailprocessing(5)
Loading