[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 4. Commands

IMAIL provides a rich set of commands for manipulating messages. Like Rmail, most of these commands are bound to letter keys.

The most important command is `M-x imail`, which is used to start IMAIL. With no arguments, `M-x imail` reads the primary folder, selects the first unseen message in the folder, then selects the folder's buffer. If the primary folder is an IMAP folder, `M-x imail` will connect to the server and check for new mail. If `M-x imail` is given a prefix argument, it will prompt for the URL of a folder rather than reading the primary folder.

The IMAIL message buffer is put in `IMAIL` mode, a special mode in which most letter commands are defined to have special meanings. Where possible, the letters chosen for these commands are the same as those for the corresponding Rmail commands. The command keys specified in this chapter are for `IMAIL` mode, unless otherwise specified.

> 4.1 Navigation |  |
> 4.2 Deleting Messages |  |
> 4.3 Multiple Folders |  |
> 4.4 MIME Support |  |
> 4.5 Flags |  |
> 4.6 Sending Replies |  |
> 4.7 Message Display |  |
> 4.8 Summaries |  |
> 4.9 Sorting Messages |  |
> 4.10 Other Commands |  |

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.1 Navigation

The most basic thing to do with a message is to read it. The way to do this in IMAIL is to select the message. The usual practice is to move sequentially through the folder, since this is the order of receipt of messages. When you enter IMAIL, you are positioned at the first message that you have not yet seen (that is, the first one that has the ``unseen`' flag; see section 4.5 Flags). Move forward to see the other new messages; move backward to reexamine old messages.

`n`
  Move to the next nondeleted message, skipping any intervening deleted messages (`imail-next-undeleted-message`).
`p`
  Move to the previous nondeleted message (`imail-previous-undeleted-message`).
`M-n`
  Move to the next message, including deleted messages (`imail-next-message`).
`M-p`
  Move to the previous message, including deleted messages (`imail-previous-message`).
`j`
  Move to the first message. With argument n, move to message number n (`imail-select-message`).
`>`
  Move to the last message (`imail-last-message`).
`<`
  Move to the first message (`imail-first-message`).
`M-u`
  Move to the first unseen message (`imail-first-unseen-message`).
`M-s string `RET``
  Move to the next message containing a match for string (`imail-search`).
`M-- M-s string `RET``
  Move to the previous message containing a match for string.
`C-c C-n`
  Move to the next message with the same subject (`imail-next-same-subject`).
`C-c C-p`
  Move to the previous message with the same subject (`imail-previous-same-subject`).

`n` and `p` are the usual way of moving among messages in IMAIL. They move through the messages sequentially, but skip over deleted messages, which is usually what you want to do. Their command definitions are named `imail-next-undeleted-message` and `imail-previous-undeleted-message`. If you do not want to skip deleted messages--for example, if you want to move to a message to undelete it--use the variants `M-n` and `M-p` (`imail-next-message` and `imail-previous-message`). A numeric argument to any of these commands serves as a repeat count.

In IMAIL, you can specify a numeric argument by typing just the digits. You don't need to type `C-u` first.

The `M-s` (`imail-search`) command is IMAIL's version of search. The usual incremental search command `C-s` works in IMAIL, but it searches only within the current message. The purpose of `M-s` is to search for another message. It reads a string nonincrementally, then searches starting at the beginning of the following message for a match. It then selects that message. If string is empty, `M-s` reuses the string used the previous time.

To search backward in the folder for another message, give `M-s` a negative argument. In IMAIL you can do this with `- M-s`.

It is also possible to search for a message based on flags. See section 4.5 Flags.

To find the next message with the same subject as the current message, use `C-c C-n` (`imail-next-same-subject`). This is useful for following the thread of an email conversation. `C-c C-p` (`imail-previous-same-subject`) finds the previous message with the same subject.

To move to a message specified by absolute message number, use `j` (`imail-select-message`) with the message number as argument. With no argument, `j` selects the first message. `<` (`imail-first-message`) also selects the first message. `>` (`imail-last-message`) selects the last message. `M-u` selects the first unseen message (`imail-first-unseen-message`).

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.2 Deleting Messages

When you no longer need to keep a message, you can delete it. This flags it as ignorable, and some IMAIL commands pretend it is no longer present; but it still has its place in the IMAIL folder, and still has its message number.

Expunging the IMAIL folder actually removes the deleted messages. The remaining messages are renumbered consecutively. Expunging is the only action that changes the message number of any message.

`d`
  Delete the current message, and move to the next nondeleted message (`imail-delete-forward`).
`C-d`
  Delete the current message, and move to the previous nondeleted message (`imail-delete-backward`).
`u`
  Undelete the current message, or move back to a deleted message and undelete it (`imail-undelete-previous-message`).
`x`
  Expunge the IMAIL folder (`imail-expunge`).

There are two IMAIL commands for deleting messages. Both delete the current message and select another message. `d` (`imail-delete-forward`) moves to the following message, skipping messages already deleted, while `C-d` (`imail-delete-backward`) moves to the previous nondeleted message. If there is no nondeleted message to move to in the specified direction, the message that was just deleted remains current. A numeric argument to either command reverses the direction of motion after deletion.

To make all the deleted messages finally vanish from the IMAIL folder, type `x` (`imail-expunge`). Until you do this, you can still undelete the deleted messages. The undeletion command, `u` (`imail-undelete-previous-message`), is designed to cancel the effect of a `d` command in most cases. It undeletes the current message if the current message is deleted. Otherwise it moves backward to previous messages until a deleted message is found, and undeletes that message.

Because `imail-expunge` irreversibly deletes mail, IMAIL normally requires confirmation before it performs the expunge. This confirmation is controlled by the value of the variable `imail-expunge-confirmation`, which is a list of symbols. There are two independent behaviors controlled by this: whether to prompt, and whether to show the messages being expunged. If the list contains the symbol `verbose` (the default), the user is prompted for a yes-or-no style confirmation; if the list contains the symbol `brief`, the user is prompted for a y-or-n style confirmation; if neither of these symbols is present, no confirmation is done. If the list contains the symbol `show-messages`, a window is popped up showing the messages to be expunged; otherwise the list is not shown.

You can usually undo a `d` with a `u` because the `u` moves back to and undeletes the message that the `d` deleted. But this does not work when the `d` skips a few already-deleted messages that follow the message being deleted; then the `u` command undeletes the last of the messages that were skipped. There is no clean way to avoid this problem. However, by repeating the `u` command, you can eventually get back to the message that you intend to undelete. You can also select a particular deleted message with the `M-p` command, then type `u` to undelete it.

A deleted message has the ``deleted`' flag, and as a result ``deleted`' appears in the mode line when the current message is deleted. In fact, deleting or undeleting a message is nothing more than adding or removing this flag. See section 4.5 Flags.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.3 Multiple Folders

IMAIL operates by default on your primary folder, which is the folder named ``inbox`' on your IMAP server. Your incoming mail is placed in that folder by your system's mail-delivery software. Whenever it has an open connection to the server, IMAIL notices new mail and brings it to your attention by modifying the Edwin mode line.

You can specify a different folder to be your primary folder by modifying one or more of IMAIL's variables. The simplest way to do this is to change the variable `imail-primary-folder` to contain the URL of the folder that you wish to be your primary folder. Normally `imail-primary-folder` is `#f`, in which case the primary folder has the form

    imap://user-id@server/mailbox

where user-id is the value of the variable `imail-default-user-id`, server is the value of `imail-default-imap-server`, and mailbox is the value of `imail-default-imap-mailbox`. `imail-default-user-id` may be `#f` meaning to use the value of ``(current-user-name)`'.

In addition to the primary folder, you can also have other folders and edit them with IMAIL. You can move messages into them with explicit IMAIL commands.(8)

One major difference between a file-based mail reader like Rmail and an IMAP mail reader like IMAIL is that file-based mail readers do not need to provide commands to manipulate mail files (as opposed to mail messages). This is because ordinary file-system commands already provide the ability to copy, delete, and rename such files. This isn't the case for IMAP mail readers. Consequently IMAIL provides a basic set of commands for manipulating folders, as well as a Dired-like folder browser.

> 4.3.1 Simple Folder Commands |  |
> 4.3.2 The Folder Browser |  |

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.3.1 Simple Folder Commands

Within a folder's buffer, IMAIL provides a number of simple commands that can be used to interact with other folders.

`i URL `RET``
  Read the folder named URL and run IMAIL on it (`imail-input`).

`g`
  Get new mail for the current folder (`imail-get-new-mail`).

`C-u g URL `RET``
  Read the folder named URL and append all of its messages to the current folder (`imail-input-from-folder`).

`o URL `RET``
  Copy the current message into the folder named URL (`imail-output`).

`M-o filename `RET``
  Append the current message, in human-readable form, to the file named filename (`imail-file-message`).

`C URL1 `RET` URL2 `RET``
  Copy the folder named URL1 to URL2 (`imail-copy-folder`).

`D URL `RET``
  Delete the folder named URL (`imail-delete-folder`).

`R URL1 `RET` URL2 `RET``
  Rename the folder named URL1 to be URL2 (`imail-rename-folder`).

`+ URL `RET``
  Create a folder named URL (`imail-create-folder`).

To run IMAIL on a folder other than your primary folder, you may use the `i` (`imail-input`) command in IMAIL. This visits the folder in IMAIL mode. You can use `M-x imail-input` even when not in IMAIL.

The `g` (`imail-get-new-mail`) command gets new mail for the current IMAIL folder, and if there is new mail, moves to the first unseen message. This command works only on IMAP folders; it does nothing on file-based folders. Normally this command isn't needed since IMAIL periodically checks for new mail in all IMAP folders, but it is occasionally useful to force IMAIL to get new mail immediately rather than waiting for the next periodic mail check. The command `M-x imail` has the same effect as `imail-get-new-mail` if the primary folder is already open in a buffer.

IMAIL normally checks for new mail in IMAP folders according to the value of the variable `imail-update-interval`. This variable specifies the time between checks in seconds. It may also be set to `#f`, which disables automatic mail checking. When IMAIL detects new mail in the primary folder, it normally modifies the mode line of all buffers to contain the string ``[New Mail]`'. This can be disabled by setting the variable `imail-global-mail-notification` to `#f`.

To copy messages from another folder into the current folder, give the `g` key a numeric argument, as in `C-u g`. This runs the command `imail-input-from-folder`, which reads a URL and copies all the messages from the specified folder into the current one. The messages are appended to the current folder, in the same order that they appear in the specified folder.

The `o` (`imail-output`) command copies the current message into a folder that you specify as a URL. The folder initially defaults to the current folder, unless you have set the variable `imail-output-default` to a different default; after the first message is output, the default folder becomes the one to which you last output a message. If the target folder doesn't exist, it is created first; in any case, the copied message is appended to the end of the folder. The current message is flagged as ``filed`'. If the variable `imail-delete-after-output` is true, the message is also marked as deleted.

The `M-o` (`imail-file-message`) command appends the current message to a file that you specify. The message is written to the file in the same format in which it appears in the IMAIL buffer, preceded by a separator line if there is other text in the file. This simplifies the task of collecting messages into a plain text file for future reference. Note that attachments appear in the output only as markers; their contents are not included in the file.

The `C` (`imail-copy-folder`) command copies an entire folder from one place to another. You specify two URLs, the source and the target, and all of the messages from the source folder are copied verbatim to the target folder. The source folder is not changed. The target folder is created if it doesn't exist. If the target folder does exist, the source folder's messages are appended to it.

Note that all of the commands that copy messages between folders will work whether the folders are the same type or not. In particular, messages in IMAP folders can be copied to file folders, and vice versa. You can copy messages between two file folders in different formats, or between two different IMAP servers. IMAIL doesn't care; it translates as needed.

The `D` (`imail-delete-folder`) command deletes a specified folder. All of the messages in the folder, and the folder itself, are deleted. You will be prompted to confirm before any deletion is done.

The `R` (`imail-rename-folder`) command renames a specified folder. You are prompted for two URLs, the old name and the new one. At present, this command only works in limited circumstances, specifically, when moving a folder from one place to another on a single IMAP server, or when moving a file folder from one place to another within the same file system. The rename operation fails if the new name is already in use.

The `+` (`imail-create-folder`) command creates a new, empty folder. It prompts for a URL, and signals an error if the name is already in use. This command is rarely used since the message-copying commands automatically create folders as needed.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.3.2 The Folder Browser

In addition to the simple commands just described, IMAIL also provides a Dired-like browser for viewing and manipulating folders. The browser is generic, meaning that it will view collections of both IMAP folders and file folders, although it works better and is more useful in conjunction with IMAP folders.

The `imail-browser-view-container` command is used to enter the folder browser. In an IMAIL folder buffer, this command is bound to the `^` key, and will bring up a folder browser that is viewing the container of the current folder. With a prefix argument, you will be asked for the URL of a container to browse.

An IMAIL browser buffer is arranged so that each line in the browser represents a folder or a container (or both, in the case of IMAP containers). Here is an example:

    imap://localhost/inbox/
    -----------------------
      + debian/
      + family
      + gnu/
      + ham/
      + hp-laptops/
      + linux/
      + misc/
      + mit/
      + music/
      + purchases
      + scheme/
      + software/
      + sysadmin
      + vendors/
      + vlsi

There are several interesting features of this buffer. The first two lines of the buffer are a title, telling you the URL of the container that this buffer is browsing. Each of the remaining lines shows the name of a folder (or container) that is inside the container. You can perform various operations on one of these folders by moving point to the folder's line and invoking commands.

Each line uses special characters to give you cues about the object being described. If the object is a container, there is a ``+`' character at the beginning of the line. Because our example is showing an IMAP container, and virtually all IMAP folders are also containers, every line in the example starts with ``+`'. Additionally, if the object is only a container, then the object's name ends in the character ``/`'; if the object is only a folder, or if it is both a folder and a container, then there is no trailing ``/`'.

The following commands are available in an IMAIL browser buffer.

`f`
  View the folder on the current line in an IMAIL buffer (`imail-browser-view-selected-folder`).

`t`
  If the object on the current line is a container, toggle whether its contents are shown (`imail-browser-toggle-container`).

`c`
  Browse the container on the current line (`imail-browser-view-selected-container`).

`^`
  Browse the container of the this buffer's container (`imail-browser-view-container`).

`d`
  Mark the object on the current line for subsequent deletion (`imail-browser-flag-folder-deletion`).

`m`
  Mark the object on the current line for subsequent operations (`imail-browser-mark`).

`u`
  Remove any mark from the current line and move to the next line (`imail-browser-unmark`).

``DEL``
  Move to the previous line and remove any mark there (`imail-browser-unmark-backward`).

`M-`DEL` char`
  Remove marks from all folders (`imail-browser-unmark-all-folders`).

`C URL `RET``
  Copy the folder on the current line to the folder named URL, creating it if needed (`imail-browser-do-copy`).

`R URL `RET``
  Rename the object on the current line to be URL (`imail-browser-do-rename`).

`D`
  Delete the object on the current line (`imail-browser-do-delete`). Prompts for confirmation before performing the deletion.

`x`
  Delete all objects that have been marked for deletion (`imail-browser-do-flagged-delete`). Prompts for confirmation before any deletion is performed.

`+ URL `RET``
  Create a folder named URL (`imail-create-folder`).

`g`
  Recompute the buffer's contents by querying the server or file system (`imail-browser-revert`).

`q`
  Kill the current buffer (`imail-browser-quit`).

If point is on a line describing a folder, use the `f` (`imail-browser-view-selected-folder`) command to view the contents of that folder. This selects an IMAIL folder buffer for that folder.

If point is on a line describing a container, use the `t` (`imail-browser-toggle-container`) command to show the contents of the container in the current buffer. This causes the ``+`' on this line to change to a ``-`', and new lines describing the contents are inserted into the buffer following the current line. The new lines are slightly indented to indicate the container relationship. For example:

    imap://localhost/inbox/
    -----------------------
      - debian/
          + bugs
          + maintainer
          + misc
      + family
      + gnu/
      + ham/
      + hp-laptops/
      + linux/
      + misc/
      + mit/
      + music/
      + purchases
      + scheme/
      + software/
      + sysadmin
      + vendors/
      + vlsi

To hide the container's content lines, use the `t` command again. Another way to open and close containers is to click the left mouse button on the ``+`' or ``-`' character for the container (`imail-browser-mouse-toggle-container`).

If you would rather browse a container in a separate buffer, use the `c` (`imail-browser-view-selected-container`) command. To browse the container of this buffer's container, use the `^` (`imail-browser-view-container`) command.

Besides simple browsing capabilities, the IMAIL folder browser also provides the ability to modify folders and containers, by copying, renaming, and deleting them. The commands to do this normally operate on the object on the current line. However, you can mark one or more lines, and subsequently perform an operation on all of them at once.

There are several marking and unmarking commands. The `m` (`imail-browser-mark`) command marks the current line and moves down to the next line. The mark is visible as an asterisk at the beginning of the line. A numeric argument serves as a repeat count. The `d` (`imail-browser-flag-folder-deletion`) is just like `m`, except that it marks lines with ``D`'. ``D`' marks are used to flag objects for deletion, while ``*`' marks are used for everything else.

To unmark a line, use the `u` (`imail-browser-unmark`) command. This removes any mark from the current line and moves to the next line. Like `m`, a numeric argument serves as a repeat count. The `DEL` (`imail-browser-unmark-backward`) command moves upward, removing flags; it is like `u` with argument `-1`. Finally, the `M-`DEL`` (`imail-browser-unmark-all-folders`) prompts for a character and unmarks all lines marked with that character; specifying `RET` as the character removes all marks.

The next three commands perform the copy, rename, and delete operations. These commands all operate on one or more folders, which you specify either by marking them, or by moving point to the corresponding lines. The folders to be operated on are specified as follows. If the command is given a numeric argument N, then the next N folders are specified. Otherwise, any folders marked with an asterisk are specified. If there is no argument and no marked folders, then the folder on the current line is specified.

The `C` (`imail-browser-do-copy`) command copies one or more folders. If one folder is specified, the command prompts for the URL of another folder, and appends the messages of the first folder to the end of the second folder. The second folder is created if necessary. If more than one folder is specified, the command prompts for the URL of an existing container, and copies the source folders into the target container with the same names.

The `R` (`imail-browser-do-rename`) command renames one or more folders. If one folder is specified, the command prompts for a URL, and changes the name of the folder to the URL. If more than one folder is specified, the command prompts for the URL of an existing container, and moves the folders into the container. Note that in both cases, it is an error if there is already a folder with the new name. Furthermore, this command only works in limited circumstances, specifically, when moving a folder from one place to another on a single IMAP server, or when moving a file folder from one place to another within the same file system.

The `D` (`imail-browser-do-delete`) command deletes one or more folders. The command prompts for confirmation before any folders are deleted. The `x` (`imail-browser-do-flagged-delete`) command is similar, except that the folders it deletes are those that have been marked with ``D`'. (The `x` command is mostly provided for compatibility with Dired.)

The `+` (`imail-create-folder`) command creates a new, empty folder. It prompts for a URL, and signals an error if the name is already in use. This command is rarely used since the message-copying commands automatically create folders as needed.

The `g` (`imail-browser-revert`) command re-reads the contents of the browser buffer's container and uses that information to regenerate the buffer's contents. Any marks that you have placed in the buffer are preserved.

The `q` (`imail-browser-quit`) command kills the current buffer. If you have marked some folders for later operation, the marks are discarded and the operations are not performed.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.4 MIME Support

The Multipurpose Internet Mail Extensions (MIME) define a standard means for structuring mail messages. MIME permits a message to have multiple parts, each of which is called an entity. It also provides a way to associate type information with each entity. For example, an ordinary text message has type ``text/plain`', HTML has type ``text/html`', and a JPEG image has type ``image/jpeg`'. Additionally, MIME entities may be annotated to indicate whether they should be shown in-line, or whether they are attachments that should be shown only upon further user action.

IMAIL provides simple support for MIME messages. MIME attachments are shown in the IMAIL buffer by special abbreviations. You can write an attachment to a file. Multipart MIME structures are recognized and displayed in a clean format that suppresses unnecessary clutter. And MIME encodings such as quoted-printable and base64 are automatically decoded prior to displaying the message or saving the attachment.

End-user formatting of MIME messages is a complex process, partly because these messages can be arbitrarily complex in their internal structure. IMAIL provides several variables that give you some control over the formatting prcess.

Many MIME messages have multiple parts; for example, a message with an attachment normally contains at least two parts: the message text and the attachment. IMAIL separates the different parts of a MIME message with specially-formatted lines. There are several styles of separator lines available, selected by changing the value of the variable `imail-mime-boundary-style`. The default value of `simple` means to use long lines of hyphen characters as the separator lines. A value of `sgml` means use long lines of hyphens that are wrapped with ``<!--`' and ``-->`', which makes them valid SGML comments. A value of `original` means to use the original MIME boundaries, which have certain useful syntactic properties but are not as visually distinctive.

MIME also specifies a particular kind of multipart message, of type ``multipart/alternative`', in which the parts are different representations of the same message. A typical example of this is a mailer that sends both plain text and HTML versions of the message text. Normally IMAIL shows only the simplest of these parts (which is almost always plain text) and suppresses the alternatives. However, if you set the variable `imail-mime-show-alternatives` to `#t`, IMAIL will show these alternative forms as attachments.

Another kind of multipart MIME message is the digest message, which has type ``multipart/digest`'. Digest messages are normally used by high-volume mailing lists to reduce the number of messages sent to the end user; instead the user receives one message containing all of the messages from that list in a particular time period, usually a day. IMAIL can present MIME digest messages in one of two formats. The default format is to show all of the component messages of the digest as attachments. This is particularly useful for large digests that you will only read a few messages from, since you can scan the digest contents for interesting messages without downloading all of the messages in the digest. In the alternative format, selected by setting `imail-mime-collapse-digest` to `#f`, the component messages of a digest are all shown inline.

As a general rule, any MIME entity that contains non-textual information is displayed as an attachment. Attachments are normally shown as specially-formatted abbreviations. Here is an example:

    <imail-part
        name="foo.doc"
        type="application/msword"
        length="55499"
        />

This shows various things about the attachment, including its (optional) name, its MIME type, and the length of the attachment in bytes. (The length is computed on the encoded form of the attachment, and is generally slightly larger than the decoded length.)

IMAIL uses somewhat more complicated rules for deciding when a MIME entity is displayed in this abbreviated format, and when it is expanded in line. In general, all non-text entities are abbreviated. Additionally, if a text entity is given a MIME disposition of ``attachment`', if the character set of the entity is unknown, if the encoding type is unknown, or if the subtype is unknown, it is abbreviated.

Two variables control the abbreviation of text entities. `imail-known-mime-charsets` is a list of regular expressions that specify the known character sets; by default it specifies US-ASCII, the ISO 8859 character sets, and some random but commonly-seen Microsoft Windows character sets. The variable `imail-inline-mime-text-subtypes` contains a list of symbols, each of which is the name of a text subtype that should be shown in line. For example, if the symbol `html` is in this list, then MIME parts of type `text/html` are shown in-line. Text subtypes not appearing in this list are abbreviated as attachments.

Here are IMAIL's MIME-specific commands:

`C-o`
  Save a MIME attachment to a file (`imail-save-attachment`).

`w`
  Save an arbitrary MIME entity (message part) to a file (`imail-save-mime-entity`).

`C-c C-t C-e`
  Toggle a MIME entity between its formatted and raw forms (`imail-toggle-mime-entity`).

The primary MIME command is `C-o` (`imail-save-attachment`), which saves a single attachment to a file. If point is on an attachment, that is the attachment to be saved, otherwise IMAIL prompts for an attachment by name. If a prefix argument is specified, prompting is performed even if point is on an attachment. Once the attachment is determined, IMAIL prompts for the name of a file to save the attachment to. The filename is initialized from the name specified by the attachment, if any. The directory of the filename is initialized to the directory in which the last attachment was saved, or the user's home directory if no attachments have previously been saved.

If you want to save attachments to a specific directory, change the variable `imail-mime-attachment-directory` to contain the name of that directory.

The command `w` (`imail-save-mime-entity`) is similar to `imail-save-attachment` except that it will save any MIME entity, not just an attachment. For example, this allows you to save the message text. This command saves the entity that point is on; if point is not on any entity, an error is signalled. If the entity is encoded, e.g. with quoted-printable or base64 encoding, it is decoded before it is saved. If the entity is text, it is written to the file in text mode (relevant only under Windows and OS/2); otherwise it is written in binary mode.

A simpler way to save a MIME entity is to point at the entity with the mouse and click the right button (`imail-mouse-save-mime-entity`). This works the same way as `imail-save-mime-entity` except that the entity is selected by the mouse instead of point.

The command `C-c C-t C-e` (`imail-toggle-mime-entity`) is similar to `imail-save-mime-entity`, except that instead of saving the entity to a file, it toggles whether the entity is shown in-line or in abbreviated form. A common situation in which this is useful is when the text of a message is in an unknown character set. In this case, IMAIL by default shows the text in abbreviated form; use `C-t` to expand it in place.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.5 Flags

Each message can have various flags assigned to it as a means of classification. Each flag has a name; different names are different flags. Any given flag is either present or absent on a particular message. A few flag names have standard meanings and are given to messages automatically by IMAIL when appropriate. All other flags are assigned only by users.

`a flag `RET``
  Assign the flag flag to the current message (`imail-add-flag`).
`k flag `RET``
  Remove the flag flag from the current message (`imail-kill-flag`).
`C-M-n flags `RET``
  Move to the next message that has one of the flags flags (`imail-next-flagged-message`).
`C-M-p flags `RET``
  Move to the previous message that has one of the flags flags (`imail-previous-flagged-message`).
`C-M-l flags `RET``
  Make a summary of all messages containing any of the flags flags (`imail-summary-by-flags`).

The `a` (`imail-add-flag`) and `k` (`imail-kill-flag`) commands allow you to assign or remove any flag on the current message.

Once you have given messages flags to classify them as you wish, there are two ways to use the flags: in moving and in summaries.

The command `C-M-n flags `RET`` (`imail-next-flagged-message`) moves to the next message that has one of the flags flags. The argument flags specifies one or more flag names, separated by commas. `C-M-p` (`imail-previous-flagged-message`) is similar, but moves backwards to previous messages. A numeric argument to either command serves as a repeat count.

The command `C-M-l flags `RET`` (`imail-summary-by-flags`) displays a summary containing only the messages that have at least one of a specified set of flags. The argument flags is one or more flag names, separated by commas. See section 4.8 Summaries, for information on summaries.

If the flags argument to `C-M-n`, `C-M-p` or `C-M-l` is empty, it means to use the last set of flags specified for any of these commands.

Some flags such as ``deleted`' and ``filed`' have built-in meanings and are assigned to or removed from messages automatically at appropriate times. Here is a list of built-in flags:

``seen`'
  Means the message has been selected, implying that the user has seen it. Assigned to a message when it is selected by the user. When you start IMAIL, it initially shows the first message that lacks this flag.

``deleted`'
  Means the message is deleted. Assigned by deletion commands and removed by undeletion commands (see section 4.2 Deleting Messages).

``filed`'
  Means the message has been copied to another folder. Assigned by the message-copying commands (see section 4.3 Multiple Folders).

``answered`'
  Means you have mailed an answer to the message. Assigned by the `r` command (`imail-reply`). See section 4.6 Sending Replies.

``forwarded`'
  Means you have forwarded the message. Assigned by the `f` command (`imail-forward`). See section 4.6 Sending Replies.

``resent`'
  Means you have resent the message. Assigned by the command `C-u f` (`imail-resend`). See section 4.6 Sending Replies.

All other flags are assigned or removed only by the user, and have no standard meaning.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.6 Sending Replies

IMAIL has several commands that use Mail mode to send outgoing mail. What this section documents are the special commands of IMAIL for entering Mail mode. Note that the usual keys for sending mail---`C-x m`, `C-x 4 m`, and `C-x 5 m`---are available in IMAIL mode and work just as they usually do.

`m`
  Send a message (`imail-mail`).
`c`
  Continue editing the already started outgoing message (`imail-continue`).
`r`
  Send a reply to the current IMAIL message (`imail-reply`).
`f`
  Forward the current message to other users (`imail-forward`).
`C-u f`
  Resend the current message to other users (`imail-resend`).

The most common reason to send a message while in IMAIL is to reply to the message you are reading. To do this, type `r` (`imail-reply`). This displays the ``*mail*`' buffer in another window, much like `C-x 4 m`, but preinitializes the ``Subject`', ``To`', ``CC`' and ``In-reply-to`' header fields based on the message you are replying to. The ``To`' field starts out as the address of the person who sent the message you received, and the ``CC`' field starts out with all the other recipients of that message.

You can exclude certain recipients from being placed automatically in the ``CC`', using the variable `imail-dont-reply-to-names`. Its value should be a regular expression (as a string); any recipient that the regular expression matches is excluded from the ``CC`' field. The default value matches your own name, and any name starting with ``info-`' (the value of the variable `imail-default-dont-reply-to-names`). (Those names are excluded because there is a convention of using them for large mailing lists to broadcast announcements.)

To omit the ``CC`' field completely for a particular reply, enter the reply command with a numeric argument: `C-u r` or `1 r`.

By default, the ``Subject`' field of a reply is initialized to the contents of the ``Subject`' field of the message being replied to. However, if the variable `imail-reply-with-re` is set to `#t`, then the reply subject will be prefixed with ``Re:`'.

Once the ``*mail*`' buffer has been initialized, editing and sending the mail goes as usual. You can edit the presupplied header fields if they are not right for you. You can also use the commands of Mail mode, including `C-c C-y` which yanks in the message that you are replying to. You can switch to the IMAIL buffer, select a different message there, switch back, and yank the new current message.

Another frequent reason to send mail in IMAIL is to forward the current message to other users. `f` (`imail-forward`) makes this easy by preinitializing the ``*mail*`' buffer with the current message as a MIME attachment, and a subject designating a forwarded message. All you have to do is fill in the recipients and send. When you forward a message, recipients get a message which is "from" you, and which has the original message in its contents.

By default, forwarded messages are sent as MIME attachments, which allows MIME-aware mail readers to recognize that the attachment is a mail message and to specially present it. However, this means that such forwarded messages appear more complex when viewed in mail readers that do not understand MIME. IMAIL deliberately minimizes the amount of encoding overhead used for MIME-forwarded messages, but some people prefer not to use MIME at all. For that reason, IMAIL allows you to turn off this feature, so that forwarded messages are included in the main body of the message (as Rmail does). To do this, set the variable `imail-forward-using-mime` to `#f`.

Normally, when IMAIL forwards a message, it sends only a few of the message's header fields. In particular, it sends only those header fields that you see when viewing the message in IMAIL. Sometimes it is desirable to send all of the message's header fields; IMAIL provides two ways to do this. First, if you want to send all of the header fields for a particular message, use `imail-forward` with a negative argument, like this: `- f`. Alternatively, you can set the variable `imail-forward-all-headers` to `#t`, which will cause all forwarded messages to retain all of their header fields.

Resending is an alternative similar to forwarding; the difference is that resending sends a message that is "from" the original sender, just as it reached you--with a few added header fields ``Resent-from`' and ``Resent-to`' to indicate that it came via you. To resend a message in IMAIL, use `C-u f`. (`f` runs `imail-forward`, which is programmed to invoke `imail-resend` if you provide a numeric argument.)

The `m` (`imail-mail`) command is used to start editing an outgoing message that is not a reply. It leaves the header fields empty. Its only difference from `C-x 4 m` is that it makes the IMAIL buffer accessible for `C-c C-y`, just as `r` does. Thus, `m` can be used to reply to or forward a message.

The `c` (`imail-continue`) command resumes editing the ``*mail*`' buffer, to finish editing an outgoing message you were already composing, or to alter a message you have sent.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.7 Message Display

IMAIL provides several variables and commands to give you control over how messages are formatted in the message buffer.

By default, IMAIL automatically wraps long lines at the right margin. It uses adaptive fill (9) to do the wrapping, which means that common prefixes such as ``>`' and ``Chris>`' will be automatically copied down with the wrapped line. Generally, this wrapping makes messages easier to read. Specifically, it is important for messages sent by clients that use "soft" line breaks, because such clients expect the mail reader to wrap lines. However, if you'd rather not have IMAIL do this for you, you can disable wrapping by setting the variable `imail-auto-wrap` to `#f`.

Another feature of IMAIL is that it filters message headers, showing you only the most relevant ones. There are two variables that control how this is done, and a command that can override the filtering. The variable `imail-kept-headers` contains a list of regular expressions that are matched against message-header names (the name is everything to the left of the colon, e.g. ``From`' in ``From: cph`'). If `imail-kept-headers` is a non-empty list, then only the headers matching those regular expressions are shown. Furthermore, the shown headers will be in the same order as the regular expressions.

If `imail-kept-headers` is an empty list, then all of the message headers are shown, except those matching the regular expression that is the value of the variable `imail-ignored-headers`. By default, the value of `imail-ignored-headers` contains some common uninteresting header names; this expression is identical to the default used by Rmail. Note that `imail-ignored-headers` is a single regular expression, while `imail-kept-headers` is a list of regular expressions. This is because `imail-ignored-headers` is meant to be an exact analog of the Rmail variable `rmail-ignored-headers`.

Regardless of how the message-header filtering is done, you can toggle between viewing the filtered headers and the unfiltered headers using the `t` command (`imail-toggle-header`). If filtered headers are shown, this command replaces them with unfiltered headers, and vice versa.

As you can see, IMAIL performs extensive transformation of a mail message before presenting it to you: MIME formatting, line wrapping, and header filtering. Sometimes, it's desirable to see the original message, exactly as it was received, without any formatting at all. The command `C-c C-t C-m` toggles the entire message between a formatted view and a raw view. This should be used with care, as a message with a large attachment might not fit in memory in its raw form.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.8 Summaries

A summary is a buffer containing one line per message to give you an overview of the mail in an IMAIL folder. Each line shows the message number, the sender, the flags, and the subject. Almost all IMAIL commands are valid in the summary buffer also; these apply to the message described by the current line of the summary. Moving point in the summary buffer selects messages as you move to their summary lines.

A summary buffer applies to a single IMAIL folder only; if you are editing multiple IMAIL folders, each one can have its own summary buffer. The summary buffer name is made by appending ``-summary`' to the IMAIL buffer's name. Normally only one summary buffer is displayed at a time.

> 4.8.1 Making Summaries |  |
> 4.8.2 Editing in Summaries |  |

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.8.1 Making Summaries

Here are the commands to create a summary for the current IMAIL folder. Once the IMAIL folder has a summary buffer, changes in the IMAIL folder (such as deleting or expunging messages, and getting new mail) automatically update the summary.

`h`
`C-M-h`
  Summarize all messages (`imail-summary`).
`l flags `RET``
`C-M-l flags `RET``
  Summarize messages that have one or more of the specified flags (`imail-summary-by-flags`).
`C-M-r rcpts `RET``
  Summarize messages that have one or more of the specified recipients (`imail-summary-by-recipients`).
`C-M-t topic `RET``
  Summarize messages that have a match for the specified regexp topic in their subjects (`imail-summary-by-topic`).
`C-M-s regexp `RET``
  Summarize messages that have a match for the specified regexp anywhere in their header (`imail-summary-by-regexp`).

The `h` or `C-M-h` (`imail-summary`) command fills the summary buffer for the current IMAIL folder with a summary of all the messages in the folder. It then displays and selects the summary buffer in another window.

`C-M-l flags `RET`` (`imail-summary-by-flags`) makes a partial summary mentioning only the messages that have one or more of the flags flags. flags should contain flag names separated by commas.

`C-M-r rcpts `RET`` (`imail-summary-by-recipients`) makes a partial summary mentioning only the messages that have one or more of the recipients rcpts. rcpts should contain mailing addresses separated by commas.

`C-M-t topic `RET`` (`imail-summary-by-topic`) makes a partial summary mentioning only the messages whose subjects have a match for the regular expression topic.

`C-M-s regexp `RET`` (`imail-summary-by-regexp`) makes a partial summary mentioning only the messages whose headers contain a match for the regular expression regexp. This match includes all lines in the header, including for example the date and from lines.

Note that there is only one summary buffer for any IMAIL folder; making one kind of summary discards any previously made summary.

There are several variables that affect how summaries are displayed. `imail-summary-height` controls the height of the summary window. If it is an exact positive integer, the summary window is that many lines high. Alternatively, if it is a real number between 0 and 1 exclusive, the height of the summary window is computed by multiplying the number of lines in the message window by `imail-summary-height` and rounding to the nearest integer.

If the variable `imail-summary-fixed-layout` is set to `#t`, then an IMAIL message buffer and its associated summary buffer are always shown in a fixed window layout (provided the summary buffer exists). Selecting either buffer causes all other windows in the current editor frame to be deleted, then splits the frame into two windows showing the summary buffer and message buffer. Selecting any other buffer when this layout is displayed causes both windows to be deleted, and the other buffer displayed in a single window filling the editor frame. Basically, this causes the message and summary buffers to be treated as a unit most of the time. Currently, the default for `imail-summary-fixed-layout` is `#f`, but the feature has been very popular and the default may be changed to `#t` in a future release.

When fixed layout is not used, the variable `imail-summary-pop-up-message` provides a different kind of window splitting for message and summary buffers. If this is set to `#t` (the default), then selecting a new message in the summary buffer causes the message buffer to be popped up in a new window if it isn't already visible.

If the variable `imail-summary-highlight-message` is `#t`, the message currently selected in the message buffer is highlighted in the summary buffer. This aids navigation in the summary buffer and is thus the default. Set it to `#f` if you don't like the highlighting.

By default, the summary buffer has five columns: flags, message number, message length, subject, and author. If `imail-summary-show-date` is set to `#t`, a sixth column containing an abbreviated date appears between the message number and the subject.

The width of the subject column is specified by the value of `imail-summary-subject-width`; subject fields longer than this number of characters are truncated.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.8.2 Editing in Summaries

You can use the IMAIL summary buffer to do almost anything you can do in the IMAIL buffer itself. In fact, once you have a summary buffer, there's no need to switch back to the IMAIL buffer.

You can select and display various messages in the IMAIL buffer, from the summary buffer, just by moving point in the summary buffer to different lines. It doesn't matter what Emacs command you use to move point; whichever line point is on at the end of the command, that message is selected in the IMAIL buffer.

Almost all IMAIL commands work in the summary buffer as well as in the IMAIL buffer. Thus, `d` in the summary buffer deletes the current message, `u` undeletes, and `x` expunges. `o` outputs the current message to a folder; `C-o` saves an attachment from the current message; `r` starts a reply to it. You can scroll the current message while remaining in the summary buffer using `SPC` and `DEL`.

The IMAIL commands to move between messages also work in the summary buffer, but with a twist: they move through the set of messages included in the summary. They also ensure the IMAIL buffer appears on the screen (unlike cursor motion commands, which update the contents of the IMAIL buffer but don't display it in a window unless it already appears). You can always display the message indicated by point using the `e` command (`imail-summary-select-message`).

When you are finished using the summary, type `C-x k `RET`` to delete the summary buffer's window.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.9 Sorting Messages

IMAIL provides several commands that change the order of messages within a folder. These commands are closely modelled on those of Rmail. Note that these commands don't modify the folder itself; they only modify the way that the folder behaves. This means that if a folder buffer is deleted, the sort order associated with that buffer is deleted too.

`C-c C-s C-v`
  Sort messages of current IMAIL folder by arrival time (`imail-sort-by-arrival`). This is the default; this sort undoes any other sorting on the folder.

`C-c C-s C-d`
  Sort messages of current IMAIL folder by date (`imail-sort-by-date`).

`C-c C-s C-s`
  Sort messages of current IMAIL folder by subject (`imail-sort-by-subject`).

`C-c C-s C-a`
  Sort messages of current IMAIL folder by author's name (`imail-sort-by-author`).

`C-c C-s C-r`
  Sort messages of current IMAIL folder by recipient's names (`imail-sort-by-recipient`).

`C-c C-s C-c`
  Sort messages of current IMAIL folder by the name of the other correspondent (`imail-sort-by-correspondent`).

The IMAIL sort commands perform a stable sort: if there is no reason to prefer either one of two messages, their order remains unchanged. You can use this to sort by more than one criterion. For example, if you use `imail-sort-by-date` and then `imail-sort-by-author`, messages from the same author appear in order by date.

With a numeric argument, all these commands reverse the order of comparison. This means they sort messages from newest to oldest, from biggest to smallest, or in reverse alphabetical order.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.10 Other Commands

This section documents a handful of commands and variables that don't fit into any of the other documentation categories.

`q`
  Quit out of IMAIL (`imail-quit`). This closes all open IMAP connections and buries all IMAIL buffers. With prefix argument, only affects the current IMAIL buffer, leaving any other IMAIL buffers alone.

`M-d`
  Disconnect from the IMAP server (`imail-disconnect`).

`b`
  Bury the IMAIL buffer (`imail-bury`).

`s`
  Save changes in the current folder to disk (`imail-save-folder`).

When you are finished reading mail in a folder, use the `q` command (`imail-quit`). This command closes the folder, then buries the buffer. Closing a folder has different effects, depending on the type of folder. Closing an IMAP folder causes IMAIL to disconnect from the IMAP server (go offline). Closing a file folder saves any changes out to the corresponding file. In both cases, internal data structures may be dropped, requiring them to be rebuilt, should the folder later be re-opened. In no case are any changes made to the folder's contents; in particular, deleted messages are not expunged.

On IMAP folders, the `q` command is equivalent to `M-d b`. On file folders, the `q` command is equivalent to `s b`.

The `M-d` command (`imail-disconnect`) disconnects IMAIL from the IMAP server (goes offline). This has no effect on file folders.

The `b` command (`imail-bury`) buries the selected IMAIL buffer. Burying a buffer means moving it to the bottom of the buffer list and selecting another buffer from the top of the list. This is similar to the command `bury-buffer`, except that any summary buffer associated with this buffer is also buried, and if a window was created to hold the summary buffer, it is deleted.

The `s` command (`imail-save-folder`) saves out any changes to the selected IMAIL folder. For file folders, this means writing the folder back out to its file. For IMAP folders, this no effect. In no case are any changes made to the folder's contents; in particular, deleted messages are not expunged.

IMAIL normally caches IMAP message bodies in memory in order to increase performance. The variable `imail-body-cache-limit` gives you some control over how this caching is done. `imail-body-cache-limit` is normally set to a positive integer, meaning that any message body or in-line MIME entity whose size in bytes is less than this number is cached. However, caching can be entirely disabled by setting `imail-body-cache-limit` to `#f`, or made unconditional by setting it to `#t`.

Another thing that IMAIL caches is IMAP passwords. This is done so that you don't have to keep typing your password whenever you connect to a new IMAP folder. However, this is also a security risk, because the password is kept in Scheme's memory. The variable `imail-pass-phrase-retention-time` says how long passwords are cached, in minutes. Normally this is set to 30 minutes, but if you are paranoid you can set it to zero to disable password caching altogether. Scheme keeps track of the use of each password, and deletes its copy of the password when it has expired. Additionally, Scheme stores passwords in an obscured form, to prevent them being seen during casual browsing through memory structures, but this does not provide any protection against a deliberate attempt to find the password.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Chris Hanson on June, 17 2002 using texi2html