---
name: "mailbox-preview"
section: "1"
platform: "linux"
package: "xlbiff"
version: "4.6.6-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mailbox-preview"
---

# mailbox-preview(1)

list new email messages in an IMAP or local mailbox

## NAME

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

## SYNOPSIS

**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* ... \]

## DESCRIPTION

The **mailbox-preview** program peeks at an IMAP mailbox and uses [**scan**(1)](/scan/1.md) to display a summary, one line per new message. It also supports local mailboxes: Maildir directories and any single-file format [**scan**(1)](/scan/1.md) 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)](/xlbiff/1.md).

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)](/xlbiff/1.md). 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)](/xlbiff/1.md).

## OPTIONS

- **--check** *old\_size*

  Check for mailbox change instead of scanning; see the description above and [**xlbiff**(1)](/xlbiff/1.md).

- **--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)](/mh-format/5.md). 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.

## FILES

- *~/.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

-

  ```
  machine server_name login account_name password your_pw
  ```

-

  *If “login account\_name” is omitted,* *account\_name* *defaults to your user name.*

## BUG REPORTS

*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

*Example command lines:*

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

## AUTHOR

*Stephen Gildea, November 2021*

## SEE ALSO

[**xlbiff**(1)](/xlbiff/1.md), [**scan**(1)](/scan/1.md)
