Hlavní navigace

exipick

NAME

exipick - selectively display messages from an Exim queue

SYNOPSIS

exipick [<options>] [<criterion> [<criterion> ...]]

DESCRIPTION

exipick is a tool to display messages in an Exim queue. It is very similar to exiqgrep and is, in fact, a drop in replacement for exiqgrep. exipick allows you to select messages to be displayed using any piece of data stored in an Exim spool file. Matching messages can be displayed in a variety of formats.

QUICK START

Delete every frozen message from queue: exipick -zi | xargs exim -Mrm
Show only messages which have not yet been virus scanned: exipick '$received_protocol ne virus-scanned'
Run the queue in a semi-random order: exipick -i --random | xargs exim -M
Show the count and total size of all messages which either originated from localhost or have a received protocol of 'local': exipick --or --size --bpc   '$sender_host_address eq 127.0.0.1'   '$received_protocol eq local'
Display all messages received on the \s-1MSA\s0 port, ordered first by the sender's email domain and then by the size of the emails: exipick --sort sender_address_domain,message_size   '$received_port == 587'
Display only messages whose every recipient is in the example.com domain, also listing the \s-1IP\s0 address of the sending host: exipick --show-vars sender_host_address   '$each_recipients = example.com'
Same as above, but show values for all defined variables starting with sender_ and the number of recipients: exipick --show-vars ^sender_,recipients_count   '$each_recipients = example.com'

OPTIONS

"--and" Display messages matching all criteria (default)
"-b" Display messages in brief format (exiqgrep)
"-bp" Display messages in standard mailq format (default)
"-bpa" Same as -bp, show generated addresses also (exim)
"-bpc" Show a count of matching messages (exim)
"-bpr" Same as '-bp --unsorted' (exim)
"-bpra" Same as '-bpr --unsorted' (exim)
"-bpru" Same as '-bpu --unsorted' (exim)
"-bpu" Same as -bp, but only show undelivered messages (exim)
"-c" Show a count of matching messages (exiqgrep)
"--caseful" Make operators involving '=' honor case
"--charset" Override the default local character set for CW$header_ decoding
"-f Same as '$sender_address = <regexp>' (exiqgrep)
"--flatq" Use a single-line output format
"--freeze Save queue information in an quickly retrievable format
"--help" Display this output
"-i" Display only the message IDs (exiqgrep)
"-l" Same as -bp (exiqgrep)
"--not" Negate all tests.
"-o Same as '$message_age > <seconds>' (exiqgrep)
"--or" Display messages matching any criteria
"-R" Same as --reverse (exiqgrep)
"-r Same as '$recipients = <regexp>' (exiqgrep)
"--random" Display messages in random order
"--reverse" Display messages in reverse order
"-s Same as '$shown_message_size eq <string>' (exiqgrep)
"--spool Set the path to the exim spool to use
"--show-rules" Show the internal representation of each criterion specified
"--show-tests" Show the result of each criterion on each message
"--show-vars Show the value for <variable> for each displayed message. <variable> will be a regular expression if it begins with a circumflex.
"--size" Show the total bytes used by each displayed message
"--thaw Read queue information cached from a previous --freeze run
"--sort Display matching messages sorted according to <variable>
"--unsorted" Do not apply any sorting to output
"--version" Display the version of this command
"-x" Same as '!$deliver_freeze' (exiqgrep)
"-y" Same as '$message_age < <seconds>' (exiqgrep)
"-z" Same as '$deliver_freeze' (exiqgrep)

CRITERIA

Exipick decides which messages to display by applying a test against each message. The rules take the general form of '\s-1VARIABLE\s0 \s-1OPERATOR\s0 \s-1VALUE\s0'. For example, '$message_age > 60'. When exipick is deciding which messages to display, it checks the CW$message_age variable for each message. If a message's age is greater than 60, the message will be displayed. If the message's age is 60 or less seconds, it will not be displayed.
Multiple criteria can be used. The order they are specified does not matter. By default all criteria must evaluate to true for a message to be displayed. If the --or option is used, a message is displayed as long as any of the criteria evaluate to true.
See the \s-1VARIABLES\s0 and \s-1OPERATORS\s0 sections below for more details

OPERATORS

"\s-1BOOLEAN\s0" Boolean variables are checked simply by being true or false. There is no real operator except negation. Examples of valid boolean tests: '$deliver_freeze' '!$deliver_freeze'
"\s-1NUMERIC\s0" Valid comparisons are <, <=, >, >=, ==, and !=. Numbers can be integers or floats. Any number in a test suffixed with d, h, m, s, M, K, or B will be mulitplied by 86400, 3600, 60, 1, 1048576, 1024, or 1 respectively. Examples of valid numeric tests: '$message_age >= 3d' '$local_interface == 587' '$message_size < 30K'
"\s-1STRING\s0" The string operators are =, eq, ne, =~, and !~. With the exception of '=', the operators all match the functionality of the like-named perl operators. eq and ne match a string exactly. !~, =~, and = apply a perl regular expression to a string. The '=' operator behaves just like =~ but you are not required to place // around the regular expression. Examples of valid string tests: '$received_protocol eq esmtp' '$sender_address = example.com' '$each_recipients =~ /^a[a-z]{2,3}@example.com$/'
"\s-1NEGATION\s0" There are many ways to negate tests, each having a reason for existing. Many tests can be negated using native operators. For instance, >1 is the opposite of <=1 and eq and ne are opposites. In addition, each individual test can be negated by adding a ! at the beginning of the test. For instance, '!$acl_m1 =~ /^DENY$/' is the same as '$acl_m1 !~ /^DENY$/'. Finally, every test can be specified by using the command line argument --not. This is functionally equivilant to adding a ! to the beginning of every test.

VARIABLES

With a few exceptions the available variables match Exim's internal expansion variables in both name and exact contents. There are a few notable additions and format deviations which are noted below. Although a brief explanation is offered below, Exim's spec.txt should be consulted for full details. It is important to remember that not every variable will be defined for every message. For example, CW$sender_host_port is not defined for messages not received from a remote host.
Internally, all variables are represented as strings, meaning any operator will work on any variable. This means that '$sender_host_name > 4' is a legal criterion, even if it does not produce meaningful results. Variables in the list below are marked with a 'type' to help in choosing which types of operators make sense to use.
Identifiers B - Boolean variables S - String variables N - Numeric variables . - Standard variable matching Exim's content definition # - Standard variable, contents differ from Exim's definition + - Non-standard variable User definable variables. \s-1TRUE\s0 if unqualified recipient addresses are permitted in header lines. \s-1TRUE\s0 if unqualified sender addresses are permitted in header lines. Optional saved information from authenticators, or the login name of the calling process for locally submitted messages. The value of AUTH= param for smtp messages, or a generated value from the calling processes login and qualify domain for locally submitted messages. Value of the header(s) with the same name with any \s-1RFC2047\s0 words decoded if present. See section 11.5 of Exim's spec.txt for full details. The verdict string provided by a Brightmail content scan The number of lines in the message's body. The number of binary zero bytes in the message's body. \s-1TRUE\s0 if the message is currently frozen. The epoch time at which message was frozen. \s-1TRUE\s0 if, under normal circumstances, Exim will not try to deliver the message. This is a psuedo variable which allows you to apply a test against each address in CW$recipients individually. Whereas '$recipients =~ /@aol.com/' will match if any recipient address contains aol.com, '$each_recipients =~ /@aol.com$/' will only be true if every recipient matches that pattern. Note that this obeys --and or --or being set. Using it with --or is very similar to just matching against CW$recipients, but with the added benefit of being able to use anchors at the beginning and end of each recipient address. Like CW$each_recipients, but for CW$recipients_del Like CW$each_recipients, but for CW$recipients_undel \s-1TRUE\s0 if the message has never been deferred. This will always match the contents of the corresponding CW$bheader_* variable currently (the same behaviour Exim displays when iconv is not installed). \s-1TRUE\s0 if there was an attempt to look up the host's name from its \s-1IP\s0 address, but an error occurred that during the attempt. \s-1TRUE\s0 if there was an attempt to look up the host's name from its \s-1IP\s0 address, but the attempt returned a negative result. \s-1TRUE\s0 if the message is a locally-generated error message. The text returned by the local_scan() function when a message is received. \s-1TRUE\s0 when the message has been manually thawed. The number of seconds since the message was received. The message's body. Unlike Exim's variable of the same name, this variable contains the entire message body. Newlines and nulls are replaced by spaces. \s-1TRUE\s0 is a message's spool data file (-D file) is missing or unreadable. The size of the body in bytes. The unique message id that is used by Exim to identify the message. CW$message_id is deprecated as of Exim 4.53. A concatenation of all the header lines except for lines added by routers or transports. \s-1RFC2047\s0 decoding is performed A concatenation of all the header lines except for lines added by routers or transports. No decoding or translation is performed. The number of lines in the entire message (body and headers). The size of the message in bytes. The group id under which the process that called Exim was running as when the message was received. The login of the process which called Exim. The user id under which the process that called Exim was running as when the message was received. The address of the local \s-1IP\s0 interface for network-originated messages. CW$interface_address is deprecated as of Exim 4.64 The local port number if network-originated messages. CW$interface_port is deprecated as of Exim 4.64 The number of Received: header lines in the message. The name of the protocol by which the message was received. The epoch time at which the message was received. The list of envelope recipients for a message. Unlike Exim's version, this variable always contains every recipient of the message. The recipients are seperated by a comma and a space. See also CW$each_recipients. The number of envelope recipients for the message. The list of delivered envelope recipients for a message. This non-standard variable is in the same format as CW$recipients and contains the list of already-delivered recipients including any generated addresses. See also CW$each_recipients_del. The number of envelope recipients for the message which have already been delivered. Note that this is the count of original recipients to which the message has been delivered. It does not include generated addresses so it is possible that this number will be less than the number of addresses in the CW$recipients_del string. The list of undelivered envelope recipients for a message. This non-standard variable is in the same format as CW$recipients and contains the list of undelivered recipients. See also CW$each_recipients_undel. The number of envelope recipients for the message which have not yet been delivered. The contents of the Reply-To: header line if one exists and it is not empty, or otherwise the contents of the From: header line. The value of the message's header(s) with the same name. See section 11.5 of Exim's spec.txt for full description. The sender's address that was received in the message's envelope. For bounce messages, the value of this variable is the empty string. The domain part of CW$sender_address. The local part of CW$sender_address. The \s-1HELO\s0 or \s-1EHLO\s0 value supplied for smtp or bsmtp messages. The remote host's \s-1IP\s0 address. The name of the authenticator driver which successfully authenticated the client from which the message was received. The remote host's name as obtained by looking up its \s-1IP\s0 address. The port number that was used on the remote host for network-originated messages. The identification received in response to an \s-1RFC\s0 1413 request for remote messages, the login name of the user that called Exim for locally generated messages. \s-1TRUE\s0 if the message was locally generated. \s-1TRUE\s0 if the envelope sender of this message was set by an untrusted local caller. This non-standard variable contains the formatted size string. That is, for a message whose CW$message_size is 66566 bytes, CW$shown_message_size is 65K. The value of the active host name when the message was received, as specified by the “smtp_active_hostname” option. The spam score of the message, for example '3.4' or '30.5'. (Requires exiscan or \s-1WITH_CONTENT_SCAN\s0) The spam score of the message, multiplied by ten, as an integer value. For instance '34' or '305'. (Requires exiscan or \s-1WITH_CONTENT_SCAN\s0) \s-1TRUE\s0 if a \s-1TLS\s0 certificate was verified when the message was received. The cipher suite that was negotiated for encrypted \s-1SMTP\s0 connections. The value of the Distinguished Name of the certificate if Exim is configured to request one The number of delay warnings which have been sent for this message.

CONTACT

"\s-1EMAIL:\s0
"\s-1HOME:\s0