~/.netrc
Login information for your mail provider's IMAP server. If the IMAP server requires a password, supply it on a machine line matching the IMAP server name, for example
List new email messages in an imap or local 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 peeks at an IMAP mailbox and uses scan(1) to display a summary, one line per new message. It also supports local mailboxes: Maildir directories and any single-file format scan(1) supports (mbox and MMDF). Use mailbox-preview stand-alone on the command line or as the back-end of a graphical, literate new-mail notification program such as xlbiff(1).
The first argument is an optional name of an IMAP server (default “imap”), optionally followed by a colon and a mailbox name (default “inbox”). You will need this argument unless the default name imap resolves on your network to the name of the IMAP server of your mail provider. 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 old_size
Check for mailbox change instead of scanning; see the description above and xlbiff(1).
--width N
Width in characters to pass to scan; default is $COLUMNS (from the environment).
--max-messages N
Display only the last N (default 20) new messages; 0 to display all.
--form file
Format file for scan; see mh-format(5). Default is xlbiff.form
--scanproc program
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).
--quiet
Do not output the messages. This option is probably useful only for debugging.
--client-preview
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 the IMAP server generates. It has no effect unless the IMAP server advertises a preview capability.
--imap-debug level
Set the imaplib debug level; level 4 displays the IMAP protocol messages, level 5 also displays IMAP literal strings.
~/.netrc
Login information for your mail provider's IMAP server. If the IMAP server requires a password, supply it on a machine line matching the IMAP server name, for example
machineserver_nameloginaccount_namepasswordyour_pw
If “login account_name” is omitted, account_name defaults to your user name.
Example command lines:
mailbox-preview imap.example.commailbox-preview imap.example.com --check 12
2 releases since Debian 12 (Bookworm); the text changed 1 time.