DOKK / manpages / debian 12 / xlbiff / mailbox-preview.1.en
MAILBOX-PREVIEW(1) General Commands Manual MAILBOX-PREVIEW(1)

mailbox-preview - list new email messages in an IMAP mailbox

mailbox-preview [[server][:mailbox]] [ --option ... ]
mailbox-preview mail_spool_file_name [ --option ... ]
mailbox-preview [[server][:mailbox]] --check oldsize [ --option ... ]
mailbox-preview mail_spool_file_name --check oldsize [ --option ... ]

The mailbox-preview program reads an IMAP mailbox and uses scan(1) to display a summary, one line per new message. It can be used stand-alone on the command line or as the back-end of a graphical, literate new-mail notification program such as xlbiff(1).

The optional first argument is an optional name of an IMAP server (default “imap”), optionally followed by a colon and a mailbox name (default “inbox”). Unless the default name imap resolves on your network to the name of your IMAP server, you will need this argument. It is likely that the default mailbox name inbox will work for you.

Your ~/.netrc file is consulted for the login and password for the IMAP server. See the FILES section, below, for the format of this file.

If the first argument to mailbox-preview is instead the name of a file under a top-level directory that exists, it is treated as the name of a local mail drop, and that file is used instead of doing IMAP.

With --check, the program conforms to the checkCommand protocol of xlbiff(1). The output is the new mailbox size to pass next time as the argument to --check. (The contents of the mailbox are not output.) The exit value of the program describes how the mailbox size has changed, as documented under the -checkCommand option in xlbiff(1).

Check for mailbox change instead of scanning; see the description above and xlbiff(1).
Width in characters to pass to scan; default is $COLUMNS (from the environment).
Display only the last N (default 20) new messages; 0 to display all.
Format file for scan; see mh-format(5). Default is xlbiff.form
Filename of the program to pipe the messages through; default /usr/bin/mh/scan. If set explicitly to an empty string, the messages will be output raw (which is probably useful only for debugging).
Do not output the messages. This option is probably useful only for debugging.
Do not request a short message preview from the IMAP server and instead create our own short form of the message. Use this option if you don't like the preview your IMAP server generates. It has no effect unless the IMAP server advertises a preview capability.
Set the imaplib debug level; level 4 displays the IMAP protocol messages, level 5 also displays IMAP literal strings.

~/.netrc
Login information for your IMAP server. If your IMAP server requires a password, supply it on a machine line matching the IMAP server name, for example
machine server_name login account_name password your_pw
If “login account_name” is omitted, account_name defaults to your user name.

When reporting interoperability problems with an IMAP server, include the output of

mailbox-preview srvr --imap-debug=4 --quiet 2>&1 | grep -v " LOGIN "

Example command lines:

mailbox-preview imap.example.com
mailbox-preview imap.example.com --check 12

Stephen Gildea, November 2021

xlbiff(1), scan(1)

2022-12-01