\input texinfo  @c -*-texinfo-*- created at: Tue Oct 14 03:27:16 JST 1997
@setfilename cmail.en.info
@settitle cmail reference manual
@iftex
@afourpaper
@end iftex
@direntry
* cmail: (cmail.en).	A Mail User Agent for Emacsen (in English)
@end direntry

@titlepage
@title cmail reference manual
@author Yukihiro Matsumoto
@author matz@@ruby-lang.org
@end titlepage

@node Top, Introduction, (dir), (dir),
@comment  node-name,  next,  previous,  up
@top cmail reference manual

@menu
* Introduction::                
* Distinctive features::                 
* Installing cmail::         
* Using cmail - basic usage::
* Using cmail - advanced usage::      
* Customizing cmail::         
* Command list::            
* Bug report::                
* Acknowledgments::                        
* Concept Index::               
* Function Index::              
* Variables Index::             

 --- The Detailed Node Listing ---

Install

* Specification change since old version::

Using cmail - advanced usage

* Automatic archiving::           
* Search::                            
* Automatic expiry::              
* Mail send log::                     
* Address completion::                
* MIME Support::                      
* Threading::                         
* Folders mode::                      
* Compressed folders::                
* Using cmail as user mail agent::      

Customizing cmail

* Customizing header layout::    
* Customizing thread layout::    
* Customizable variables::        

Command list

* Commands in summary mode::       
* Commands in folders mode::       
@end menu

@node  Introduction, Distinctive features, Top, Top
@comment  node-name,  next,  previous,  up
@chapter Introduction

@samp{cmail} is a mail user agent (MUA) that runs on GNU Emacs variants;
it is a user program written in Emacs Lisp that helps the user to
display, compose and send electric mail messages.

@samp{cmail} version 1.* was originally developed by Makoto Hayashi, and
it was called @samp{chain-mail}. Since then, Yukihiro Matsumoto has made
major changes, and resulted in the present version (version 2.*) of
@samp{cmail}.

@samp{chain-mail} was named after armor made of joined metal links,
however, lately it appeared to confuse people with chain letter.
Because of this, it has been renamed to @samp{cmail}.

@samp{cmail} manages multiple messages together using a folder.  Every
folder contains a list of summary lines (a summary line consists of
information in the message header such as date, sender and subject).  It
allows user to select, read and edit messages. It also provides the user
with sort functionality by any sort key.

Basic message handling functions such as sending a message, composing a
reply and deleting messages are of course supported.  In addition, the
automatic archiving feature is available.

@node  Distinctive features, Installing cmail, Introduction, Top
@comment  node-name,  next,  previous,  up
@chapter Distinctive features

@samp{cmail}'s distinctive features include the following:

@itemize @bullet
@item
Keep it simple, use third party packages/add-on options for extention

@samp{cmail} is designed to be flexible to interface with third party
packages and add-on options, and keep the basic functionality simple, in
order to prevent the core part from growing in size and complexity.
Users are encouraged to use third party packages and/or add-on options
to extend its functionality as they wish.  @samp{cmail} implements a
framework to support external packages and add-on options in an
integrated manner through the Emacs customize interface.  This allows
@samp{cmail} to provide easy-to-activate and easy-to-configure external
options.

@item
message management using a folder

@samp{cmail} employs the one file per folder concept, therefore, message
management is relatively easy. It also can handle compressed folders by
using jam-zcat.el or jka-compr.el.  (@pxref{Compressed folders})

On the other hand, too many messages and/or many large size message in a
folder will often cause performance degradation due to seek and file
I/O, thus provide features such as automatic expiry and automatic
archiving to keep the folder size small.

@item
Fully complied to the Emacs customize system

Most of option variables, if not all, can be configured using Emacs
customize system avaialble in XEmacs and recent GNU Emacs versions.

@item
Prompts, error messages and cutomize description in English or Japanese

Prompts, error messages and cutomize description can be displayed in
Japanese language if the Emacs supports Japanese encoding and fonts.

@item
User interface is similar to GNUS (not everyone agrees with this.)

User interface in summary mode was designed to follow the GNUS's subject
mode. Note that the default key binding reflects Matsumoto's preference.
As same as GNUS, it has a function to display thread in a hierarchical
fashion.

@item
Automatic archiving

It provides the automatic archiving feature, which automatically moves
messages from one folder to another based on the message's header
information and a user defined folder selection rule. This gives a
convenient way to handle particular messages like mailing list
messages. Not only a simple regular expression but also a lisp function
can be used as the message archiving rule in order to select destination
folder for a message.  (@pxref{Automatic archiving})

@item
Automatic expiry

It provides functionality to automatically delete old messages that are
not needed to preserve. This would be convenient when dealing with
messages from mailing lists, which in many cases do not require to keep
old messages. (@pxref{Automatic expiry})

@item
Address Completion

@samp{cmail} features email address completion. The completion is
available not only in the mini buffer when prompting for an email
address, but also in the header part of the cmail mail mode buffer.
(@pxref{Address completion})

@item
Folder format conversion tools

@samp{cmail} encourages migration from/to other MUAs by supplying folder
format conversion tools mutually with the mbox format and from RMAIL to
@samp{cmail} format. At present, no mutual format conversion with mh is
supported, however, it is possible to convert indirectly via the mbox
format. A perl script to convert RMAIL format to the cmail folder format
is also available. Please refer to @file{cmail-r2c.doc} for more detail.

@end itemize

@node Installing cmail, Using cmail - basic usage, Distinctive features, Top
@comment  node-name,  next,  previous,  up
@chapter Installing cmail

To use @samp{cmail}, follow the procedure in README and install
@samp{cmail} package (cmail*.el) in a directory in your emacs load path.
For example, if you installed @samp{cmail} in
@file{/usr/local/lib/emacs/lisp}, please confirm that lisp variable
load-path includes @code{"/usr/local/lib/emacs/lisp"}.

Next, customize the following variables appropriately to fit your
environment. (Refer to @file{cmail-vars.el} for more detail about these
variables)


@table @code
@item cmail-spool-directory
@vindex cmail-spool-directory

This informs @samp{cmail} of the location of the incoming mail spool on
your host machine.  The default value of this variable is
@code{"/usr/spool/mail/"} and if this is different from your host
machine setting, please modify accordingly. If this variable contains
wrong information, incoming messages will not be properly handled.


@item cmail-path
@vindex cmail-path

This variable designates a directory where @samp{cmail} stores folders.

The default value is @code{"~/Mail/"}. Make appropriate change in such
cases when this directory is already in use for another purposes.

@end table

Next, create the directory designated by @code{cmail-path} in your home
directory.

Then add the following lines to @file{.emacs}.

@example
(autoload 'cmail "cmail" nil t)
@end example

After starting a new Emacs session, @samp{cmail} can be invoked by
entering @kbd{M-x cmail}.

By typing @kbd{C-u M-x cmail} you can skip retrieving new incoming
messages.

If you have been using an old version of cmail, read
@pxref{Specification change since old version}, and follow appropriate
process.

@menu
* Specification change since old version::  
@end menu

@node  Specification change since old version, , Installing cmail, Installing cmail
@comment  node-name,  next,  previous,  up
@section Specification change since old version

@strong{Regarding character coding specification}

Before @samp{cmail-2.59}, when saving a folder file, @samp{cmail} was
converting (Japanese) characters using the default coding system. In
later releases, a change has been made to store a folder without
converting the character code from the coding originally delivered to
the mail spool.

By this, even if a message that contains illegal character codes is
received in the mail spool, it will not cause any damage over the rest
of messages.

However, this may cause a side effect to folders created by an older
version of @samp{cmail}. A new version of @samp{cmail} may not handle
MIME preview properly for messages in the older folders. Another
possible side effect is that Japanese subject in old messages no longer
be readable.

These problems can be avoided by converting the character coding to
ISO-2022-JP(JIS) in prior to the version upgrade of @samp{cmail}.

BTW, if you are on a system that automatically converts character coding
to EUC or Shift-JIS, to make cmail work properly, you may add the
following line to your @file{.emacs}:

@example
(setq cmail-mime-automatic-preview nil)
@end example


By setting this up, however, you will no longer be able to decode MIME
messages. At the time message character is changed in the mail spool,
meaning of the MIME messages is somehow lost anyways, so be with it.

tm version 7.xx and SEMI 0.118.2 or later is now mandatory. If you use
an older version of tm or SEMI, please get and install a newer version
from the following location.  Especially for SEMI/FLIM, it is
recommended to always use latest version.

@display
@code{http://cvs.m17n.org/elisp/SEMI/}
@code{http://cvs.m17n.org/elisp/FLIM/}
@code{http://cvs.m17n.org/tomo/comp/emacsen/tm/tm-8/}
@end display

@strong{Regarding external packages}

In @samp{cmail-2.61} and later version, @samp{cmail} uses functions in
APEL. If no emu package is installed on your system, when installing
@samp{cmail}, by following the install procedure written in README, an
APEL package comes with @samp{cmail} will be automatically installed.
Please use APEL version 9.23 or laer.  @samp{cmail} distribution file
includes a confirmed version of recent version of APEL.

@display
@code{http://cvs.m17n.org/elisp/APEL/index.en.html}
@end display

@strong{Regarding folders mode}

@samp{cmail-2.59.6} introduced @xref{Folders mode}. A list of folders
can be displayed by typing @kbd{C-cf}. The user can change, rename, copy
and delete folders in this mode.


@samp{cmail-2.59.12} renewed the implementation of folders mode, and
the following specification changes and additions were made.

@itemize @bullet
@item
Entire code has been completely re-written by using emacs lisp. Because
of this, external process (perl or cmfolders) is obsoleted. And the
following variables have been removed.

@itemize @bullet
@item *cmail-folders-proc
@item *cmail-folders-proc-params
@end itemize

@item
Before @samp{cmail-2.59.11}, the number of messages in a folder was not
automatically synchronized between folders list and the actual folders;
therefore manual update was required. @samp{cmail-2.59.12} made an
enhancement so that folders list information is always updated whenever
a cmail command is executed, and a manual update becomes no longer
necessary.

@item
Format of the cache file that stores folder information was changed.
Therefore, when upgrading from an older version to @samp{cmail-2.59.11}
or later, starting up cmail immediately after the upgrade may take long
time if you have many folders. This is because @samp{cmail} must
recreate the cache files from scratch. Please bear this in mind.


@item
Directory tree support was added. Key binding was designed based on the
info mode.

@item
You can now specify the order of folders and directories, in addition to
displaying them in a sorted order. The folders listed in lisp variable,
@code{cmail-folders-list-top}, will be displayed from the top of the
folders mode buffer, and the other folders listed in a variable,
@code{cmail-folders-list-bottom}, will be placed from the bottom (in the
designated order). Folders not found in these variables will be placed
in between the top block and the bottom block in sorted order.  When
designating a directory in these lisp variables, please add `/' at the
end of the directory name. It ignores folders or directories listed in
the variables but do not exist.


An example follows:

@example
(setq cmail-folders-list-top
      '("/digest"
        "inbox"
        "cmail-ML/1998summar"
        "cmail-ML/"
        "Meadow-users-jp-ML.gz"
        "hogehoge/")
      cmail-folders-list-bottom
      '("tmp"
        "cmail-ML/OLD.gz"
        "etc.gz"
        "outbox.gz"))
@end example

@item
You can now choose whether to display paths of folders in a
sub-directory via a switch variable or a keyboard command.

@end itemize

@node  Using cmail - basic usage, Using cmail - advanced usage, Installing cmail, Top
@comment  node-name,  next,  previous,  up
@chapter Using cmail - basic usage

When @samp{cmail} starts up, if new messages have arrived in the system
mail spool, it retrieves the messages and appends them to a folder
called @samp{INBOX}.  Then, @samp{cmail} displays summary lines of the
@samp{INBOX} folder. Initially, cursor should be on the first unread
message, if it exits.

When the space key (@code{cmail-read-contents}) is pressed, @samp{cmail}
displays the current message in the readmail mode buffer.  As you keep
typing the space key, the message scrolls up, and once the end of the
message is reached, next message will be displayed. In short, you can
continue reading messages until the last message in the folder.

@display
@kbd{SPC} (@code{cmail-read-contents}) : display message, scroll up.
@end display
@findex cmail-read-contents

Typing @kbd{b} or @kbd{DEL}(@code{cmail-read-reverse}) will scroll down
the displayed message.

@display
@kbd{DEL} (@code{cmail-read-reverse}) : message scroll down.
@end display
@findex cmail-read-reverse

When you are reading a message, in the middle of the message, you can
jump to the next message by typing @kbd{n}(@code{cmail-next-mail}) or
@kbd{N}(@code{cmail-next-unread-mail}).

@display
@kbd{n} (@code{cmail-next-mail}) : display next message
@kbd{N} (@code{cmail-next-unread-mail}) : display next unread message
@end display
@findex cmail-next-mail
@findex cmail-next-unread-mail

With keyboard commands @kbd{C-n} and @kbd{C-p}, you can move the cursor
without displaying any messages. After moving the cursor, you can press
the space key to display the message at the current cursor position.

To compose a new message, use @kbd{m}(@code{cmail-mail}).

@display
@kbd{m} (@code{cmail-mail}) : Compose a new message
@end display
@findex cmail-mail

When you want to reply to the current message you are reading, use
@kbd{r} (@code{cmail-reply}) or
@kbd{R} (@code{cmail-reply-include-text}).

@display
@kbd{r} (@code{cmail-reply}) : Compose a reply message.
@kbd{R} (@code{cmail-reply-include-text}) : Compose a reply, quote the original message.
@end display
@findex cmail-reply
@findex cmail-reply-include-text

In the above case, the reply will be addressed to the sender found in
the @code{From} field.  If there is a @code{Cc} field, and if you want
to send the reply to those CC addressees as well, you may use
@kbd{f}(@code{cmail-followup}) or
@kbd{F}(@code{cmail-followup-include-text}).

@display
@kbd{f} (@code{cmail-followup}) : Reply to all ( including CC addressees )
@kbd{F} (@code{cmail-followup-include-text}) : Reply to all (including CC addressees), quote the original message. 
@end display
@findex cmail-followup
@findex cmail-followup-include-text

To delete the message at the cursor position,
@kbd{d}(@code{cmail-delete-mail}) may be used. Executing this command
adds @samp{D} mark to the current message.

@display
@kbd{d} (@code{cmail-mark-delete}) : Add deletion mark (@samp{D})
@end display
@findex cmail-mark-delete

To add general marks to all messages in a thread that includes the
message at the cursor line, use @kbd{C-c^}
(@code{cmail-mark-thread}). To add deletion mark to all messages
in a thread, use @kbd{C-cd}(@code{cmail-th-mark-delete}).

If you want to apply these commands to the sub-tree starting from the
message at the cursor line, prefix a universal argument @kbd{C-u}.

@display
@kbd{C-c^} (@code{cmail-mark-thread}) : Add general marks (@samp{^}) to messages in a thread
@kbd{C-cd} (@code{cmail-th-mark-delete}) : Add deletion marks (@samp{D}) to messages in a thread
@end display
@findex cmail-mark-thread
@findex cmail-th-mark-delete

Actual deletion will be performed when entering
@kbd{x}(@code{cmail-execute-index}) command. You can cancel deletion
marks @samp{D} in case you have mistakenly added the mark, as long as
actual deletion is not yet performed by this command.

@display
@kbd{x} (@code{cmail-execute-index}) : Actually delete messages with deletion mark @samp{D}
@kbd{u} (@code{cmail-unmark}) : Remove general or deletion mark
@end display
@findex cmail-execute-index
@findex cmail-unmark

While @samp{cmail} is up and running, if new messages arrive, you can
get them from the mail spool and move them into the @samp{INBOX} folder
by pressing @kbd{g}(@code{cmail-get-newmail}).

@display
@kbd{g} (@code{cmail-get-newmail}) : Get new messages
@end display
@findex cmail-get-newmail

To move the message at the cursor line to another folder, type
@kbd{M-m}(@code{cmail-move-to-folder}).

@display
@kbd{M-m} (@code{cmail-move-to-folder}) : Move message to another folder
@end display
@findex cmail-move-to-folder

After pressing @kbd{M-m}, cmail prompts for a destination folder in
the mini buffer. Enter a folder name as you like. If the folder does not
exist, it prompts for confirmation if you want to create a new folder.
For those folders already exist, you can use completion over the folder
names by @kbd{TAB} key.

Messages will stay in @samp{INBOX} even after they are read, unless
deleted, moved to another folder or automatically archived. Please refer
to section (@pxref{Automatic archiving}) regarding Automatic archiving.

To close the current folder, and to move to another folder for viewing
its content, press @kbd{v}(@code{cmail-visit-folder}). In @samp{cmail},
operation like this, to go to another folder, is called "visit".

@display
@kbd{v} (@code{cmail-visit-folder}) : visit a folder.
@end display
@findex cmail-visit-folder

By pressing @kbd{v}, @samp{cmail} prompts in the mini buffer for a name
of a folder to be visited. The operation is similar to
@kbd{M-m}(@code{cmail-move-to-folder}) command.

The cmail folders can be stored in a hierarchical way. You can create a
visually comprehensive list of folders and access them from the folders
mode screen.

@display
@kbd{C-cf} (@code{cmail-folders}) : Folders mode
@end display
@findex cmail-folders

To end a folders mode session and go back to the previous summary mode
session, press @kbd{q} in the folders mode buffer.

To end a @samp{cmail} session, press @kbd{q}(@code{cmail-quit}) in the
summary mode buffer.

@display
@kbd{q} (@code{cmail-quit}) : Quit @samp{cmail}
@end display
@findex cmail-quit

Just before exiting, based on user preferences, automatic archiving and
expunging deletion-marked messages may occur. Then all opened folders
will be saved.

Explained here are basic commands only. Please refer to tables in the
later section, to learn more about other @samp{cmail} commands.

@xref{Commands in summary mode}

@xref{Commands in folders mode}


@node  Using cmail - advanced usage, Customizing cmail, Using cmail - basic usage, Top
@comment  node-name,  next,  previous,  up
@chapter Using cmail - advanced usage

@menu
* Automatic archiving::                    
* Search::                    
* Automatic expiry::                  
* Mail send log::          
* Address completion::            
* MIME Support::                    
* Threading::                  
* Folders mode::          
* Compressed folders::                
* Using cmail as user mail agent::                
@end menu

@node  Automatic archiving, Search, Using cmail - advanced usage, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Automatic archiving
@cindex Automatic archiving

@samp{cmail} features Automatic archiving, which automatically saves
mail messages to selected folders based on mail header information. This
is a convenient way to handle mail messages from mailing lists.

When one of the following events occurs, @samp{cmail} moves mail
messages to corresponding folders by referring to a definition found in
variable @code{cmail-folder-alist}.


@itemize @bullet
@item
While visiting @samp{INBOX}, when entering @kbd{M-a}(@code{cmail-auto-archive-all}).
@item
While visiting @samp{INBOX}, when entering @kbd{C-u A}(@code{cmail-auto-archive}).
@item
While visiting @samp{INBOX}, when entering @kbd{A}(@code{cmail-auto-archive}).
@item
While visiting @samp{INBOX}, when quitting @samp{cmail} by entering @kbd{q}(@code{cmail-quit}).
@item
When visiting other folder from @samp{INBOX}.
@end itemize

Except for @kbd{M-a, C-u A} and when visiting other folder, automatic
archiving will not occur for unread, deleted and held messages. These
messages will be left in INBOX. If @kbd{M-a, C-u A} is pressed, unread
messages will also be archived.

When visiting other folder from the INBOX folder, if the folder being
visited is one of the destination folders of messages in INBOX, the
messages will be moved regardless of the messages status, whether or not
they are read.  If you don't like Automatic archiving to kick in when
visiting other folder, you can include the following definition in
@file{.emacs}.
 
@example
(setq cmail-archive-on-visit nil)
@end example
@vindex cmail-archive-on-visit

In addition, if @file{.emacs} includes the following line, when getting
new messages by @kbd{g}(@code{cmail-get-newmail}), Automatic archiving
will occur over unread messages.

@example
(setq cmail-archive-on-get t)
@end example
@vindex cmail-archive-on-get

Setting up @subsection @code{cmail-folder-alist}

@vindex cmail-folder-alist

For example, if you want to archive messages:

@itemize @bullet
@item
from Mr. Foo (foo) to folder @samp{FOO}.
@item
with the Subject field containing a string "test" to folder
@samp{test}.
@end itemize

You would use the following or similar definition in @file{.emacs}.

@example
(setq cmail-folder-alist
      '(("From" ("foo" . "FOO"))
        ("Subject" ("test" . "test"))))
@end example

This lisp expression is called association list. Rules that appear first
in this association list has precedence. Therefore, in the above
example, a message from Mr. Foo with Subject test would go into the
folder @samp{FOO}.

General format of @code{cmail-folder-alist} is as follows:

@example
'((header-field-name condition-folder-pair) @dots{})
@end example

@samp{header-field-name} is the message header field name.

The @samp{condition-folder-pair} is one of the following formats.

@example
(Field-value . Folder-name)
@end example

If the value in @samp{header-field-name} matches @samp{field-value},
@samp{folder-name} is used as the destination folder for Automatic
archiving.  @samp{folder-name} can be either a string of a folder name,
or a function that returns a folder name string. Function shall be
designated as a function symbol, or a lambda expression.

@example
test-function
@end example

@samp{test-function} can be designated by symbol or lambda
expression. When the function is invoked, current buffer is set to the
message being tested.  You can use all functionality of Emacs lisp to
determine its destination folder. The return value of this function
shall be @code{nil}, or string that represents the destination folder
name. Returning @code{nil} means there is no associated destination
folder.

When variable @code{cmail-use-regexp-in-folder-alist} is @code{non-nil},
@samp{header-field-name} and @samp{field-value} may include a regular
expression.

@vindex cmail-use-regexp-in-folder-alist

@node  Search, Automatic expiry, Automatic archiving, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Search function

You can search text in messages in a folder by regular expression.

@findex cmail-summary-isearch-article
@findex cmail-summary-search-article-forward
@findex cmail-summary-search-article-backward
@display
@kbd{s} (@code{cmail-summary-isearch-article}) : Incremental search for message
@kbd{C-c s} (@code{cmail-summary-search-article-forward}) : Search forward
@kbd{C-c r} (@code{cmail-summary-search-article-backward}) : Search backward
@end display

No search functionality that traverse multiple folders is provided.

@node  Automatic expiry, Mail send log, Search, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Automatic expiry
@cindex Automatic expiry

Based on user preference, @samp{cmail} can delete old mail messages
automatically. This is a convenient feature if you subscribe to mailing
lists and receives large number of messages, and if keeping old mail
messages is not really important.

By default, @samp{cmail} will not perform automatic expiry. To enable
the expiry function, set variable
@code{cmail-auto-expriable-folders} to folder names.

@vindex cmail-auto-expirable-folders

The data type of @code{cmail-auto-expirable-folders} shall be string, or
list of string. If this is string, it is a regular expression that
matches with folder names to run automatic expiry. If this is list of
string, it shall be a list of folder names.

By default, to determine if messages are considered old, @samp{cmail}
refers to variable @code{cmail-default-expiry-days} (default is 7 in
days).  Another variable @code{cmail-expiry-days-alist} may be set to
adjust this number per folder basis.

@vindex cmail-default-expiry-days
@vindex cmail-expiry-days-alist

@node  Mail send log, Address completion, Automatic expiry, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Mail send log
@cindex Mail send log

If you want to save messages you send into a folder, specify the
following:

@enumerate
@item
Set @code{cmail-use-send-mail-archive} to @code{t}
@vindex cmail-use-send-mail-archive

Add the above in @file{.emacs}.

@item
Set @code{cmail-archive-folder} appropriately
@vindex cmail-archive-folder

This tells @samp{cmail} the folder name where the sent mail should be
saved.  You can designate it by a folder name, or by a lisp function
that returns a folder name. The default value is @code{"archive"}.

@item
Set @code{cmail-archive-from} appropriately
@vindex cmail-archive-from

When saving a sent message into the archive folder, @samp{cmail} creates
and inserts From and Date header field. This variable designates a
string to be used in the from field. The default value is the return
value from @code{(user-login-name)}.

@end enumerate

@node  Address completion, MIME Support, Mail send log, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Address completion
@cindex Address completion

To help user to input email addresses, @samp{cmail} supports address
completion feature based on user's @file{.mailrc} and @file{.addresses}
files.

@file{.addresses} is a file that contains lines of pair of email address
and comments (mainly the addressee's real name). Space or tab is allowed
as a separator. Example:

@example
foo                     Mr. Foo
bar@@scallion           Ms. Bar
@end example

In the cmail mail mode buffer, if cursor is in the header part,
completion may be used by using @kbd{TAB} key. If cursor is in the body
portion, completion can be done by typing @kbd{C-u TAB}.

@subsection .addresses address registration function

As explained above, by registering email address in @file{.mailrc} or
@file{.addresses}, you will be able to use address completion.  However,
this registration process could be annoying sometimes. @samp{cmail} has
a feature to help you register new email addresses into the
@file{.addresses}.

By typing @kbd{C-ca} (@code{cmail-add-new-address-from-mail}) in summary
mode buffer, you can add the sender's address of the current message to
@file{.addresses}.

@findex cmail-add-new-address-from-mail


@node  MIME Support, Threading, Address completion, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section MIME Support
@cindex MIME Support

@samp{cmail} supports MIME message in conjunction with an add-on MIME
package. (@file{tm-cmail.el}/@file{cmail-mime.el}). To handle MIME
messages, either tm (Tools for MIME) or SEMI (SEMI is Emacs MIME
Interfaces) packages is required.

The latest tm/SEMI packages can be obtained from:

@display
@code{http://cvs.m17n.org/elisp/SEMI/}
@code{http://cvs.m17n.org/elisp/FLIM/}
@code{http://cvs.m17n.org/tomo/comp/emacsen/tm/tm-8/}
@end display

Please install the package according to the procedure in @file{README}.

After installing, please add the following line to @file{.emacs}.

@example
(setq cmail-use-mime t)
@end example

@vindex cmail-use-mime


If MIME package is properly configured, you can use the following
addition commands in the summary mode buffer.

@noindent
@example
@kbd{C-c t}       (When MIME preview is off) toggle header decoding on/off.
@kbd{C-c C-t}     Automatic MIME preview on/off.
@kbd{!}	          Enter into mime/viewer-mode.
@end example

And the following variables are in effect.

@example
(defvar cmail-mime-automatic-preview t
  "*When non-nil performs automatic MIME preview.")

(defvar cmail-mime-decode-message-header cmail-mime-decode
  "*When non-nil, even if automatic MIME preview is off, perform header decoding.")
@end example
@vindex cmail-mime-automatic-preview
@vindex cmail-mime-decode-message-header

@node  Threading, Folders mode, MIME Support, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Threading
@cindex Threading

By default, @samp{cmail} threads messages, which is similar to the GNUS
Subject mode. There is a trade off, it slows the summary mode display
speed, however. This is very convenient feature, when used in mailing
list or other messages, you can follow discussions easily by threaded
summary lines.

To temporarily disable threading, type @kbd{C-t}.  By typing @kbd{C-t}
again, threads will be redisplayed.


@display
@kbd{C-t} (@code{cmail-visit-folder}) : Turn on/off threading
@end display

Setting up @subsection @code{cmail-sort-header-alist}

@vindex cmail-sort-header-alist

There is an area at the beginning of each folder file, where
pre-extracted information of individual messages (called the index) is
stored.

Threading is realized by using this summarized indices, by searching
referred message in a thread. In the cases such as when message arrival
order is reversed, threading may not function properly.

This problem can be avoided by sorting mail messages prior to folder
visit in the destination folders when automatic archiving or manual move is
performed. Use sort by Subject, for example.

By using @code{cmail-sort-header-alist} you can designate how to sort
the summary of the archive folders, which is used when automatic
archiving or manual move is executed. In the same way as
@code{cmail-folder-alist}, earlier the folder is found in the
association list, more has it precedence.

Element in @code{cmail-sort-header-alist} takes the following format.

@example
(key (folder @dots{}))           ;; Where key is either "S", "R", "A", "D", "T"
(key (pattern (folder @dots{}))) ;; Where key is "N", "H", "F"
@end example

The sort key letter can be one of the following. It is case insensitive.

@itemize @bullet
@item "S": By subject
@item "R": By related subject
@item "A": By sender name
@item "D": By date
@item "T": By time and date
@item "N": By number in a specified header field
@item "H": By header field
@item "F": By return value of specified function
@end itemize

The following are examples of the former format.

@example
(setq cmail-sort-header-alist
      '(("S" ("foo" "bar" "hoge" "uja"))
        ("A" ("glorp" "nerp"))
        ("D" ("archive"))
        ("R" ("folder" "folder_name" "etc"))))
@end example

The following are examples of the latter format. With this format,
sort can be performed on any desired header field.

@example
(setq cmail-sort-header-alist
      '(("N" ("X-MAIL-Count" ("foo" "bar")))
        ("H" ("Header-Field" ("glorp" "nerp")))
        ("F" (func_name ("folder_name" "etc")))))
@end example

Folders that do not match with any entry in
@code{cmail-sort-header-alist} will be sorted by the sort method defined
in @code{cmail-sort-header-default}. (Default is no sort.) "N", "H" and
"F" cannot be specified in @code{cmail-sort-header-default}.

@findex cmail-visit-folder

@node  Folders mode, Compressed folders, Threading, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Folders mode
@cindex Folders mode

Cmail folders can be stored in a hierarchical way. You can create a
visually comprehensive list of folders and access the folders from the
folders mode screen.  This functionality is implemented by Motonori
Iwamuro @samp{<iwa@@mmp.fujitsu.co.jp>}.

By default, @samp{cmail} will start from the folders mode. However,
by adding the following line to @file{.emacs}, you can make the summary
mode as the start up screen.

@example
(setq cmail-use-folders-mode-first nil)
@end example
@vindex cmail-use-folders-mode-first
@noindent

In addition, by setting @code{cmail-always-display-folders} to @code{t},
@samp{cmail} operates in the three windows layout, and folders list is
always displayed on the left most window. You can change the window by
typing TAB key. Relative size of these windows is configurable by
@code{cmail-window-horizontal-size}. Default is set to 1:3.

In case @code{cmail-always-display-folders} is set @code{'auto} the
three window layout is used only when the frame width is more than
@code{cmail-always-display-folders-threshold} (default is 100).

Although the default value of @code{cmail-always-display-folders} is
usually @code{'auto}, if @code{cmail-use-full-window} is @code{nil}, the
default will be modified to @code{nil}.

@vindex cmail-always-display-folders

When you wish to always expand folder names in certain directories, you
can list them in variable @code{cmail-folders-unfold-dirs} (it must be
terminated with '/'). The folders in the specified directories can be
accessed from the top directory.

@example
(setq cmail-folders-unfold-dirs '("DIR1/" "DIR1/DIR2/" "DIR3/"))
@end example
@vindex cmail-folders-unfold-dirs

Note that the directory name expanding (fold/unfold) can be toggled by
a command key (default is @kbd{x}).

If @code{cmail-use-visiting-parent-dir-as-quit} is set to @code{t}, and
the screen is other than TOP in the folders mode, executing
@code{cmail-folders-quit} will move you to the parent directory.

@vindex cmail-use-visiting-parent-dir-as-quit

If @code{cmail-folders-display-all-folders} is set to @code{nil}, in the
folders mode, it displays only the folders that contain unread messages.

@vindex cmail-folders-display-all-folders

If @code{cmail-folders-display-unread-mails} is set to @code{t}, then it
displays only the number of unread messages. This way you can use
@samp{cmail} with the news reader like look and feel.

@vindex cmail-folders-display-unread-mails

@node  Compressed folders, Using cmail as user mail agent, Folders mode, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Compressed folders
@cindex Compressed folders

@samp{cmail} supports folders compressed by a compress program like
compress or gzip, as if they are normal folders. When you want to use
compressed folders, include the following lines in @file{.emacs}.

@example
(require 'jka-compr)
(setq cmail-compressed-folders 'jka-compr)
@end example
@vindex cmail-compressed-folders

Note that if you use Mule-2.x (based on GNU Emacs 19.x), you need an
additional program, jam-code-guess.el (author @samp{Kazushi (Jam)
Marukawa}). Put this file in your emacs load path, and add the following
line to @file{.emacs}.

@example
(require 'jam-code-guess)
@end example

@node  Using cmail as user mail agent, , Compressed folders, Using cmail - advanced usage
@comment  node-name,  next,  previous,  up
@section Using cmail as user mail agent
@cindex Using cmail as user mail agent

With regard to @samp{user mail agent}, some explanation can be found in
@file{lisp/simple.el}. Consider when you use an Emacs lisp package that
sometimes requires you to write an email message.  In such case, the
lisp program would invoke another emacs package to have you compose the
mail message. The mail program is called the @samp{user mail agent}.

For example, try @kbd{M-x report-emacs-bug}. You should be transfered to
a mail editor mode. If you designate @samp{cmail} as your user mail
agent you would see the cmail mail mode buffer to compose a bug report
message.


@menu
* Usage::
* Special usage::
* User options::
@end menu

@node  Usage, Special usage, , Using cmail as user mail agent
@comment  node-name,  next,  previous,  up
@section Usage
@cindex Usage

@kbd{C-x m} is assigned for invocation of the user mail agent.

Type @kbd{C-x m} in any buffer. It display a prompt message "R)eply,
F)ollow or N)o?". Don't worry for now, just type RETURN key. Then a
buffer that looks familiar will appear.

When you want to compose a new message, you don't have to move to
summary mode buffer.


@node Special usage, User options, Usage, Using cmail as user mail agent
@comment  node-name,  next,  previous,  up
@section Special usage
@cindex Special usage

If a buffer that contains an Internet message, you can have Emacs to
cause a special behavior by using the user mail agent concept.

For example, consider a buffer that contains a data directly read from
mail spool file. At a message that you want to reply, type C-x m. This
time, you can type "r" at the prompt "R)eply, F)ollow or N)o?". Then
mail buffer will be invoked as if the reply command is used in cmail.

If "f" to the prompt is entered, recipient in CC field is also included.
If a corresponding capital letter is used, the original message will be
quoted.


@node  User options, , Special usage, Using cmail as user mail agent, Using cmail --- advanced usage
@comment  node-name,  next,  previous,  up
@section User options
@cindex User options

To use @samp{cmail} as the user mail agent, customize the following lisp
variables by using @file{.emacs}:

@example
(autoload 'cmail-mail-compose "cmail" nil t)
(setq mail-user-agent 'cmail-user-agent)
(define-mail-user-agent 'cmail-user-agent
  'cmail-mail-compose
  'cmail-send-and-exit
  'kill-buffer
  'cmail-mail-send-hook)
@end example

@node  Customizing cmail, Command list, Using cmail - advanced usage, Top
@comment  node-name,  next,  previous,  up
@chapter Customizing cmail

@samp{cmail} provides relatively flexible customization. Some variables
can be set to not only a simple lisp value but also a function.

@menu
* Customizing header layout::    
* Customizing thread layout::    
* Customizable variables::        
@end menu

@node Customizing header layout, Customizing thread layout, Customizing cmail, Customizing cmail
@comment  node-name,  next,  previous,  up
@section Customizing header layout
@cindex Customizing header layout

For the message header displayed in message buffer, unnecessary fields
can be omitted, or only necessary fields can be displayed.

Variable @code{cmail-ignored-headers} is set to a regular expression for
header fields to be excluded.

@vindex cmail-cmail-ignored-headers

For example in @file{.emacs}, if

@example
(setq cmail-ignored-headers "^Message-I[dD]:\\|^In-Reply-To:")
@end example

is specified Message-ID and In-Reply-To header fields will not be
displayed.

Variable @code{cmail-always-shown-headers} shall be set to a regular
expression for header fields to be displayed.
@vindex cmail-always-shown-headers

Default value is

@example
"^From \\|^X-cmail\\|^Received:\\|^Return-Path:\\|^Return-Receipt-To:\\|^Message-ID:\\|^Errors-To:\\|^References:\\|^Sender:\\|^Lines:\\|Status:\\|Replied:"
@end example

If header fields you want to display is
limited, disable all header fields display by variable
@code{cmail-ignored-headers} and set @code{cmail-always-shown-headers}
to only header fields you want to display.

The following shows an example variable setting to display only From:,
Subject, Date, X-Face fields.

@example
(setq cmail-ignored-headers "^[A-Z]")
(setq cmail-always-shown-headers "^From:\\|^Subject:\\|^Date:\\|^X-Face:")
@end example

@node Customizing thread layout, Customizable variables, Customizing header layout, Customizing cmail
@comment  node-name,  next,  previous,  up
@section Customizing thread layout
@cindex Customizing thread layout

To customize indent size which is used to show parent-child relationship
within a thread, use the following example in @file{.emacs}.

@example
(setq cmail-thread-indent 3)
@end example
@vindex cmail-thread-indent

With this example, indentation depth for threading is changed from
default 2 to new value 3.

@example
(setq cmail-thread-folder-regexp \"^.*ml$\\\\|^ml/.*$\")
@end example
@vindex cmail-thread-folder-regexp

This example shows how to specify folders in regular expression in which
threading is enabled. In this case, threading is enabled on
all folders with @samp{ml} at the end of its name and all folders in
directory @samp{m}. Default value is @code{nil} and in this case, thread
display is enabled on all folders.

@example
(setq cmail-thread-ignored-folder-regexp \"^INBOX$\\\\|^WORK$\")
@end example
@vindex cmail-thread-ignored-folder-regexp

This example shows how to specify folders in regular expression in which
threading is disabled, as compared with the previous example. In
this case, threading is disabled for all folders except for
@samp{INBOX} and @samp{WORK}. This variable has precedence to
@code{cmail-thread-folder-regexp}. If the above variable
@code{cmail-thread-folder-regexp} is set to @code{nil}, folders other
than matched with this variable are allowed for threading.

If you do not like to use this functionality, add the following line to
@file{.emacs}.

@example
(setq cmail-display-thread nil)
@end example
@vindex cmail-display-thread

@node  Customizable variables, , Customizing thread layout, Customizing cmail
@comment  node-name,  next,  previous,  up
@section Customizable variables

The following table lists most commonly used lisp variables to customize
@samp{cmail}. The file @file{cmail-vars.el} contains detail comments
about these variables, so please refer to this file when customizing
@samp{cmail}. For those variable with asterisk mark ([*]) especially,
more details can be found in @file{cmail-vars.el}.

@noindent
@format
 Variable name                Explanation                      Default
-----------------------------+--------------------------------+--------
 cmail-folder-alist           Automatic archiving rules        nil
 cmail-sort-header-alist      Sort method and folder           nil
 cmail-sort-header-default    Default sort method              nil
 cmail-default-headers        header field names used by       ...
                              cmail-mark-specified-mails
                              command for completion
 cmail-use-regexp-in-folder-alist                              nil
                              Specify whether or not regular
                              expression should be used to
                              match folder names specified in
                              cmail-folder-alist
 cmail-auto-expirable-folders List of folders to apply expiry  nil
 cmail-expiry-days-alist      Expiry days for each folder      nil
 cmail-default-expiry-days    Default expiry days              7
 cmail-archive-on-get         Do automatic archiving when      nil
                              getting new mail
 cmail-archive-on-quit        Do automatic archiving when      t
                              quitting cmail
 cmail-archive-on-visit       Do automatic archiving when      t
                              visiting a folder
 cmail-expunge-on-save        Expunge messages when saving     t
                              a folder
 cmail-path                   Specify root folders directory   "~/Mail/"
 cmail-compressed-folders     Whether or not remove .gz|.Z     nil [*]
                              from folder name completion list
 cmail-save-to                Directory where mail messages    same as
                              will be saved                    cmail-path
 cmail-work-dir               Directory where command is       same as
                              executed                         cmail-path
 cmail-ok-if-backup-exists    Verbose check when deleting      "DELETE"
                              a backup file
 cmail-query-delete           Verbose check when deleting      nil
                              marked messages
 cmail-query-save-folder      Verbose check when saving        nil
                              folder
 cmail-check-virtual-folder-on-clean
                              Verbose check when deleting      t
                              a non-empty virtual-folder
 cmail-inbox-folder           Name of the INBOX folder         "INBOX"
 cmail-query-limit-except-inbox-folder                         nil
                              Whether to perform the "large"
                              folder check over
                              cmail-inbox-folder.
 cmail-spool-directory        mail spool directory             "/usr/spool/mail/"
 cmail-mail-spools            List of spool file names         nil
                              and/or POP server info
 cmail-cursor-fast            Use less overhead cursor         t
                              movement
 cmail-large-folder           Reference number of messages     50
                              for "large" folders
 cmail-incoming-mails-folder  Temporary folder name            ".BACKUP"
 cmail-backup-version         Number of backup files           nil
 cmail-ignored-headers        List of the header fields        ---
                              to not display, in regular
                              expression format
 cmail-always-shown-headers   List of the header fields        nil
                              to display, in a regular
                              expression format
 cmail-use-folders-mode-first Whether to start from folders    nil
                              mode
 cmail-summarize-format       Format string for summary line   ...
 cmail-summarize-format-alist Format string list per folder    nil [*]
 cmail-display-thread         Whether to thread                t
 cmail-thread-indent          Number of spaces per level       2
                              used for thread summary line
                              indentation
 cmail-thread-folder-regexp   List of folders to thread,       nil [*]
                              in regular expression format
 cmail-thread-ignored-folder-regexp 
                              List of folders not to thread    nil [*]
                              in regular expression format
 cmail-thread-ignore-limit    Whether to check the size limit  t
                              before threading messages
 cmail-thread-prepare-data-on-archive                          nil
                              Create the thread internal data
                              cache when automatic archiving
                              is performed
 cmail-use-full-window        Use whole Emacs frame for cmail  t
 cmail-window-size            Size rate between summary and    (1 . 5)
                              mail windows
 cmail-window-horizontal-size Size rate between folders list   (1 . 3)
                              and summary windows.
 cmail-use-X-Nsubject         Whether to use X-Nsubject        t
 cmail-use-mime               Whether to use MIME add-on       nil
 cmail-use-mailcrypt          Whether to use PGP add-on        nil
 cmail-use-send-mail-archive  Whether to use send log function nil
 cmail-archive-folder         Folder name to store sent mail   "archive"
 cmail-default-from           Default address set to           nil
                              "from" field in message draft
 cmail-archive-from           Email address set to "from"      (user-login-name) 
                              field in send archive folder
 cmail-archive-on-visit       Do automatic archiving when      t
                              visiting a folder
 cmail-cmail-archive-on-quit  Do automatic archiving when      t
                              quitting cmail
 cmail-expunge-on-save        Expunge messages when saving     t
                              a folder
 cmail-mail-insert-x-mailer   Whether to add X-Mailer field    t
 cmail-reply-heading-format   Format of the header in reply    ...
 cmail-replyaddress-without-quoted-name                        t
                              Include only address in To:
                              field
 cmail-unify-multi-re         Whether to unify "Re"            t
 cmail-re-regexp              A regular expression for string  [*]
                              before adding "Re:"
 cmail-remove-re              Whether to remove "Re" on        nil
                              subject
 cmail-current-point-mark     Whether to display the pointer   t
                              "+" to the current message
                              being displayed
 cmail-mark-delete-show-next  Whether to display the next      nil
                              unread message after adding D
                              mark.
 cmail-addresses              Address database file for        "~/.addresses"
                              address completion.
 cmail-complete-header-regexp Header fields for address        [*]
                              completion
 cmail-dont-cc-addresses      Addresses not to add to CC list  nil
                              when forwarding a message
 cmail-mail-query-cc          Query CC before entering the     nil
                              cmail mail mode buffer
 cmail-use-X-Nsubject         Use X-Nsubject as subject        t
 cmail-forwarded-mail-border-cons 
                              Boarder line string inserted     [*]
                              when forwarding message
 cmail-rfc934-forwarding      Use escape character over        t
                              forwarding message as specified
                              in RFC-934.
 cmail-mime-forwarding        Use non-mime forwarding even if  t
                              MIME is turned on
 cmail-make-References-header Whether to use References field  t
 cmail-print-proc             Function to be executed by       [*]
                              the cmail print command
 cmail-print-command          External command name used by    [*]
                              cmail print command
 cmail-use-folders-mode-first Whether to start from folders    nil
                              mode
 cmail-use-visiting-parent-dir-as-quit                         nil
                              In folders mode, when
                              cmail-folders-quit is executed
                              in a directory other than TOP,
                              move to upper directory.
 cmail-cmail-highlight-mode   When non-nil, use highlight      window-system
                              function
 cmail-highlight-mouse        Type face attribute used when    nil
                              the mouse pointer moves over
                              a summary line (in the summary
                              mode) and/or folder name (in
                              the folders mode)
 cmail-cite-regexp            Regular expression to identify   [*]
                              quoted text lines for highlight
                              purpose
 cmail-highlight-attribute-alist                               [*]
                              Type face attributes for the
                              highlight function.
 cmail-mail-callback          Add reply mark (R) to summary    t
                              when command is entered (nil),
                              or when the reply is actually
                              sent (t).
 cmail-always-display-folders Whether always display folders   [*]
                              list
 cmail-always-display-folders-threshold                        100
                              Threshold window width to
                              always display folders list
 cmail-use-folders-mode-first Whether to start from folders    [*]
                              mode
 cmail-folders-unfold-dirs    List of directories to expand    nil [*]
                              the name in folders list
 cmail-folders-list-top       List of folders placed from the  "INBOX"
                              top in the folders list
 cmail-folders-list-bottom    List of folders placed from the  nil
                              bottom in the folders list
 cmail-folders-display-unread-mails                            nil
                              Whether to display the number of
                              unread messages in each folder
                              in the folders list
 cmail-folders-display-all-folders                             t
                              Whether to display folders not
                              containing any unread messages
 cmail-delete-file-after-conversion                            nil
                              Whether to delete mbox/RMAIL
                              file after format conversion
 cmail-i18n-message           Automatically display Japanese   t
                              informational messages and
                              prompts when configured for
                              Japanese environment. This works
                              only for certain versions of
                              Emacs.
 cmail-sum-pop-up-menu-1      Pop-up menu for message commands [*]
 cmail-sum-pop-up-menu-2      Pop-up menu for folder commands  [*]
 cmail-option-path-list       Directory names to place options [*]
                              files
 cmail-auth-file              File name to save passwords      "~/.cmail-auth"
 cmail-use-auth-file          Whether to save password         nil
-----------------------------+--------------------------------+--------
@end format

Use Emacs Help for more detail.

@node  Command list, Bug report, Customizing cmail, Top
@comment  node-name,  next,  previous,  up
@chapter Command list
@cindex Command list

@menu
* Commands in summary mode::        
* Commands in folders mode::  
@end menu

@node  Commands in summary mode, Commands in folders mode, Command list, Command list
@comment  node-name,  next,  previous,  up
@section Commands in summary mode
@cindex Commands in summary mode

@samp{cmail}'s message handling is mostly done in the summary
mode. After @samp{cmail} is started, cursor should be located in the
summary mode buffer.

The following table lists default key assignments in the summary mode.

@noindent
@format
Keybind  Function Description            Lisp function name
--------+-------------------------------+-------------------------------
 RET     Scroll up the readmail mode     cmail-read-each-line
         screen by one line
 C-n     Move cursor to next line in     cmail-down-imme
         the summary mode buffer
 C-o     Save mail in the mbox format    cmail-save-mail-as-mbox
 C-p     Move cursor to previous line    cmail-up-imme
         in the summary mode buffer
 C-t     Toggle threading on and off     cmail-toggle-thread
 SPC     Display mail contents or scroll cmail-read-contents
         up the readmail mode screen by
         one page.
 %       Move index                      cmail-move-index
 .       Display mail contents           cmail-show-contents
 <       Display the first message in    cmail-beginning-of-mail
         the summary mode
 =       Enlarge the summary window to   (lambda function)
         entire frame
 >       Display the last message in     cmail-end-of-mail
         the summary mode
 ?       Describe summary mode           describe-mode
 *       Extract digest messages         cmail-burst-digest
 @@       Send digest message             cmail-send-digest
 /       Mark messages that meet a       cmail-mark-specified-mails
         condition specified by the
         user.
 A       Automatic archiving             cmail-auto-archive
 B       Re-send a bounced message       cmail-resend-bounced-mail
 C       List marked messages for        cmail-confirm-mark
         confirmation
 E       Edit a mail message             cmail-edit
 F       Reply to the sender and all     cmail-followup-include-text
         CC list members of the current
         message. Quote original message
         text.
 H       Add hold mark ("H")             cmail-mark-hold
 L       Display summary without limit
 N       Display next unread message     cmail-next-unread-mail
 P       Display previous unread message cmail-previous-unread-mail
 Q       Close folder                    cmail-close-folder
 R       Reply to the sender of the      cmail-reply-include-text
         current message. Quote original
         message text.
 S       Save folder                     cmail-save-folder
 U       Mark message as unread ("U")    cmail-mark-unread
 V       Visit the folder where the      cmail-visit-saving-folder
         current message will be saved
         upon automatic archiving.
 W       Display name and email address  cmail-name-and-address
         of the sender
 X       List summary lines with         cmail-confirm-execute
         deletion mark for confirmation
 ^       Mark the current message        cmail-mark-mail
 a       Write a message to the sender   cmail-mail-this-line
         of the current message
 b       Scroll down the readmail mode   cmail-read-reverse
         screen
 c       Mark all unread messages as     cmail-catch-up-all
         read
 d       Add deletion mark ("D")         cmail-mark-delete
 e       Edit summary index line         cmail-edit-index
 f       Reply to the sender and all     cmail-followup
         CC list members of the current
         message.
 g       Get new messages                cmail-get-newmail
 h       Describe mode                   describe-mode
 i       Move index                      cmail-move-index
 j       Scroll up the readmail mode     cmail-read-each-line
         screen by one line.
 k       Scroll down the readmail mode   cmail-read-each-line-backward
         screen by one line.
 l       Refresh summary display         cmail-make-summary
 m       Write a new mail message        cmail-mail
 n       Display next message            cmail-next-mail
 o       Save message                    cmail-save-mail
 p       Display previous message        cmail-previous-mail
 q       Quit cmail                      cmail-quit
 r       Reply to sender of the current  cmail-reply
         message
 s       Display a folder where the      cmail-saving-folder
         current message would be saved
         upon automatic archiving
 t       Toggle message header display   cmail-toggle-header
         layout in the readmail mode
         screen.
 u       Remove mark in summary          cmail-unmark
 v       Visit another folder            cmail-visit-folder
 w       Save folder                     cmail-save-folder
 x       Expunge messages                cmail-execute-index
 z       Forward current message         cmail-forward
 |       Pass the current message to     cmail-pipe
         external process
 DEL     Scroll down the readmail mode
         screen by one page.
 C-cf    Enter folders mode              cmail-folders
 C-ca    Add address to .addresses       cmail-add-new-address-from-mail
 C-c^    Add general mark ("^") to       cmail-mark-thread
         a thread
 C-cd    Add deletion mark ("D") to      cmail-th-mark-delete
         a thread
 C-cC-sn Sort summary by number          cmail-sort-by-number
 C-cC-ss Sort summary by subject         cmail-sort-by-subject
 C-cC-sd Sort summary by date            cmail-sort-by-date
 C-cC-sC-d
         Sort summary by date & time     cmail-sort-by-time
 C-cC-sa Sort summary by sender          cmail-sort-by-author
 C-cC-sb Sort summary by byte size       cmail-sort-by-bytes
 C-cC-v  Display cmail version           cmail-version
 C-cC-x  Add deletion mark to expired    cmail-expire-mark
         mail
 
 M-p     Print mail being displayed      cmail-print
 M-s     Sort index (for egg)            cmail-sort-index
 M-o     Reorder mail per summary order  cmail-reorder-folder
 M-n     Rename folder                   cmail-rename-folder
 M-k     Delete folder                   cmail-kill-folder
 M-y     Copy a folder                   cmail-copy-folder
 M-d     Clean up a folder               cmail-diet-folder
 M-r     Remake folder headings          cmail-remake-folder-headings
 M-f     Visit another folder            cmail-visit-folder
 M-l     Set limit size of summary       cmail-set-summary-limit
 M-c     Copy mail to a folder           cmail-copy-to-folder
 M-m     Move mail to a folder           cmail-move-to-folder
 M-^     Add general mark to all mail    cmail-mark-all
 M-u     Mark mail as read               cmail-mark-active
 M-a     Automatic archiving over all    cmail-auto-archive-all
         messages including unread
         messages

 M-tc    Output with mbox format         cmail-c2m
 M-tm    Convert from mbox format        cmail-m2c
 M-tr    Convert from RMAIL format       cmail-r2c
--------+-------------------------------+-------------------------------
@end format

@node  Commands in folders mode,  , Commands in summary mode, Command list
@comment  node-name,  next,  previous,  up
@section Commands in folders mode
@cindex Commands in folders mode

By typing @kbd{C-cf} in summary mode, it enters into the folders mode.
The following is a table of key assignment in the folders mode.

@noindent
@format
Keybind  Function Description            Lisp function name
--------+-------------------------------+-------------------------------
 p       Move cursor to previous line    cmail-folders-previous-line
 n       Move cursor to next line        cmail-folders-next-line
 k       Move cursor to previous line    cmail-folders-previous-line
 j       Move cursor to next line        cmail-folders-next-line
 P       Move cursor to the last folder  cmail-folders-previous-unread-folder
         containing unread messages
 N       Move cursor to the next folder  cmail-folders-next-unread-folder
         containing unread messages
 SPC     Visit the folder or directory   cmail-folders-visit-folder
         on the line at the cursor
 C-m     Visit the folder or directory   cmail-folders-visit-folder
         on the line at the cursor
 u       Go to the upper directory       cmail-folders-visit-parent-dir
 d       Go to the root folder directory cmail-folders-visit-top-dir
 x       Fold the folder name if the     cmail-folders-toggle-unfold
         the name at the cursor is an
         expanded directory. Otherwise
         unfold it.
 v       Visit a folder with prompt      cmail-folders-visit-folder-directly
 m       Write a mail message draft      cmail-mail
 g       Get a new mail message          cmail-folders-get-newmail
 q       Go back to summary mode (*1)    cmail-folders-quit
         Or exit cmail (*2)
         Go back to upper directory
         if exited in a subdirectory
         folder listing (*3)
 Q       Close all folders except for    cmail-folders-close-all-folders
         INBOX
 M-w     Save all folders and rescan     cmail-folders-update
         the folder directories.
         If C-u is prefixed, discard
         folder info on the memory
         before performing rescan.
 M-y     Copy the folder at the cursor   cmail-folders-copy-folder
 M-c     Copy the folder at the cursor   cmail-folders-copy-folder
 C       Copy the folder at the cursor   cmail-folders-copy-folder
 M-n     Rename the folder at the cursor cmail-folders-rename-folder
 R       Rename the folder at the cursor cmail-folders-rename-folder
 M-k     Delete the folder at the cursor cmail-folders-kill-folder
 D       Delete the folder at the cursor cmail-folders-kill-folder
 h       Display key binding             describe-mode
 ?       Display key binding             describe-mode
--------+-------------------------------+-------------------------------
*1: When @code{cmail-use-folders-mode-first} is @code{nil}
*2: When @code{cmail-use-folders-mode-first} is @code{t}
*3: When @code{cmail-use-visiting-parent-dir-as-quit} is @code{t}
@end format

@node  Bug report, Acknowledgments, Command list, Top
@comment  node-name,  next,  previous,  up
@chapter Bug report

If you have questions like how to accomplish something you want in
@samp{cmail}, you may want to try the FAQ document that comes with the
cmail package. There might be an answer to your question.

There is also a @samp{cmail} home page.

@display
@code{http://cmail.sourceforge.jp/}
@end display

If still your question is not answered, or if you find a bug when
actually using @samp{cmail}, or if you have suggestions like "how about
implementing this", "you shouldn't do this" and so on, why don't you
join the mailing list for @samp{cmail} users.  If you wish to do so
please write a message to:

@display
cmail-request@@ne.nal.go.jp
@end display
@cindex Mailing List

Please include the following information in the message:

@display
 - Name
 - Job
 - Email address where mailing list message is forwarded
(other info, such as introducing yourself.)
@end display

At the present time, support is mostly done through this @samp{cmail}
mailing list. As announcements like new version release are sent out
there, I'd recommend to join.

Also, here shows the present @samp{cmail} maintainer's email address.

@cindex Maintainer
@display
matz@@ruby-lang.org
@end display

@node  Acknowledgments, Concept Index, Bug report, Top
@comment  node-name,  next,  previous,  up
@chapter Acknowledgment


Without the following people's help, the present version of @samp{cmail}
would not exist. Here I'd like to acknowledge them.

First of all, many thanks to Makoto Hayashi, who originally developed
@samp{chain-mail}. I'd like to thank all members of cmail mailing list,
who actively have made proposals, requirements, and contributed for
continuous @samp{cmail} improvement. Thanks, everyone.

@node     Concept Index, Function Index, Acknowledgments, Top
@comment      node-name, next,        previous,  up
@unnumbered Concept Index

@printindex cp

@node     Function Index, Variables Index, Concept Index, Top
@comment      node-name, next,        previous,  up
@unnumbered Function Index

@printindex fn

@node Variables Index,  , Function Index, Top
@comment    node-name,          next,       previous,  up
@unnumbered Variable Index

@printindex vr

@summarycontents
@contents
@bye

Local variables:
fill-column: 72
end:
