EXIPICK(8)

๐Ÿ’… exipick ๐Ÿ’…

exipick is the whole vibe of the EXIM4 manual pages, and this one right here is all about picking messages out of an Exim queue like it's a little shopping spree. Buckle up bestie, we're going through the entire thing.


โœจ NAME โœจ

exipick โ€” selectively display messages from an Exim queue ๐ŸŽ€


โœจ SYNOPSIS โœจ

exipick [<options>] [<criterion> [<criterion> ...]]
exipick --help|--man

โœจ DESCRIPTION โœจ

So like, exipick is a tool to display messages that are sitting in an Exim queue. It's super close to exiqgrep โ€” and lowkey it IS a drop-in replacement for exiqgrep, no cap. What makes it iconic is that exipick lets you select which messages to display using literally any piece of data stored in an Exim spool file. And once you've matched them, you can show them off in a bunch of different formats. Obsessed. ๐Ÿฆ‹


โœจ QUICK START โœจ

Okay here's the good stuff, real examples, main character energy only.

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 MSA 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 IP 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 ๐ŸŒˆ

One bullet per option, every single one, let's gooooo.

  • --and โ€” display messages that match all the criteria (this is the default, bestie)
  • -b โ€” display messages in brief format (exiqgrep)
  • -bp, -l โ€” display messages in standard mailq format. This is the default. (exiqgrep calls this one "-l")
  • -bpa โ€” same as "-bp", but also show generated addresses (exim)
  • -bpc โ€” show a count of matching messages (exim)
  • -bpr โ€” same as "-bp --unsorted" (exim)
  • -bpra โ€” same as "-bpa --unsorted" (exim)
  • -bpru โ€” same as "-bpu --unsorted" (exim)
  • -bpu โ€” same as "-bp", but only show the undelivered messages (exim)
  • -C, --config config โ€” use config to figure out the proper spool directory. (peep "--spool" or "--input" for other ways to tell it which directories to operate on)
  • -c โ€” show a count of matching messages (exiqgrep)
  • --caseful โ€” make operators that involve "=" honor case ๐Ÿ‘‘
  • --charset โ€” override the default local character set, which is used for $header_ decoding
  • -f regexp โ€” same as "$sender_address =~ /<regexp>/" (exiqgrep). Heads up: this preserves the default case sensitivity of exiqgrep's interface.
  • --finput โ€” same as "--input-dir Finput". Finput is where exim copies frozen messages when it's compiled with SUPPORT_MOVE_FROZEN_MESSAGES.
  • --flatq โ€” use a single-line output format
  • --freeze cache file โ€” save queue information in a quickly retrievable format
  • --help โ€” display this output
  • -i โ€” display only the message IDs (exiqgrep)
  • --input-dir inputname โ€” set the name of the directory under the spool directory. By default this is input. If this starts with /, then the value of "--spool" gets ignored. See also "--finput".
  • --not โ€” negate all tests. Every single one. ๐Ÿ˜ค
  • -o seconds โ€” same as "$message_age > <seconds>" (exiqgrep)
  • --or โ€” display messages matching any criteria
  • --queue name โ€” name of the queue (default: ''). See "named queues" in the spec.
  • -r regexp โ€” same as "$recipients =~ /<regexp>/" (exiqgrep). Heads up again: this preserves the default case sensitivity of exiqgrep's interface.
  • --random โ€” display messages in random order
  • --reverse, -R โ€” display messages in reverse order (exiqgrep: "-R")
  • -s string โ€” same as "$shown_message_size eq <string>" (exiqgrep)
  • --spool path โ€” set the path to the exim spool to use. This value will have the arguments to "--queue", and "--input" or input appended to it โ€” or it'll just be ignored if "--input" is a full path. If you don't specify it, exipick uses the value from exim [-C config] -n -bP spool_directory, and if that call fails, the /opt/exim/spool from build time (Local/Makefile) gets used instead. See also "--config".
  • --show-rules โ€” show the internal representation of each criterion you specified
  • --show-tests โ€” show the result of each criterion on each message
  • --show-vars variable[,variable...] โ€” show the value for variable for each displayed message. variable will be treated as a regular expression if it begins with a circumflex.
  • --size โ€” show the total bytes used by each displayed message
  • --thaw cache file โ€” read queue information cached from a previous "--freeze" run
  • --sort variable[,variable...] โ€” 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 ๐Ÿ’–

So how does exipick decide which messages to show you? It applies a test against each message, one by one. The rules take the general form of "VARIABLE OPERATOR VALUE". For example, "$message_age > 60". When exipick is deciding which messages to display, it checks the $message_age variable for each message. If a message's age is greater than 60, the message gets displayed. If the message's age is 60 seconds or less, it does not get displayed. Simple as that.

You can use multiple criteria at once. The order you specify them in does not matter, bestie. By default, all criteria must evaluate to true for a message to be displayed. But if you use the "--or" option, then a message gets displayed as long as any of the criteria evaluate to true. Slay.

See the VARIABLES and OPERATORS sections below for more details.


๐ŸŒธ OPERATORS ๐ŸŒธ

BOOLEAN

Boolean variables get checked simply by being true or false. There's no real operator here except negation. Examples of valid boolean tests:

$deliver_freeze
!$deliver_freeze

NUMERIC

The valid comparisons are <, <=, >, >=, ==, and !=. Numbers can be integers or floats. Any number in a test that's suffixed with d, h, m, s, M, K, or B gets multiplied by 86400, 3600, 60, 1, 1048576, 1024, or 1 respectively. Examples of valid numeric tests:

$message_age >= 3d
$local_interface == 587
$message_size < 30K

STRING

The string operators are =, eq, ne, =~, and !~. With the exception of "=", all these operators 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 =~, except 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$/

NEGATION

There are, like, sooo many ways to negate tests, and each one has a reason for existing, iykyk. Many tests can be negated using native operators. For instance, >1 is the opposite of <=1, and eq and ne are opposites. On top of that, 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$/". And finally, every test can be negated by using the command line argument "--not". That one is functionally equivalent to adding a ! to the beginning of every single test. Periodt. ๐Ÿ’…

โœจ VARIABLES โœจ

okay bestie, real talk: with a few exceptions, the variables you get here match Eximโ€™s internal expansion variables in both name and exact contents. There are a few notable additions and format deviations, and those are noted below. A brief explanation is offered below, but Eximโ€™s spec.txt should be consulted for full details. It is so important to remember that not every variable will be defined for every message. For example, $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 โœจ

and now, the whole variable roster, no skips, no cap:

  • S . $acl_c0-$acl_c9, $acl_m0-$acl_m9 โ€” user definable variables. ๐Ÿ’…
  • B + $allow_unqualified_recipient โ€” TRUE if unqualified recipient addresses are permitted in header lines. ๐ŸŽ€
  • B + $allow_unqualified_sender โ€” TRUE if unqualified sender addresses are permitted in header lines. ๐ŸŽ€
  • S . $authenticated_id โ€” optional saved information from authenticators, or the login name of the calling process for locally submitted messages. ๐Ÿ”
  • S . $authenticated_sender โ€” the value of AUTH= param for smtp messages, or a generated value from the calling processes login and qualify domain for locally submitted messages. โœจ
  • S . $bheader_*, $bh_* โ€” value of the header(s) with the same name with any RFC2047 words decoded if present. See section 11.5 of Eximโ€™s spec.txt for full details. ๐Ÿ“œ
  • S + $bmi_verdicts โ€” the verdict string provided by a Brightmail content scan. ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • N . $body_linecount โ€” the number of lines in the messageโ€™s body. ๐Ÿ“
  • N . $body_zerocount โ€” the number of binary zero bytes in the messageโ€™s body. 0๏ธโƒฃ
  • S + $data_path โ€” the path to the body fileโ€™s location in the filesystem. ๐Ÿ“‚
  • B + $deliver_freeze โ€” TRUE if the message is currently frozen. ๐ŸงŠ
  • N + $deliver_frozen_at โ€” the epoch time at which message was frozen. โฐ
  • B + $dont_deliver โ€” TRUE if, under normal circumstances, Exim will not try to deliver the message. ๐Ÿšซ
  • S + $each_recipients โ€” this is a pseudo variable which allows you to apply a test against each address in $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 $recipients, but with the added benefit of being able to use anchors at the beginning and end of each recipient address. ๐ŸŽฏ
  • S + $each_recipients_del โ€” like $each_recipients, but for $recipients_del. ๐Ÿ’Œ
  • S + $each_recipients_undel โ€” like $each_recipients, but for $recipients_undel. ๐Ÿ“ฌ
  • B . $first_delivery โ€” TRUE if the message has never been deferred. ๐ŸŒŸ
  • S . $header_*, $h_* โ€” this will always match the contents of the corresponding $bheader_* variable currently (the same behaviour Exim displays when iconv is not installed). ๐Ÿงฌ
  • S + $header_path โ€” the path to the header fileโ€™s location in the filesystem. ๐Ÿ“
  • B . $host_lookup_deferred โ€” TRUE if there was an attempt to look up the hostโ€™s name from its IP address, but an error occurred that during the attempt. ๐Ÿ˜ตโ€๐Ÿ’ซ
  • B . $host_lookup_failed โ€” TRUE if there was an attempt to look up the hostโ€™s name from its IP address, but the attempt returned a negative result. โŒ
  • B + $local_error_message โ€” TRUE if the message is a locally-generated error message. ๐Ÿ›‘
  • S . $local_scan_data โ€” the text returned by the local_scan() function when a message is received. ๐Ÿ“ฅ
  • B . $manually_thawed โ€” TRUE when the message has been manually thawed. ๐Ÿ”ฅ
  • N . $max_received_linelength โ€” the number of bytes in the longest line that was received as part of the message, not counting line termination characters. ๐Ÿ“
  • N . $message_age โ€” the number of seconds since the message was received. โณ
  • S # $message_body โ€” 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. ๐Ÿ“
  • B + $message_body_missing โ€” TRUE is a messageโ€™s spool data file (-D file) is missing or unreadable. ๐Ÿซฅ
  • N . $message_body_size โ€” the size of the body in bytes. ๐Ÿ“ฆ
  • S . $message_exim_id, $message_id โ€” the unique message id that is used by Exim to identify the message. $message_id is deprecated as of Exim 4.53. ๐Ÿ†”
  • S . $message_headers โ€” a concatenation of all the header lines except for lines added by routers or transports. RFC2047 decoding is performed. ๐Ÿงพ
  • S . $message_headers_raw โ€” a concatenation of all the header lines except for lines added by routers or transports. No decoding or translation is performed. ๐Ÿชต
  • N . $message_linecount โ€” the number of lines in the entire message (body and headers). ๐Ÿงฎ
  • N . $message_size โ€” the size of the message in bytes. ๐Ÿ“
  • N . $originator_gid โ€” the group id under which the process that called Exim was running as when the message was received. ๐Ÿ‘ฅ
  • S + $originator_login โ€” the login of the process which called Exim. ๐Ÿ‘ค
  • N . $originator_uid โ€” the user id under which the process that called Exim was running as when the message was received. ๐Ÿชช
  • S . $received_ip_address, $interface_address โ€” the address of the local IP interface for network-originated messages. $interface_address is deprecated as of Exim 4.64. ๐ŸŒ
  • N . $received_port, $interface_port โ€” the local port number if network-originated messages. $interface_port is deprecated as of Exim 4.64. ๐Ÿ”Œ
  • N . $received_count โ€” the number of Received: header lines in the message. ๐Ÿ“จ
  • S . $received_protocol โ€” the name of the protocol by which the message was received. ๐Ÿ“ก
  • N . $received_time โ€” the epoch time at which the message was received. โฑ๏ธ
  • S # $recipients โ€” the list of envelope recipients for a message. Unlike Eximโ€™s version, this variable always contains every recipient of the message. The recipients are separated by a comma and a space. See also $each_recipients. ๐Ÿ“ฌ
  • N . $recipients_count โ€” the number of envelope recipients for the message. ๐Ÿ”ข
  • S + $recipients_del โ€” the list of delivered envelope recipients for a message. This non-standard variable is in the same format as $recipients and contains the list of already-delivered recipients including any generated addresses. See also $each_recipients_del. โœ…
  • N + $recipients_del_count โ€” 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 $recipients_del string. ๐Ÿงพ
  • S + $recipients_undel โ€” the list of undelivered envelope recipients for a message. This non-standard variable is in the same format as $recipients and contains the list of undelivered recipients. See also $each_recipients_undel. โณ
  • N + $recipients_undel_count โ€” the number of envelope recipients for the message which have not yet been delivered. ๐Ÿ•ฐ๏ธ
  • S . $reply_address โ€” 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. โ†ฉ๏ธ
  • S . $rheader_*, $rh_* โ€” the value of the messageโ€™s header(s) with the same name. See section 11.5 of Eximโ€™s spec.txt for full description. ๐Ÿ“œ
  • S . $sender_address โ€” the senderโ€™s address that was received in the messageโ€™s envelope. For bounce messages, the value of this variable is the empty string. ๐Ÿ“ญ
  • S . $sender_address_domain โ€” the domain part of $sender_address. ๐ŸŒ
  • S . $sender_address_local_part โ€” the local part of $sender_address. ๐Ÿ“›
  • S . $sender_helo_name โ€” the HELO or EHLO value supplied for smtp or bsmtp messages. ๐Ÿ‘‹
  • S . $sender_host_address โ€” the remote hostโ€™s IP address. ๐ŸŒ
  • S . $sender_host_authenticated โ€” the name of the authenticator driver which successfully authenticated the client from which the message was received. ๐Ÿ”
  • S . $sender_host_name โ€” the remote hostโ€™s name as obtained by looking up its IP address. ๐Ÿท๏ธ
  • N . $sender_host_port โ€” the port number that was used on the remote host for network-originated messages. ๐Ÿ”Œ
  • S . $sender_ident โ€” the identification received in response to an RFC 1413 request for remote messages, the login name of the user that called Exim for locally generated messages. ๐Ÿชช
  • B + $sender_local โ€” TRUE if the message was locally generated. ๐Ÿ 
  • B + $sender_set_untrusted โ€” TRUE if the envelope sender of this message was set by an untrusted local caller. ๐Ÿšจ
  • S + $shown_message_size โ€” this non-standard variable contains the formatted size string. That is, for a message whose $message_size is 66566 bytes, $shown_message_size is 65K. ๐Ÿ”
  • S . $smtp_active_hostname โ€” the value of the active host name when the message was received, as specified by the "smtp_active_hostname" option. ๐Ÿท๏ธ
  • S . $spam_score โ€” the spam score of the message, for example 3.4 or 30.5. (Requires exiscan or WITH_CONTENT_SCAN) ๐Ÿฅซ
  • S . $spam_score_int โ€” the spam score of the message, multiplied by ten, as an integer value. For instance 34 or 305. (Requires exiscan or WITH_CONTENT_SCAN) ๐Ÿฅซ
  • B . $tls_certificate_verified โ€” TRUE if a TLS certificate was verified when the message was received. ๐Ÿ”’
  • S . $tls_cipher โ€” the cipher suite that was negotiated for encrypted SMTP connections. ๐Ÿงฌ
  • S . $tls_peerdn โ€” the value of the Distinguished Name of the certificate if Exim is configured to request one. ๐Ÿ“œ
  • S . $tls_sni โ€” the value of the Server Name Indication TLS extension sent by a client, if one was sent. ๐ŸŒ
  • N + $warning_count โ€” the number of delay warnings which have been sent for this message. โš ๏ธ

๐Ÿ’Œ CONTACT ๐Ÿ’Œ

bestie if u ever need to yell at the maintainer (affectionately, obvi) or just say hi, here's where to find them:

fun lil lore drop โœจ โ€” this script got pulled into the main Exim distribution a while back. like, some years ago. it's not just a side quest anymore, it's canon ๐Ÿ‘‘


and that's the whole page, bestie!! u made it to the end, i'm so proud ๐Ÿฅน๐Ÿซถ

okay so this was written by perl v5.42.3, dated 2026-09-08, and honestly? iconic of it. take this knowledge and go filter some mail queues like the main character u are ๐Ÿ’…๐ŸŒธโœจ

now go run it. lowkey obsessed with u for reading all of this. no cap. ๐Ÿ’–
๐Ÿ“ฆ where this page comes from