Mew 6.8 Manual
**************

                                                         Kazu YAMAMOTO
                                                    Created 1996/02/18
                                                   Modified 2018/06/07

This manual documents Mew version 6.8. In addition to this manual, you
may find useful information about Mew from Mew's official home page
(http://www.Mew.org/).

Read me first
*************

Mew is a user interface for text messages, multimedia messages (MIME),
news articles and security functionality including PGP, S/MIME, SSH,
and SSL. Also, Mew can work with the recent search services.

Mew is an acronym for "Messaging in the Emacs World". You should spell
it with the first letter capitalized and pronounce it as it is
(i.e. the meow of cats). When the author started programming it, he
chose a cute word from his English dictionary. Thus, Mew.

Mew's features
==============

The features of Mew 6.8 are as follows:

   - You can easily display a very complicated structured
     message. What you should do to view messages is just type `SPC'.
   - If you know how to do file operations such as copy, you can
     compose a very complicated message without any difficulty.
   - You can start to read messages before they are all fully listed.
   - Since Mew preserves lists of messages in Summary mode, when you
     move messages to a new folder, they will automatically be listed
     incrementally.
   - Mew neatly suggests default folders for refiling. Those who
     receive many messages cannot live without this feature.
   - In Draft mode, you can complete field names, e-mail addresses,
     receiver's names, domain names, and folder names.
   - You can easily search messages with keywords etc.
   - Mew automatically decodes messages encrypted with PGP or
     S/MIME. It also automatically verifies signed messages.
   - You can easily encrypt or sign a message with PGP or S/MIME.
   - It takes a bit of time to analyze MIME syntax or to verify a PGP
     or S/MIME signature. While the user is reading a message, Mew
     processes the next message so that the next message can be
     displayed faster. Analyzed messages are cached briefly.
   - You can view multiple folders simultaneously.
   - Selection/Thread, a mechanism to display the flow of messages, is
     supported. You can make Selection from messages matched to a
     keyword and make Thread from the Selection.
   - When you input a folder name, you can search it with a substring
     of the name.

Supported Emacs versions
========================

Please use Emacs 24.3 or later. Mew doesn't support earlier versions
nor XEmacs.

Modes
=====

Mew has the following seven modes:

`Summary mode'
     A mode to list and select messages.
`Virtual mode'
     A mode to list messages selected with a specific condition from
     one or more folders. This is similar to Summary mode. This mode
     is categorized to Selection or Thread.
`Message mode'
     A mode to display the content of a message.
`Draft mode'
     A mode to prepare a message to be sent, answered, and forwarded.
`Header mode'
     A mode to edit the header of a message and to send it.
`Edit mode'
     A mode to edit a message to generate another new message.
`Addrbook mode'
     A mode to register an entry to the address book (Addrbook).

Folder convention
=================

With Mew's terminology, a place where messages are deliver is called
'mailbox'. There are three kinds of mailbox: local, POP server, IMAP
server, and NNTP server.

A box which contains messages used by Mew is called "folder". The name
of a folder is in the format that "proto" is followed by a string,
where "proto" is one sign letter. For example, the proto of "+inbox"
is "+".

Mew's folders are categorized to two types: "local folder" and "remote
folder".

A local folder is a folder which is *original* and is created the
computer on which Mew is running. Also, messages stored in the folder
are *original*. (So, if you remove them, you cannot revive them.)

The proto of a local folder is "+". We summarize special local folders
as follows:

`+inbox'
     The first local folder to store messages which you fetch from
     your local mailbox or your POP server. To refile messages, what
     you do is to move the messages from "+inbox" to other folders.
`+draft'
     A local folder where messages, which you have not completed yet,
     are stored.
`+queue'
     A local folder where e-mail messages to be sent are stored. The
     messages in "+queue" will be eventually sent by SMTP.
`+postq'
     A local folder where NetNews message to be sent are stored. The
     messages in "+postq" will be eventually sent by NNTP.

A remote folder is a COPY whose original is on a server side. A
message in a remote folder is a cache which is copied from the server.

Here are a list of available proto of remote folders:

`%'
     Folders on an IMAP servers. Example: "%inbox"
`$'
     The folder on a POP server. Example: "$inbox" (Since there is
     only one folder in a POP server, "$inbox" is the only folder
     whose name starts with "$".)
`-'
     Newsgroups of NetNews. Example: "-fj.mail.reader.mew"

If you use several servers, there are multiple sets of remote folders.
You can specify several servers by using "case". For more information
about the "case", see config. To specify a remote folder
corresponding to a "case", you should write "case:folder". You can
omit "case:" if a case is "default".

A combination of "case" and proto organized a world to which a message
belongs. A message can move within its world. To make it easy to
search received messages afterward, they should be moved to proper
folders. To know how to refile received messages, see Refile.

You cannot move a message in the "$" world because there is only one
folder, "$inbox". You cannot move a message in the "-" world either
since messages in the "-" world are not yours.

If you want to move a message from one world to another, you should
COPY it. Its destination is restricted to a local folder. This method
is described in retrieving.

If you make a list of folders, you can use the completion
functionality for folders. To know how to make a list of folders,
please refer to status-update.

Configuration
=============

To execute Mew, the followings are necessary either in the site
configuration file or in your "~/.emacs".

     (autoload 'mew "mew" nil t)
     (autoload 'mew-send "mew" nil t)

     ;; Optional setup (Read Mail menu):
     (setq read-mail-command 'mew)

     ;; Optional setup (e.g. C-xm for sending a message):
     (autoload 'mew-user-agent-compose "mew" nil t)
     (if (boundp 'mail-user-agent)
         (setq mail-user-agent 'mew-user-agent))
     (if (fboundp 'define-mail-user-agent)
         (define-mail-user-agent
           'mew-user-agent
           'mew-user-agent-compose
           'mew-draft-send-message
           'mew-draft-kill
           'mew-send-hook))

If you are using Emacs with the --unibyte option or the EMACS_UNIBYTE
environment variable for Latin-1, put the following into your
"~/.emacs".

     (set-language-environment "Latin-1")
     (set-input-method "latin-1-prefix") ;; or "latin-1-postfix"

If you use the following configuration for Latin-1, please remove it.
This is an obsolete handling of Latin-1 that can cause Mew to function
incorrectly.

     (standard-display-european 1)

When booting, Mew reads the file "~/.mew.el". All Mew configurations
should be written in this file.

To configure your e-mail address, the followings are necessary.

     ;; (setq mew-name "your name") ;; (user-full-name)
     ;; (setq mew-user "user name of e-mail address") ;; (user-login-name)
     (setq mew-mail-domain "domain of e-mail address")

To send e-mail messages by SMTP, the following is necessary.

     (setq mew-smtp-server "your SMTP server")  ;; if not localhost

If you want to use POP to receive e-mail messages, the followings are
necessary.

     ;; (setq mew-pop-user "your POP account")  ;; (user-login-name)
     (setq mew-pop-server "your POP server")    ;; if not localhost

If you want to use a local mailbox to receive e-mail messages, the
followings are necessary.

     ;; To use local mailbox "mbox" or "maildir" instead of POP
     (setq mew-mailbox-type 'mbox)
     (setq mew-mbox-command "incm")
     (setq mew-mbox-command-arg "-u -d /path/to/mbox")
     ;; If /path/to/mbox is a file, it means "mbox".
     ;; If /path/to/mbox is a directory, it means "maildir".

If you want to use IMAP to receive e-mail messages, the followings are
necessary.

     (setq mew-proto "%")
     ;; (setq mew-imap-user "your IMAP account")  ;; (user-login-name)
     (setq mew-imap-server "your IMAP server")    ;; if not localhost

To read and/or write articles of NetNews, the followings are
necessary.

     ;; (setq mew-nntp-user "your NNTP account")
     (setq mew-nntp-server "your NNTP server")

Password
========

When fetching/sending messages or using PGP or S/MIME, you may be
required to input your password. Before you type your password, check
carefully to see if either the following conditions is satisfied:

   - Emacs is running on a local computer
   - Emacs is running on a remote computer, but an encryption
     mechanism is being used for communication.

If neither of these conditions are satisfied, do not input a
password. Your password could be accessed without your knowledge.

If you get sick of inputting your password from time to time, please
use one of two password-cache mechanisms.

  1. Storing passwords in memory temporarily. Not writing them to a
     file.
  2. Storing passwords in memory while Mew is running. When Mew/Emacs
     quits, Mew encrypts the passwords and writes them to a file.

To use Feature 1., configure as follows:

     (setq mew-use-cached-passwd t)

To use Feature 2., install GnuPG first. GnuPG version 1.x and 2.1.23
or later are supported for this feature. If you use GnuPG 2.1.23 or
later, put the following to "~/.gnupg/gpg.conf":

     no-auto-key-retrieve
     auto-key-locate local

Then, configure as follows:

     (setq mew-use-master-passwd t)

If both variables are `t', the feature 2. is used.

Feature 1.: Any passwords including POP and PGP are cached in
memory. While a password is cached, you can omit to input the
password. The cached password will expire after a certain period (20
minutes by default). However, its timer is cleared (reset to 20
minutes) if the password is used internally.

Feature 2: When Mew boots, Mew asks you to input a master password.
Mew decrypts encrypted passwords in a file and caches them in memory.
For instance, if you have already typed POP password, it is to be
stored in memory. Thus, when the POP password is required, you can
omit to input it. If you use a master password at the first time, you
are asked to input it twice. When Mew boots, you might type a wrong
master password. In this case, if you enabled Feature 1., it is
used. Otherwise, no password-cache mechanisms is used.

If you want to change the master password, type `C-cC-m' in Summary
mode.

Cached passwords in memory are not encrypted. So, if you use either
Feature 1. or Feature 2., you should take care so that nobody can
touch your Emacs. If you leave your PC and an Emacs expert happens to
check your configuration, your passwords could be stolen.

Starting
========

To start Mew, you can choose one of the following:

`M-x mew'
     Execute Mew first unless Mew is running. And retrieve arrived
     messages or just visit to the default folder.

     `proto' is determined by `mew-proto' and the "case" (see
     config).

     If `proto' is `+' (i.e. a local folder), a mailbox is determined
     according to `mew-mailbox-type' (see retrieving).
     Otherwise (i.e. a remote folder), an appropriate protocol to
     retrieve messages is chosen according to `proto'.

     If `mew-auto-get' is `t', arrived messages are asynchronously
     fetched and listed up in Summary mode.

     `mew-auto-get' is `nil', just visit to the folder determined by
     `proto'.
`C-uM-x mew'
     Perform `M-x mew' with `mew-auto-get' reversed.
`M-x mew-send'
     Enter Draft mode for message composing.
`C-xm'
     Enter Draft mode for message composing if `mail-user-agent' is
     configured.

When Mew is executed on Emacs, two cute cats appear on the cover page.

For the methods of quitting Mew, please refer to Quit.

Viewing messages
****************

If you input `M-x mew' (regardless Mew is running or not), Mew
displays a list of message like this:

     * 03/12 Hidenori Ohta  This weekend              |Let's go to StoneMagic
      M03/14 Momo-chan      The pictures of Noto      |Attached are the pictu
       03/15 Neat Sumikawa  Re: wine                  |OK. I vote for Wednesd

This is called Summary mode. This section mainly explains how to read
messages in Summary mode.

As you can see the example above, the format of Summary mode consists
of a mark, data type (a mark by Mew), date, a sender, Subject:, and a
body.

For the method of terminating Summary mode, please see Quit.

Reading Basis
=============

To read messages in the order of their arrival, type `SPC' to display
them. That's it. It's easy, isn't it?

Yet this might not be comprehensive, so the basic commands for page
processing are listed as follows:

`SPC'
     Read through messages. That is, display a message, scroll it, and
     move-then-display another message. refer to summary-mode
     to know which direction the cursor moves.
`C-uSPC'
     Redisplay the message from its header.
`DEL'
     Back-scroll this message. Unnecessary header fields are hidden
     over the window. Type `DEL' to see them when a message is
     displayed.
`RET'
     Make this message scroll up one line.
`M-RET'
`-'
     Make this message scroll down one line.

`C-n'
     Go to the next line.
`C-p'
     Go to the previous line.
`n'
     Move down then display. Targets include parts, messages marked with
     `*', and non-marked messages.
`C-un'
     Move down then display. Targets include messages marked with `*',
     and non-marked messages.
`p'
     Move up then display. Targets include parts, messages marked with
     `*', and non-marked messages.
`C-up'
     Move up then display. Targets include messages marked with `*',
     and non-marked messages.
`j'
     Jump to a line according to the line number which you input.
`C-uj'
     Jump to a message according to the message number which you
     input.

Displaying MIME
===============

It's not difficult to read a multipart message. As usual, just type
`SPC'.

A multipart message is marked with `M' on the left side of date as
follows:

     * 03/12 Hidenori Ohta  This weekend              |Let's go to StoneMagic
      M03/14 Momo-chan      The pictures of Noto      |Attached are the pictu
       03/15 Neat Sumikawa  Re: wine                  |OK. I vote for Wednesd

When you type `SPC' on the message marked with `M', its header is
displayed in Message mode. Then its multipart structure is displayed
in Summary mode as follows:

     * 03/12 Hidenori Ohta  This weekend              |Let's go to StoneMagic
      M03/14 Momo-chan      The pictures of Noto      |Attached are the pictu
     B    2  Image/Jpeg                   picture 1                noto1.jpg
     Q    3  Application/Postscript       Note map                 map.ps
       03/15 Neat Sumikawa  Re: wine                  |OK. I vote for Wednesd

If the first part is Text/, the first part is not displayed in Summary
mode but the first part is displayed with its header in Message mode.

Each line of multipart consists of

   - marks (Content-Transfer-Encoding:)
   - part number
   - data type (Content-Type:)
   - description (Content-Description:)
   - file name (Content-Disposition:).

Content-Description can be considered Subject: for each part. This
format is very similar to that of the attachment region in Draft mode.

If you type `SPC' or `n', the cursor moves onto part 2 and the content
is displayed according to its data type. For instance, Text/Plain is
showed in Message mode and PostScript is visualized with "ghostview".

Please note that `n' and `p' move lines including multipart.
To display the message below skipping multipart, type `C-un'.
Likewise, to display the message above (not this message), input
`C-up'.

Mew processes MIME recursively. The following example is a forwarded
multipart message.

      M03/15 Kazu yamamoto  Fw: The pictures of Noto  |Attached are the pictu
          2  Message/Rfc822               The pictures of Noto
     B    2.2  Image/Jpeg                   picture 1              noto1.jpg
     Q    2.3  Application/Postscript       Note map               map.ps

Note: We strongly recommend that you not embed any object other than
text as a top level single part to a message directly. Instead, it is
better to make a multipart message whose part 1 is a textual
description of part 2 and part 2 is a non-text object.

A message which contains a single part other than text is displayed as
multipart.

Since the syntax of MIME messages can be complex, it sometime takes a
bit of time to analyze the syntax. However, Mew guesses the message to
be read next and analyzes it beforehand while the user is reading the
current message. Analyzed messages are temporarily cached.

To make it clear where the message ends, Mew displays the string "[End
of message]" in the end of the message. At the end of each part, Mew
displays the string "[Message is continued]". These strings are
customized by `mew-end-of-message-string' and
`mew-end-of-part-string', respectively.

Controlling MIME analysis
=========================

There are several variables for controlling message analysis.

`mew-file-max-size'
     The size limit of messages to be analyzed. If the size of a
     message is less than or equal to this value, it is analyzed and
     displayed.  Otherwise, the raw message is displayed without
     analysis. The default value is 10000 bytes.
`mew-header-max-length'
     The length limit of header to be analyzed. If the length of a
     header is less than or equal to this value, it is analyzed and
     displayed.  Otherwise, the message is displayed as fragmentarily
     since the analysis is stopped. The default value is 100 lines.
`mew-decode-broken'
     Whether Mew be liberal or conservative to invalid messages. If the value
     is `t', the setting is liberal. If the value is `nil', the
     setting is for conservative. If conservative and invalid portions are
     found, they are reported in the X-Mew: field. The default value is
     `t'.
`mew-use-text-body'
     Whether or not the text part of a body is displayed with its
     header. If the value is `t', both the body which is a single part
     text and the first text part in a multipart body are displayed
     with its header. If the value is `nil', they are displayed as a
     single part in a multipart. The default value is `t'.
`mew-use-alternative'
     How to treat Multipart/Alternative. Messages containing
     Multipart/Alternative are marked with `-'. If the value is
     `t', one part is displayed according to the preference defined in
     `mew-mime-multipart-alternative-list'. If the value is
     `nil', it is displayed as a multipart. The default value is
     `t'.
`mew-use-text/html'
     How to treat Text/Html. If `nil', HTML is displayed as is
     (without parsing). Otherwise, HTML is parsed and displayed. The
     default value is `nil'.
`mew-use-text/xml'
     How to treat Text/Xml. If `nil', XML is displayed as is (without
     parsing). Otherwise, XML is parsed and displayed. The default
     value is `t'.

The basic command relating to the variables above is `.'. The command
acts as follows:

1) If this command executed on a message, the cache of the message is
removed and the message is analyzed then displayed.

1a) If the size of the current message exceeds `mew-file-max-size',
MIME analysis is skipped then the beginning of the raw message is
displayed. In this situation, this command analyzes the current
message without the limitation then displays it.

1b) If the length of a header exceeds `mew-header-max-length', a
broken message is displayed. In this situation, this command analyzes
the current message without the limitation then displays it.

1c) If the current message is displayed by `:', the multipart
structure is displayed different from the normal display. In this
situation, this command gets the multipart structure back to the
normal display.

1d) If `mew-use-text/html' is `nil', its HTML body is displayed as
is. In this situation, this command analyzes the HTML body and
displays it.

2) If this command is called on a part, the part is displayed again.

2a) If 'mew-use-text/html' is `nil', its HTML part is displayed as
is. In this situation, this command analyzes the HTML part and
displays it.

In addition to `.', the following commands are prepared:

`.'
     Analyze the message and re-display it.
`C-u.'
     Analyze the message with `mew-decode-broken' reversed (see
     invalid).
`:'
     The same as `.' with `mew-use-alternative' and
     `mew-use-text-body' reversed.
`C-u:'
     The same as `C-u.' with `mew-use-alternative' and
     `mew-use-text-body' reversed.
`,'
     Insert a message or a part into Message mode in raw format.
`C-cTAB'
     Open an entire message as a file in read-only mode.
`C-uC-cTAB'
     Open an entire message as a file.

Visualizing cipher or signature
===============================

Basic commands such as `SPC' visualize messages signed or encrypted as
well. Let's start with a simple example:

      S03/18 Kanda PC shop  A written estimate        |Here is a written esti
      E03/21 Anonymous      Secret message            |

Messages above are marked with `S' and `E', respectively. This means
that the body of the first message is signed and that of the second
message is encrypted.

PGP/MIME and/or S/MIME also allow to sign and/or encrypt some parts of
a message. In this case, these marks do not appear. The `S' or `E'
mark appears only when the entire body of the message is signed or
encrypted.

The terms "sign" and "encrypt" used above mean the last procedure
applied the body is "sign" and "encryption", respectively. The above
examples may have been produced with more complex processes.  For
instance, in the case of the former message, the body may have been
signed after encrypting the body.  It is likely that some part of the
latter message was first signed then the body was encrypted.

If some parts or the entire body is encrypted, Mew asks you to input
your pass-phrase to get plain text. Please refer to start to
know what you should pay attention when inputting pass-phrase. The
pass-phrase is used to decrypt your secret key. The secret key is then
used to decrypt cipher text.

To visualize a cipher message, you need to input your pass-phrase
every time you encounter cipher text. This is because Mew does not
cache pass-phrases anywhere for security reasons. If you feel this is
inconvenient, you can configure Mew to cache your pass-phrase. Please
refer to password for more information.

Since decrypted messages are cached for a while, you may not be asked
for your pass-phrase at the next time you display the message, even if
you are not using the pass-phrase cache.

To verify signatures, senders' public keys are used. Hence you are not
asked to type your pass-phrase.

Since Mew automatically verifies signatures and/or decrypts cipher
text with a pass-phrase, it is likely that users do not notice that
the original message has signatures and/or which parts were encrypted.

To inform users the results of verification of signatures or which
parts were decrypted, Mew inserts the X-Mew: field in the header as
follows:

     X-Mew: <body> PGP decrypted.
            Good PGP sign "kazu@example.org" COMPLETE

The number enclosed by "<>" indicates which part was protected with
PGP. "body" means the body was protected. This example tells us that
the body was singed by kazu then encrypted for the reader. Mew first
decrypted the message and then verified its signature of the decrypted
message. The fact that the signature is valid indicates that no one
has modified the content of the message since it was signed by the
secret key whose ID is kazu@example.org. The validity of the public
key used to verify the signature is "complete". Thus, the receiver can
be sure that the public key actually belongs to the user indicated by
the ID. That is, this message was verified by a reliable public key
AND its results were correct, so no alternation was found.

In the following example, the signature of the body (multipart), is
first verified, then part 2 (a message), is decrypted. That is, the
composing process was that part 2 is first encrypted then the entire
body is signed.

     X-Mew: <body multi> Good PGP sign "kazu@example.org" COMPLETE
     X-Mew: <2 message> PGP decrypted.

Intelligent users may wonder what happens in the case where a devious
person sends a message that contains an invalid X-Mew: field. This is
not a problem. First Mew carefully removes the X-Mew: field, and then
inserts a valid X-Mew: field into the header.

About PGP/MIME:

X-Mew: informs the user of various other types of results. For
example, the lack of availability of a public key, decryption
failures, etc. The following example indicates the absence of a public
key whose key ID is 0x1B8BF431.

     X-Mew: <body multi> No his/her public key. ID = 0x1B8BF431

In this case, if you type `C-cC-f', Mew tries fetching this public
key. You can interactively select a public key server. If the X-Mew:
field does not exist, `C-c C-f' takes the From: field as ID. Also,
`C-uC-cC-f' extracts key IDs from fields specified in
`mew-x-pgp-key-list' in addition to the X-Mew: field, and then tries
to fetch them.

Mew supports PGPv2, PGPv5, and GNUPG. You can select one of these by
typing `C-cC-v' in Summary mode. If you want to use those PGPs, you
should set the command name of PGPv2, PGPv5, and GNUPG to
`mew-prog-pgp2', `mew-prog-pgp5', and `mew-prog-gpg',
respectively. Also, set the default PGP name to `mew-prog-pgp'. Note
that pass-phrases are cached independently for each PGP.

Old fashioned PGP messages cannot be processed automatically. You can
decrypt and/or verify this kind messages with `C-cC-z'.

Getting messages
================

To copy arrived messages to your mailbox to +inbox and list up a list of
the messages, use `i'. The mailbox is determined according to
`mew-mailbox-type'. (When you type `M-x mew' and if
`mew-proto' is `+', messages are also copied according to
`mew-mailbox-type'.) Here are summary of its values.

`'mbox'
     A local mailbox. "incm" is used to copy messages for the local
     mailbox by default. To know how to configure it, see
     configuration.
`'pop'
     A POP server. To use POP as it is. (This is a default value.)
`'imap'
     An IMAP server. This is not recommended.

To flush a list of messages in a local folder and display them again,
use `s'.

To retrieve messages or flush-then-retrieve messages again in a remote
folder, type `s'. It is recommended to use `s', not `i', for IMAP and
NetNews.

If you use `s', it asks you a range. Here are a summary of important
ranges for Mew.

`update'
     From "the last message in the Summary mode + 1" to "the last
     message in the corresponding folder". That is, the gap between
     the Summary mode and the existing folder
`all'
     All messages in the folder. When Summary mode in a local folder
     becomes inconsistent, use this range to flush the list. For a
     remote folder, this range results in retrieval of all messages
     again.
`sync'
     Deleting cache messages whose originals were removed in the
     server side.  Valid for remote folders only.

The default range both for +draft, +queue, and +postq is `all'. For
other folders, the default is `update'. So, just type `RET' after `s'
to get the up-to-date list of the current folder except +draft,
+queue, and +postq.

Although they are not especially important in Mew, you can specify the
following ranges:

`<num1>-<num2>'
     From <num1> to <num2>. Valid for local folders only.
`<num1>-'
     From <num1> to the last. Valid for local folders only.
`-<num2>'
     From the first to <num2>. Valid for local folders only.
`last:<num>'
     Last <num> messages.

If you execute `s' with `C-u' on a remote folder, you can
toggle "copying a header only" and "copying both a header and a body".
This action can be defined by `mew-pop-header-only',
`mew-imap-header-only', and `mew-nntp-header-only' for POP,
IMAP, and NNTP, respectively. The default values of these are
`nil', that is, "copying both a header and a body".

Messages that are of large size may be truncated. This kind of message
is marked with `T'. To retrieve the rest of this kind of message, type
`I' on the message.

Suppose that there is a message marked with `T' in $inbox. If you type
`I' on it, you can retrieve the entire message.

Here is a summary of the commands concerned with message retrieval:

`i'
     In a local folder, fetch arrived messages, store them to the +inbox
     folder and create a list. If `mew-auto-flush-queue' is `t',
     send messages in +queue. Please refer to send for more
     information. In a remote folder, visit to its inbox folder and execute
     `s' + `update'.
`C-ui'
     Perform `i' with `mew-auto-flush-queue' reversed.
`I'
     Retrieve the rest of a truncated(`T') message.

     If you use this command in a local folder, a method to retrieve
     the message is determined by the "case" and
     `mew-mailbox-type'. If `mew-pop-delete'/`mew-imap-delete' is `t',
     delete the message from the mailbox.

     If you use this command in a remote folder, a "case" and protocol
     is determined by the folder. The message in the server side is
     always retained.
`C-uI'
     Perform `I' with `mew-pop-delete' or `mew-imap-delete' reversed.
`s'
     List up messages in Summary mode or flush them.
`C-us'
     On a remote folder, list up messages in Summary mode by toggling
     "copying a header only" and "copying both a header and a body".
`lc'
     Copy a cached message in a remote folder to a local folder.

Moving to another folder
========================

To go to another folder, type `g'. Mew asks you to input a folder name
as follows:

     Folder name (+inbox): +

Let's call the right side of ":" 'writable area'. In this example,
proto "+" is displayed in the writable area. Typing an appropriate
string following proto and typing `RET' decides a folder name, then
Mew moves to the folder.

When you move to a folder and if Mew finds its list of messages old,
Mew automatically displays the differences.

The string in "()" is a default. If you specifies "+" by simply typing
`RET', Mew considers that the default folder name is specified.

To make use of completion, type `TAB' or `SPC'.

Now, lets get back to the state just after typing `g'.

     Folder name (+inbox): +

If you want to change, for example, "+" to "%", you have to delete "+"
first then type "%" in normal situation. But this is inconvenient. So,
typing "%" just after "+" removes "+" automatically. Like this, typing
another proto just after a proto replaces the previous one without
deletion.

When you type a remote folder, you may want to specify the "case"
(described in config). The "case" must be specified before a
folder, separated by ":". Consider moving "%inbox" for a "case"
"home". In this case, you should type "home:%inbox". Yes, this is
inconvenient. So, typing `C-cTAB' in any position does circular
completion for available "cases". Let's look at the following example.

     Folder name (+inbox): %inbox

Typing `C-cTAB' here results in the following:

     Folder name (+inbox): home:%inbox

You may want to search a folder by specifying a substring of the
folder.  For this purpose, `C-s' and `C-r' are available. The
following is the state of the minibuffer after typing `C-s'.

     Folder name (+inbox): ()

"()" appeared in the writable area indicates you have switched to
search mode. While you are typing here, a matched candidate is shown
in "()".  The following is the case where a search key is "mew".

     Folder name (+inbox): (+work/mew-release) mew

To select the matched candidate, type `RET'. Then the search mode is
finished and the matched candidate is displayed in the writable area.

     Folder name (+inbox): +work/mew-release

Typing `RET' again means that you decide the folder.

A list of folders to be searched is decided by a combination of "case"
and proto. When you enter the search mode by typing `C-s' or `C-r', a
pair of "case" and proto is extracted from the writable area, and a
list of folders is selected according to the pair.

Write, answer, and forward
==========================

Please use the following commands for writing, replying, and
forwarding messages.

`w'
     Write a message. A new draft is prepared in Draft mode. Please refer to
     Composing.
`C-uw'
     Write a message. A new draft is prepared in Draft mode. The From:
     address of the current message is copied to the To: field in the
     draft.
`W'
     Send a message by modifying a part of the header of another
     message.  Please refer to resend.
`a'
     Answer to this message. A new draft is prepared in Draft
     mode. Mew automatically inserts the content of the fields To: and
     Cc:. Please refer to reply.
`C-ua'
     Answer to this message only to the sender.
`A'
     Answer to this message. A new draft is prepared in Draft
     mode. Mew automatically inserts the content of the fields To: and
     Cc: and cites the body. Please refer to reply.
`C-uA'
     Answer to this message only to the sender with citation.
`f'
     Forward this message to a third person. A new draft is prepared in Draft
     mode and this message is automatically attached. Please refer to
     forward.
`F'
     Forward messages marked with `*' to a third person. A new draft is
     prepared in Draft mode and this message is automatically attached. For
     more information, refer to target mark. Please refer to
     forward.

If an error message returns, please try again with the following
commands.

`E'
     Edit this message again to retry sending. Or edit this RFC822
     part typically included in a MIME-encapsulated error message.

       1. In +draft, the message is just edited.
       2. In +queue or +postq, the message is moved to +draft and is
          edited.
       3. Otherwise, the message is copied to +draft and is edited.

     For +draft, +queue, and +postq, the "case" revives.

     For the other folders, if `mew-case-guess-when-prepared' is `t',
     each field of the original header is replaced according to a
     guessed "case". For more information, see config.
`C-uE'
     The same as `E'. But, when used for other folders than +draft,
     +queue, and +postq, the original header is retained even if
     `mew-case-guess-when-prepared' is `t'.

Useful features
===============

Mew provides you with the following useful commands in Summary mode:

`v'
     Toggle "Summary mode only" and "Summary & Message mode". If you
     choose "Summary mode only", you can quickly put the `D' mark
     since the next message is not displayed.
`_'
     Toggle normal lines, wrapped lines and long lines.
`zv'
     If `mew-use-header-veil' is non-nil, field lines of To: and Cc:
     over `mew-header-veil-count' are covered with invisible
     veils. This commands toggles visibility of these lines.
     `mew-use-header-veil' and `mew-header-veil-count' are default to
     `t' and 4, respectively.
`M-l'
     Make the current line the center of the Summary mode.
`C-cC-s'
     Incremental search forward in Message mode.
`C-cC-r'
     Incremental search backward in Message mode.
`y'
     Save this message or this part into the file whose name is
     specified by you.
`b'
     Save the buffer of Message mode as is into the file whose name is
     specified by you.
`C-uy'
     Save this message or this part into the file whose name is
     specified by you, specifying coding-system for text.
`#'
     Print the content of Message mode according to
     `mew-print-function'.
`C-u#'
     Print the content of Message mode with a specified printer name.
`|'
     Send the content of Message buffer to a command via pipe.
`C-u|'
     Send the body of Message buffer (excluding its header) to a
     command via pipe.
`\'
     Executing an external command specifying this message as an
     argument.
`B'
     De-capsulate embedded messages in MIME format.
`C-uB'
     Decompose embedded files in this message.
`C-cC-a'
     Register the information on the current message to Addrbook
     (see addrbook).
`C-cC-v'
     Select PGP version (see cipher-viewing).
`C-cC-z'
     Let PGP decrypt and/or verify old fashioned PGP messages (see
     cipher-viewing).
`C'
     Change the value of the "case". For more information, please refer to
     config.
`='
     Display the folder name of this message and the message
     number. If this is a cache message, both the unique id and the
     size are also shown.  The full path to the message is set to the
     cut buffer of your window manager.
`;'
     Parse the Received: fields and display them in Message mode.
`Rd'
     Delete this folder.
`Rr'
     Rename this folder.

Updating status
===============

In some cases of configuration modifications, you have to update
status to reflect them. When you think configuration modifications
don't make any effects or some errors occur, use one of the following
commands:

`Z'
     Update information including Addrbook (see addrbook).
`C-uZ'
     Update information about folders of the current world.

Here is a summary of toggle commands.

`z8'
     Toggle 8bit mode (i.e. `mew-use-8bit').
`zc'
     Clean-up caches of analyzed messages.
`zd'
     Toggle `mew-debug'.
`zo'
     Toggle PGP/MIME or old-fashioned PGP (`mew-use-old-pgp') when
     composing with shortcut methods.
`zp'
     Toggle decode policy (i.e. `mew-decode-broken').
`zv'
     Toggle whether or not veil is used in Message
     mode(`mew-use-header-veil').
`zw'
     Toggle warning level. If `mew-warning-field-level' is 2, set it
     to 1. If `mew-warning-field-level' is 1, set it to 2.

Invalid messages
================

The following message contains Japanese text in its body. The charset
parameter is not specified in the Content-Type: field. So, the body
should be treated as US-ASCII.

     To: piglet
     Subject: an invalid message
     From: pooh
     MIME-Version: 1.0
     Content-Type: Text/Plain

     Japanese comes here.

The following header is invalid as well.

     From: "=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=" <kazu@example.net>

The string delimited by "=?" and "?=" in the above example was
originally Japanese. Since the spec of mail limits the content of
headers to ASCII characters, if a string whose character set is other
than ASCII, is to be stored in a header, the string must be encoded
with ASCII strings according to the defined rule. But it is certainly
invalid to embed the ASCII strings with `"'. Strings surrounded by `"'
are treated as is. Therefore, the string between "=?" and "?=" in the
example will not be decoded into Japanese.

Several mailers are careless about the spec and regularly violate
these rules. The right way to do is ask the programmers of such
mailers to make the programs conformant to the spec. However, since
there are so many mailers of this kind around the world, Mew tries to
decode as many different formats as possible. In these cases Mew
displays warnings such as:

     X-Mew: Charset for body is not specified.
            To: has encoded-words in quoted text.

If you want to decode messages strictly, set `mew-decode-broken' to
`nil'. This value can be toggled dynamically by `C-u.' (see
singlepart).

The following message is displayed as a mess since the character set
specified with the charset parameter and the actual character set of
its body are different.

     Content-Type: Text/Plain; charset=ISO-2022-JP

     Japanese text written in Shift_JIS

By using `C-cC-l', the text is re-displayed with charset guessed
according to a specified language, ignoring the character set
specified by the charset parameter. If you type `C-uC-cC-l', you can
re-display the text by specifying a character set explicitly.

Composing messages
******************

This section explains how to compose a message.

Methods to enter Draft mode to write a new message are given below.

  1. Type `M-x mew-send'.
  2. Type `C-xm' if `mail-user-agent' is configured.
  3. Press `w' in Summary mode.

Then a buffer like the following is prepared.

     To:
     Subject:
     From: Kazu Yamamoto <kazu@example.org>
     X-Mailer: Mew version 6.8 on Emacs 26.1
     ----

We call this "Draft mode". In Draft mode, we call the region above
"----" the header, and the region below "----" the body.

Also, replying a message (`a' or `A') and/or forwarding messages (`f'
or `F') lead you to Draft mode from Summary mode.

Drafts are temporarily stored in the +draft folder. You can write
multiple messages simultaneously.

For the method of deleting a prepared draft, please refer to
Quit.

Now let's see how to use Draft mode.

Completions in a header
=======================

In the header, completions for each field are assigned to `TAB' as
follows:

   - Field completion
   - Address completion (To:, Cc:, etc) (see addr-comp)
   - Folder completion (Fcc:)

<Field completion>

If the cursor is at the beginning of a line and the previous line does
not end with ",", you can complete field defined in the
`mew-fields' variable with `TAB'.

     To: kazu@example.org
     R`TAB'

At the point above, if you type `TAB', you get:

     To: kazu@example.org
     Reply-To:

<Folder completion>

At a point, such as Fcc:, you can complete folder name with
`TAB'. For example:

     Fcc: `TAB'

Here, "+" is completed.

     Fcc: +`TAB'

One more type of `TAB' shows candidates. Please type in the
appropriate characters then type `TAB'.

     Fcc: +b`TAB'

If a single candidate can be determined, you get a completion.

     Fcc: +backup

Circular completions in a header
================================

In a header, circular completions are assigned to `C-cTAB'.  Circular
completion means that a value of a list is replaced by the next value
of the list. The end of the list is considered continuous to the top
of the list. Circular completions in a header are different for each
field as follows:

   - Circular completion of domain name (To:, Cc:, etc)
   - Circular completion of From: (From:)

<Circular completion of domain name>

On a field where addresses are written, use `C-cTAB' for domain
completion. Candidates are selected from `mew-mail-domain-list'.

     To: kazu@`C-cTAB'

If you try to complete just after "@" as up above, the first domain of
`mew-mail-domain-list' is inserted.

     To: kazu@example.org`C-cTAB'

After completion, pressing `C-cTAB' one more times inserts the next
domain of `mew-mail-domain-list'. This completion is looped.

     To: kazu@example.jp

If a single candidate can be determined, it is inserted.

     To: kazu@w`C-cTAB'

The above example gives:

     To: kazu@example.jp

<Circular completion of From:>

In Draft mode, the From: field is inserted with the format of
"mew-name <mew-user@mew-domain>".

     From: Kazu Yamamoto <kazu@example.org>

On the From: field, `C-cTAB' circularly completes its value from
`mew-from-list'. You can set `mew-from-list' by yourself.  Also,
`mew-from-list' can be set automatically. For automatic setup, please
refer to config.

Typing `C-cTAB' anywhere on the value replaces the value with the next
value of `mew-from-list'. For example,

     From: Kazu Yamamoto <kazu@example.org>`C-cTAB'

becomes as follows:

     From: Kazuhiko Yamamoto <kazu@example.jp>

Address Completion
==================

You can complete addresses on To: or Cc:. This completion command is
bound to `TAB'.

     To: kazu`TAB'

When you type `TAB' after a part of an address as the example above,
the entire address is completed as follows:

     To: kazu@example.org

There are three kinds of registered addresses to be used for the
completion.

  1. The expansion rule in an address book
  2. The personal information in the address book
  3. Learned addresses when sending

Mew provides two ways to complete addresses. You can select one of
them with `mew-use-full-alias', which is default to `nil'.

If `mew-use-full-alias' is `nil', the portion before `@', a user name
or a short name, is a target of the completion. When you type `TAB',
the user name is completed. And if the user name is uniquely completed
and you type `TAB' again, it is expanded to its entire address. Let's
call this Address Completion(1).

An advantage of Address Completion(1) (see addr-comp1) is that you
can use the completion/expansion against the three kinds of addresses
seamlessly. You can also explicitly expand the user name with `TAB' as
described later. A disadvantage is that user names must be unique. So,
if a user name is already registered, other addresses with the same
user name cannot be learned.

If `mew-use-full-alias' is `t', for learned addresses when sending,
completion target is an entire address. Let's call this Address
Completion(2).

An advantage of Address Completion(2) (see addr-comp1) is that Mew
can learn addresses whose user names are the same. One of
disadvantages is that only the first address of personal information
can be used (the other addresses are useless). And for the explicit
expansion, you have to type `M-C-e', a different key from
`TAB'.

Address Book
============

Mew provides an address book ("~/Mail/Addrbook). The address book has
2 formats. One specifies expansion rules, while the other defines
personal information.

First, let's look at the format that specifies expansion rules.

     <shortname>: <address1>[, <address2>, <address3>,...]

In this way, you should specify a short name and a full address
separated by `:'. If you want to expand the short name to multiple
addresses, you can delimit them with a comma `,'. (This is exactly
same as addresses delimited by `,' in the To: field, for instance.)  A
space SPC is allowed after the comma `,'. For example:

     pooh:           winnie-the-pooh@example.net
     piglet:         piglet@example.org
     friends:        pooh, piglet

Next, the format to define personal information is shown below:

     <shortname> <address1>[, <address2>, <address3>,...] <nickname> <fullname>

In this way, four elements are separated by SPC. <shortname> is a short
name. <nickname> and <fullname> are the person's nickname and full name,
respectively. (For proper usage of the nickname, please refer to
summary-mode and/or draft-mode.)

The second element is the addresses. If the person has multiple
addresses, delimit them using `,'. SPC is allowed after `,', which
means that it does not function as the delimiter. SPC surrounded by
quotes `"' also has no delimiting function here. For example:

     kazu    kazu@example.org, kazu@example.net    Kazu-kun  "Kazuhiko Yamamoto"

In the personal information format, you can omit any element. When you
want to omit an intermediate element, specify `*'. The following is an
example to define nicknames for addresses.

     *       kazu@example.org, kazu@example.net    Kazu-kun

The nickname is used to replace addresses in Summary mode and to
replace the citation prefix (see cite) in Draft mode.

The comment letters are `;' and `#'. `;' is valid only
when it appears at the beginning of lines, resulting in the disregarding
of the entire line. The comment marker `#' is valid everywhere. The
strings between `#' and the end of the line are ignored. Also,
`\' means a continuous line.

Summary mode includes the feature of directly registering the
information of the current message into Addrbook. To register a
expansion rule, type `C-cC-a'.

     #If you want to register this entry, type 'C-c C-c'.
     #If you want to NOT register this entry, type 'C-c C-q'.
     Shortname: kazu
     Addresses: kazu@example.org
     Comments:

To register personal information, type `C-uC-cC-a'.

     #If you want to register this entry, type C-c C-c.
     #If you want to NOT register this entry, type C-c C-q.
     Shortname: kazu
     Addresses: kazu@example.org
     Nickname:
     Name: Kazuhiko Yamamoto
     Comments:

Add or modify the information if necessary. To register this
information, type `C-cC-c'. To quit the registration, type
`C-cC-q'. You should also refer to Quit.

If you want to use characters of multiple languages, put the following
onto the beginning of Addrbook.

     #-*-coding:ctext;-*-

Learning addresses
==================

When you send a message, addresses on the To: and Cc: field are
automatically registered. Consider the following:

     To: kazu@example.org

In the case of Address Completion(1) (see addr-comp1): When this
message is sent, a short name "kazu" is automatically registered for
the address "kazu@example.org". If there is already a short name of
"kazu", the next action is decided according to
`mew-addrbook-override-by-newone'. If `nil', the old entry
remains. Otherwise, the new entry overrides the old one. When
expanded, the address book short name has priority over the automatic
short name. Only automatic short names which are not contained in the
address book are valid.

In the case of Address Completion(1) (see addr-comp2): When this
message is sent, the address "kazu@example.org" is automatically
registered.

The limit number of automatic short names is 2000
(`mew-lisp-max-length'). Once the number exceeds 2000, the tail
entries in the alphabetical order are removed. This information is
automatically saved to the file "~/Mail/.mew-alias".

The automatic registration would register unnecessary short names. If
you want to remove these entry, take the following steps. First, type
`M-a' to open "~/Mail/.mew-alias". Then edit it as you do against a
text file. Lastly, type `C-xC-s' to save it. When saving it, the
modifications are automatically reflected to Mew.

The formats of Address Completion (1) and (2) are different. When you
change the value of `mew-use-full-alias' to switch one to the other,
type `Z' once in Summary mode. This converts the format properly.

Address Completion(1)
=====================

As far as Address Completion (2) is concerned, there is an assumption:
user names or short names of expansion rules, personal information and
learned addresses are unique.

For example, consider the following configuration of expansion rules:

     pooh:           winnie-the-pooh@example.net

When you are in a header in Draft mode, working within an address
field, after typing one or more characters, you can complete a short
name for an address by pressing the `TAB' key.

     To: piglet@example.org,
             po`TAB'

If you press the `TAB' key, "pooh" is completed (unless other
candidates exist).

     To: piglet@example.org,
             pooh`TAB'

One more press of the `TAB' key expands the name to
"winnie-the-pooh@example.net".

     To: piglet@example.org,
             winnie-the-pooh@example.net

A string ending with "@" is explicitly expanded. Please pay attention
to the following case where similar short names are defined.

     pooh:           winnie-the-pooh@example.net
     pooh-pooh:      pooh-pooh@example.org

It is obvious that "pooh-" is completed to "pooh-pooh". But if you
input "pooh", Mew cannot tell whether it should be expanded or
completed to "pooh-pooh". Thus, if you want to explicitly complete
"pooh" to "winnie-the-pooh@example.net", insert `@' and type
`TAB'.

     To: pooh@`TAB'

Explicit expansion can be accomplished by `M-C-e' instead of insertion
of `@'.

The explanation above can be applied to learned addresses when
sending.

The format of personal information means that each subsequently
generated address will replace the former one. For example:

     kazu    kazu@example.org, kazu@example.net    Kazu-kun  "Kazuhiko Yamamoto"

Let's watch how it will be converted:

     To: kazu`TAB'

Typing `TAB' after "kazu" generates "kazu@example.org".

     To: kazu@example.org`TAB'

Typing `TAB' after "kazu@example.org" brings about "kazu@example.net".

     To: kazu@example.net`TAB'

Then "kazu@example.org" will appear again if you type `TAB'
after "kazu@example.net". In this way, each address is replaced
one by one.

After deciding an address, you can add its full name.

     To: kazu@example.org`M-TAB'

Like this, typing `M-TAB' replace the address with the following
format.

     To: Kazuhiko Yamamoto <kazu@example.org>

Address Completion(2)
=====================

As far as Address Completion(2) is concerned, for learned addresses
when sending, the entire addresses are completion targets. For
expansion rules in the address book, short names are completion
targets and unique short names are expanded to corresponding
addresses. For personal information in the address book, short names
are completion targets and unique short names are expanded to their
first addresses.

When you are in a header in Draft mode, working within an address
field, after typing one or more characters, you can complete a short
name or a learned address by pressing the `TAB' key.

Suppose that kazu@example.org is already learned.

     To: ka`TAB'

When you type some characters and press `TAB', its address is
completed:

     To: kazu@example.org

Also suppose that "kazunori@example.jp" is learned. To expand a user
name to "kazu@example.org", you should input "kazu@". To convert it
to "kazunori@example.jp", you need to input "kazun".

For expansion rules and personal information, `TAB' completes short
names first. You can expand a unique short name to corresponding
address with `TAB'.

For example, consider the following configuration of expansion rules:

     pooh:           winnie-the-pooh@example.net

Let's complete "pooh":

     To: po`TAB'

If you press the `TAB' key, "pooh" is completed (unless other
candidates exist).

     To: pooh`TAB'

One more press of the `TAB' key expands the name to
"winnie-the-pooh@example.net".

     To: winnie-the-pooh@example.net

A problem occurs when a short name is not unique. Consider the
following example:

     pooh:           winnie-the-pooh@example.net
     pooh-pooh:      pooh-pooh@example.org

It is obvious that "pooh-" is completed to "pooh-pooh". But if you
input "pooh", Mew cannot tell whether it should be expanded or
completed to "pooh-pooh". Thus, if you want to explicitly complete
"pooh" to "winnie-the-pooh@example.net", type
`M-C-e'. (There is no way to accomplish this with `TAB'.)

     To: pooh`M-C-e'

This example is explicitly expanded as follows:

     To: winnie-the-pooh@example.net

Sending a message
=================

When you are ready to send a message after completing composition,
choose one of the following two commands.

`C-cC-m'
     Compose a message, put it into +queue or +postq, and leave it for
     later sending.
`C-cC-c'
     Compose a message and send it. You receive the prompt: "Really
     send this message? (y or n) ". Type `y' to send it.

Let's look at how a message is modified when sent. Please see the
following example:

     To: pooh
     Subject: the next Sunday
     From: Piglet <piglet@example.org>
     X-Mailer: Mew version 6.8 on Emacs 26.1
     ----
     Would you like to play with me next Sunday?

     // Piglet

This message is modified as follows, for example, if it is put into
+queue or +postq by `C-cC-m'.

     Date: Mon, 13 Mar 2000 19:49:50 +0900 (JST)
     Message-Id: <20000313.194950.59499544.piglet@example.org>
     To: winnie-the-pooh@example.net
     Subject: the next Sunday
     From: Piglet <piglet@example.org>
     X-Mailer: Mew version 6.8 on Emacs 26.1
     Mime-Version: 1.0
     Content-Type: Text/Plain; charset=us-ascii
     Content-Transfer-Encoding: 7bit

     Would you like to play with me in the next Sunday?

     // Piglet

As you can see, Data: and Message-Id: are added. You should note that
both its data type and its character set are guessed correctly and
added.

When composing a message using `C-cC-m' and `C-cC-c', you can make use
of a feature that identifies errors in a header.

Suppose you set `mew-ask-subject' to `t'. If Subject: is
empty, Mew asks you its value. If you want to leave it empty, just type
`RET'. The default value of this variable is `nil'.

Suppose you set `mew-ask-fcc' to `t'. If there is a folder that
doesn't exist, Mew asks you whether or not you want to create it.  If
you want to create it, type `y'. Otherwise, type `n'. If you type `n',
sending is aborted and the cursor returns to the draft. The default
value of this variable is `nil'.

Mew asks you to input your password for sending if the server requires
user authentication. Historically speaking, passwords are not
necessary to send e-mail messages. This is one reason why e-mail
addresses can be faked. In the near future, passwords are always
required for sending messages as are for receiving messages.

There are two ways to send messages waiting in +queue. Please note
that both of these are commands in Summary mode.

`i'
     If `mew-auto-flush-queue' is `t', the messages being held in
     +queue will be sent after the incoming messages have been received.
     This method is appropriate for dial-up environments, since one can save
     on connection fees and repeated authentication for sending.
     `mew-auto-flush-queue' is default to `t'.
`C-cC-c'
     Send messages in +queue. Method is appropriate if you like to
     preview composed messages first in +queue and then send them. If
     `mew-ask-flush-queue' is `t', you are asked, Flush queue? (y or
     n) ". `mew-ask-flush-queue' is default to `nil'.

Signature and citation
======================

Next is the explanation of the commands for processing the text in the
body of the message.

The first one is signature. To insert your signature file
("~/.signature") on the cursor point, type `C-cTAB'. You can define
your own signature file to `mew-signature-file'. Setting
`mew-signature-as-lastpart' and `mew-signature-insert-last', you can
customize the action of `C-cTAB'.

`C-cTAB'
     Insert "~/.signature" on the cursor point.

The next one is citation. If you use `a' or `A' in Summary mode, a
draft for reply is opened up and Emacs is split into three
windows. The top is Summary mode, the middle is Message mode, and the
bottom is Draft mode.

Here are the commands for citing text from Message mode to Draft mode.

`C-cC-y'
     Copy and paste a part of a message from Message mode WITH
     citation prefix and label.
       1. Roughly speaking, it copies the body in Message mode. For
          example, if Text/Plain is displayed, the entire Message mode
          is copied. If Message/Rfc822 is displayed, the body without
          the header is copied.
       2. If you type `C-uC-cC-y', the header is also copied if
          exists.
       3. If an Emacs mark exists, the target is the region between
          the mark and the cursor.
`C-cC-t'
     Copy and paste a part of the message from Message mode WITHOUT
     citation prefix and label.

The default label and prefix is as follows:

     From: SUMIKAWA Munechika <sumikawa@ebina.hitachi.co.jp>
     Subject: Wine
     Date: Wed, 23 Jul 1997 11:40:50 +0900

     > Hi, it's Sumikawa, the guy who's neat from good morning
     > to good night.
     >
     > Talking about the wonderful wine party, I would propose
     > Cabernet Sauvignon, Bordeaux, '90.

In Draft mode, you can cite any text displayed in Message mode. So,
you can cite text from multiple messages easily. Select a message in
Summary mode and display it in Message mode, then cite it in Draft
mode. Please repeat this procedure as you like. Triple windows are
opened for this purpose.

When highlighting gets wrong, type `C-cC-l' to re-highlight both the
header and the body

Composing multipart
===================

Now let's see how to create multipart messages.

When you are writing a message in +draft/1 and type `C-cC-a', the
following lines are inserted at the bottom of the draft.

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
          2                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

"1/" is a temporary directory to create multipart and provides a
location for "~/Mail/attach/1". The part 1, "CoverPage", refers to the
body. Now the entire draft looks like:

     To: mew-dist
     Subject: This is header
     X-Mailer: Mew version 6.8 on Emacs 26.1
     ----
     This is the body.

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
          2                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

Here we designate three regions as follows:

   * the region above "----" `header'
   * the region from "----" to "attachments" `body'
   * the region below "attachments" `attachments'

In Draft mode, the key bindings differ according to the region.

To `TAB', for instance, the following functions are assigned:

header
     Completions.
body
     Insert TAB.
attachments
     Do nothing.

To `c', functions are assigned as follows:

header
     Insert c.
body
     Insert c.
attachments
     Copy a file.

The following is a summary of commands in the attachments region.

`C-p'
     Go to the previous file in the current directory.
`C-n'
     Go to the next file in the current directory.
`C-f'
     Go to the first subdirectory.
`C-b'
     Go to the parent directory.
`c'
     Copy a file (possibly via networks) on ".". To copy a remote
     file, use the "/[user@]hostname:/filepath" syntax.
`l'
     Link a file with a symbolic link on ".". If you want to edit the
     attached file, you should `c' instead of `l' so that you do not
     edit the original file.
`d'
     Delete this file or this directory.
`m'
     Create a subdirectory (i.e. multipart) on ".".
`f'
     Open this file into a buffer.
`F'
     Open a new file into a buffer on ".".
`y'
     Link the message which is displayed in Message mode on ".".
`e'
     Input external-body on ".".
`a'
     Sampling voice and insert as audio file on ".".
`p'
     Extract the PGP key for the specified user on ".".
`D'
     Input a description (Content-Description:).
`T'
     Change the data type (Content-Type:).
`t'
     Toggle text and binary for the data type.
`I'
     Specify input coding-system for a Text/* object.
`C'
     Specify output coding-system for a Text/* object.
`P'
     Specify a file name (Content-Disposition:) to save this part in the
     receiver side. If you type just `RET' without any string, its value
     is cleared. Then the file name in the sender side is displayed with
     `*'.

In attachments, data types are guessed by suffix. The currently
supported suffixes are as follows:

     .txt       Text/Plain
     .html      Text/Html
     .xml       Text/Xml
     .rtf       Text/Enriched
     .css       Text/Css
     .sgml      Text/Sgml
     [0-9]+     Message/Rfc822
     .ps        Application/Postscript
     .pdf       Application/Pdf
     .doc       Application/Msword
     .xls       Application/Vnd.Ms-Execl
     .ppt       Application/Vnd.Ms-Powerpoint
     .vsd       Application/Vnd.Visio
     .dat       Application/Ms-Tnef
     .tar|.tar.|.gz|.Z|.taz|.tgz|.bz2?|.lzh|.zip|.bin|.pgp|.gpg|.exe|.dll
                Application/Octet-Stream
     .gif       Image/Gif
     .tiff      Image/Tiff
     .jpe?g     Image/Jpeg
     .png       Image/Png
     .xwd       Image/X-Xwd
     .xbm       Image/X-Xbm
     .xpm       Image/X-Xpm
     .bmp       Image/X-Bmp
     .pcx       Image/X-Pcx
     .tga       Image/X-Tga
     .au        Audio/Basic
     .wav       Audio/X-Wav
     .aif?f     Auido/X-Aiff
     .midi?     Auido/X-Midi
     .mpga|.mp[23]  Audio/X-Mpeg
     .mpe?g     Video/Mpeg
     .mov       Video/Quicktime
     .avi       Video/X-Msvideo

Please choose an appropriate suffix for the file name so that Mew can
guess its data type. If there is no matched suffix, the data type
specified by `mew-content-type' is chosen. Its default value is
Text/Plain.

For instance, if you copy files with `c', the part becomes as follows:

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
     B    2  Image/Gif                    MagicPoint logo            mgp.gif
     Q    3  Application/Postscript       Presentation Material      ohp.ps
          4                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

Each line of a multipart message consists of

   - marks (Content-Transfer-Encoding:)
   - part number
   - data type (Content-Type:)
   - description (Content-Description:)
   - file name (Content-Disposition:).

You can change data types (Content-Type:) by pressing `T' at any
time. If the data type is either text (Text/Plain) or binary
(Application/Octet-Stream), you can toggle between them using `t'.

Please refer to mark-b-comp for explanation on changing the
mark (Content-Transfer-Encoding:). You can also insert descriptions
(Content-Description:) by `D'. This description column is overwritten
when encrypted as described in mark-b-comp.

Strictly speaking, the fifth column is the copied file name or the
value of Content-Disposition:, namely the file name to which the
receiver saves the part. If Content-Disposition: exists, Mew displays
it. Otherwise, Mew displays the copied file name with `*'
appended. When you copy a file, the file name is specified as
Content-Disposition:. But this is not true for both Message/* and
Multipart/*. To specify Content-Disposition: for Message/*, use
`P'.

Files are treated as singlepart while directories are treated as being
multipart. Therefore you can create very complex multipart MIME
messages in the same way as you would create a file system. Very easy,
isn't it?

The default data type for directories is Multipart/Mixed. Of course,
you can change it by pressing `T'.

Once you are ready to send a multipart message, type `C-cC-m' or
`C-c C-c' to send it as described the previous subsection.

Next is the explanation of the creation of a Message/External-body by
pressing `e'. If the access-type is "ftp" or "anon-ftp", you can take
advantage of remote filename completion due to the existence of the
native Emacs mode of ange-ftp. Of course file completion is available
for the access-type of "local-file".

If you want to abort creating multipart and to get back to singlepart,
type `d' in the top level of the multipart message.

Defining charset
================

Mew has a mechanism for determining the character set of the transfer
form for both singlepart and multipart.

<Singlepart>

When you type `C-cC-m' or `C-cC-c' to compose a message in Draft mode,
Mew decides the character set of the transfer based on the internal
representation of its body. On Bilingual Emacs, US-ASCII is chosen for
7bit character sets while ISO-8859-1 is selected for 8bit character
sets. On Internationalized Emacs, the character set of the transfer
form is chosen based on rules defined by Mew.

<Multipart>

Since the data to be attached as a part of multipart is a file, it is
stored on disk. Therefore, in order to determine its character set for
the transfer form, it is necessary to load the file into an Emacs
buffer converting it into internal representation. After that, Mew
determines the character set of the transfer form for the file by the
same method as singlepart.

On Bilingual Emacs, Mew reads a file as is. So if the file is 7bit,
US-ASCII is chosen. Otherwise ISO-8859-1 is selected.

On Internationalized Emacs, Mew reads a file according to the local
convention (i.e. auto conversion). The command to set a local
convention is `C-x RET l'.

For example, in Japan, ISO-2022-JP, EUC-JP, and Shift_JIS is readily
guessed and stored in buffer as internal representations for
Japanese. Mew chooses ISO-2022-JP as the character set of the transfer
form from the internal representation. That is, even if the character
set of the file is EUC-JP or Shift_JIS, it is automatically converted
into ISO-2022-JP, which is the transfer form for Japanese. This means
that you can attach a file without needing to pay attention to its
character set.

If you want to specify the coding-system of a file to be attached, type
`I'. Let's call the character set "input character set". Also, if
you want to specify the coding-system of the transfer form, use
`C'.

Information regarding the character set is displayed in
parentheses. If the character set of the transfer form is specified
explicitly, it is displayed. Otherwise, if the input character set is
specified, it is displayed with "*". Otherwise, "guess" is displayed.

Let's look at the following example. Since part 1 is a body, it is
stored in an Emacs buffer. Because "guess" is displayed, it is Mew
that determines the character set of the transfer form according to
the rules that Mew defines.

Since iso-8859-1 is specified as the input character set, Mew loads
the file considering that its character set is iso-8859-1, and then
converts it into internal representation. The character set of the
transfer form is decided according to rules defined by Mew.

The input character set in part 3 cannot be identified just from this
example. (But a user certainly knows what it is since he actually
specified it.) In any case, a file will be loaded and be converted
into internal representation, then be converted into EUC-JP which is
specified as the character set of the transfer form.

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
          2  Text/Plain(*iso-8859-1)                                 text1
     B    3  Text/Plain(euc-jp)                                      text2
          4                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

Note that both `C' and `I' are not available on Bilingual Emacs.

Handling long lines
===================

For a long period, when you are writing a message, you should fold
each line around 70 characters by yourself. RFC 3676 extended
Text/Plain and defined "flowed" as a value of the "format" parameter.

Thanks to this, long lines can be automatically folded on a sender
side while they can be unfolded on a receiver side. From the point of
user view, you can write long lines casually.

There are two ways to apply the flowed folding.

1) To apply the flowed folding explicitly, type `C-cC-f'.

Then, Mew sees if long lines exist in a draft. If long lines whose
length is over `mew-flowed-fold-threshold' are found, Mew applies
the "flowed" folding. This variable defaults to 78.

`mew-flowed-fold-length' controls the max length of folded lines. Its
initial value is 70.

Folding method is decided according to character set. If the language
is separated by SPC, the new line characters are inserted after
existing SPCs(delsp=no). Otherwise, pairs of SPC and the new line
character are inserted in appropriate positions(delsp=yes).

If you type `C-cC-f' again, the folded lines are unfolded.

2) If `mew-use-format-flowed' is `t', this functionality is
took into account automatically at composing with `C-cC-c' or
`C-cC-m'. Its default value is `nil'.

3) You can toggle the value of `mew-use-format-flowed' by
`C-cC-pC-f'.

Note that folded lines with the "flowed" folding are always unfolded
on viewing regardless of the value of `mew-use-format-flowed'.  If you
feel it is hard to see long lines, use `_' in Summary mode.

If `mew-flowed-auto-wrap' is `t', at visualizing a message, `_' is
automatically executed so as unfolded lines are folded.  The default
value of `mew-flowed-auto-wrap' is `t'.

Replying to a message and deciding recipients
=============================================

As distinguished from the case of a new message, where the writer
specifies the addresses of the To:, Cc: or Newsgroups: fields, in a
reply message addresses are automatically generated.

When `a' and `A' is used in Summary mode, a new draft is prepared in
Draft mode. Values of To:, Cc:, and Newsgroups: are prepared according
to three alists.

  1. If called with `C-u', replying to the sender/poster only. In this
     case, `mew-reply-sender-alist' is used.
  2. If this message is sent by ME, you probably intend to reply with
     the original header. In this case, `mew-reply-fromme-alist' is
     used.
  3. Otherwise, replying to all people listed. In this case,
     `mew-reply-all-alist' is used.

The default value of `mew-reply-sender-alist' is as follows:

     '(("Reply-To:"
        ("To:" "Reply-To:" "From:"))
       (t
        ("To:" "From:")))

This is read as follows:

  1. If Reply-To: exists, copy the values of Reply-To: and From: to
     new To:.
  2. Otherwise, copy the value of From: to To:.

If you would like to reply only to the address on Reply-To: (if any),
set `mew-reply-sender-alist' like this:

     (setq mew-reply-sender-alist
           '(("Reply-To:"
              ("To:" "Reply-To:"))
             (t
              ("To:" "From:"))))

The default value of `mew-reply-fromme-alist' is as follows:

     '((t
        ("To:" "To:")
        ("Cc:" "Cc:")
        ("Newsgroups:" "Newsgroups:"))))

This is read as follows:

  1. Copying the value of To: to new To: and copying the value of Cc:
     to new Cc: and copying the value of Newsgroups: to new
     Newsgroups:.

The default value of `mew-reply-all-alist' is as follows:

     '((("Followup-To:" "poster")
        ("To:" "From:"))
       ("Followup-To:"
        ("Newsgroups:" "Followup-To:" "Newsgroups:"))
       ("Newsgroups:"
        ("Newsgroups:" "Newsgroups:"))
       ("Reply-To:"
        ("To:" "Reply-To:" "From:")
        ("Cc:" "To:" "Cc:" "Apparently-To:"))
       (t
        ("To:" "From:")
        ("Cc:" "To:" "Cc:" "Apparently-To:")))

This is read as follows:

  1. If the value of Followup-To: is "poster", copying the value of
     From: to new To:.
  2. If Followup-To: exists, copying the values of Followup-To: and
     Newsgroups: to new Newsgroups:.
  3. If Newsgroups: exists, copying the value of Newsgroups: to
     Newsgroups:.
  4. If Reply-To: exists, copying the values of Reply-To: and From: to
     new To:. And copying the values of To:, Cc:, and Apparently-To:
     to new Cc:.
  5. Otherwise, copying the value of From: to new To:. And copying the
     values of To:, Cc:, and Apparently-To: to new Cc:.

You may want to set `mew-reply-all-alist' like this:

     (setq mew-reply-all-alist
           '((("Followup-To:" "poster")
              ("To:" "From:"))
             ("Followup-To:"
              ("Newsgroups:" "Followup-To:"))
             ("Newsgroups:"
              ("Newsgroups:" "Newsgroups:"))
             ("Reply-To:"
              ("To:" "Reply-To:"))
             (t
              ("To:" "From:")
              ("Cc:" "To:" "Cc:" "Apparently-To:"))))

If there are multiple entries for a certain address, they are
unified. Addresses ending with ":;", which indicates anonymous
recipients, are automatically removed.

Your addresses are automatically removed. Your addresses are
automatically defined to `mew-mail-address-list' according to, for
example, `mew-config-alist'. If you dislike this value, you can also
explicitly set it like this:

     (setq mew-mail-address-list
            '("^pooh@[a-z]*.example.org$"
              "^pooh@example.net$"
              "^winnie@example.jp$"))

Forwarding messages
===================

To forward messages, type `f' or `F' in Summary mode. Then Draft mode
appears and the messages are already attached in the attachments
region.

Also, you can prepare the attachments region by yourself, then copy
(`c') the messages or make links (`l') to the messages. If the file
names of the messages are numeric ([0-9]+), they are automatically
considered as messages. `y' is very convenient because it make a link
to the message displayed in Message mode.

By default, the entire message is forwarded. If you want to remove
some parts of its header, define
`mew-field-delete-for-forwarding'. The following is an example to
remove "Received:" and "Return-Path:" when forwarded.

     (setq mew-field-delete-for-forwarding '("Received:" "Return-Path:"))

Re-sending messages
===================

You may occasionally wish to send messages modifying the header of a
message.

For instance, you may want to send a message with the same body to
multiple receivers independently. Please imagine the case where you
put a created message destined to Pooh in +queue and then you wish to
send an another message to Piglet by copying it and modifying its
header.  Let's call this recycle sending.

Also, you occasionally wish to send a message adding the Resent-To:
field to a target message. This is a kind of forwarding. This is
called header conversion because a message header is modified. The
forwarding described the previous subsection is called encapsulation
because a message is embedded into another new message.

Header mode exists for this reason, modifying a part of the header,
sending/queuing the created message. You can think this is a kind of
Draft mode which prohibits modifications of its body.

The following commands are provided in Summary mode to enter Header
mode.

`W'
     Recycle sending. Enter Header mode in order to modify To:, Cc:,
     From: of a target message. Typical usage is for messages in
     +queue or +postq.
`r'
     Re-sending. Enter Header mode in order to add Resent-To:,
     Resent-Cc:, Resent-From: of a target message. Re-sending may
     confuse receivers, so you should think carefully before using it.

In Header mode, you can make use of completion and circular completion
like in Draft mode. When you are finished inputting the header, send
the message using one of the following commands. You may be concerned
because the body of the message is not displayed in your new
message. But you need not worry, since the body and a part of the
target message is certainly used.

`C-cC-m'
     Compose a message, put it into +queue or +postq, and let it be
     waiting to be sent.
`C-cC-c'
     Compose a message and send it. You are asked, "Really send this
     message?  (y or n) ". Type `y' to send it.

Creating signature or cipher message
====================================

This section explains the method for signing or encrypting "text only"
messages with PGP or S/MIME. The following commands are explained.

`C-cC-s'
     Sign the entire draft. Input your pass-phrase.
`C-cC-e'
     Encrypt the entire draft.
`C-cC-b'
     Sign, and then encrypt the entire draft. Input your pass-phrase.
`C-cC-r'
     Encrypt, and then sign the entire draft. Input your pass-phrase.

To encrypt a message, receivers' public keys are used. On the other
hand, your secret key is used to sign a message, and so you need to
input your pass-phrase when applying the signature. Note that if you
are using the pass-phrase cache or the master password mechanism and
there are pass-phrases presently cached, you do not have to type your
pass-phrase (see password).

These commands create a PGP/MIME message by default. If you want to
use S/MIME, configure as follows:

     (setq mew-draft-privacy-method 'smime)

You can change this variable with `C-cC-pC-m' in Draft mode.

We can consider that these four commands above are shortcut methods of
mark based composing described in the next section.

To sign a message, type `C-cC-s'. When signing, because your secret
key is needed to be decrypted, you may be asked for your pass-phrase
if it is not cached. Created messages are stored in +queue or +postq.

Your secret key is identified in From: address. If From: does not
exist, your default secret key is selected. When you want to specify a
secret key that is not identified the address of From:, type
`C-uC-cC-s'.

To encrypt a message, type `C-cC-e'. A message is encrypted with
public keys identified with the addresses on To: and Cc:. Since this
is encryption only, you are not asked for your pass-phrase. Created
cipher messages are stored in +queue.

This message is encrypted with your public key in addition to those of
the receivers. Therefore you can decrypt created messages. For
example, you can go to +queue by `g' and preview a created message to
reconfirm this.

To sign a draft and then encrypt it, type `C-cC-b'. To encrypt a draft
and then sign it, type `C-cC-r'. In both cases, created messages are
stored in +queue.

It is very likely that you will forget to sign and/or encrypt a draft
even if you intended to do so. To prevent this, Mew provides an
mechanism to automatically sign or encrypt a message when
`C-cC-m' or `C-cC-c' is typed.

If you want to protect privacy of all drafts, set
`mew-protect-privacy-always' to `t' and set
`mew-protect-privacy-always-type' to one of services.

If you want to protect the privacy of drafts when replying encrypted
messages, set `mew-protect-privacy-encrypted' to `t' and set
`mew-protect-privacy-encrypted-type' to one of the services.  This
configuration is preferred to the configuration for all drafts
described above in the case of replying encrypted messages.

The following services are available. The strings enclosed in braces are
the symbols for each service. The service applied when typing
`C-cC-m' or `C-cC-c' is displayed in the mode line.

pgp-signature (PS)
     Sign with PGP
pgp-encryption (PE)
     Encrypt with PGP
pgp-signature-encryption (PSPE)
     Sign then encrypt with PGP
pgp-encryption-signature (PEPS)
     Encrypt then sign with PGP
pgp-signature (SS)
     Sign with S/MIME
pgp-encryption (sE)
     Encrypt with S/MIME
pgp-signature-encryption (SSSE)
     Sign then encrypt with S/MIME
pgp-encryption-signature (SESS)
     Encrypt then sign with S/MIME

The following example works for signing all drafts.

     (setq mew-protect-privacy-always t)
     (setq mew-protect-privacy-always-type 'pgp-signature)

The following example is for encrypting drafts with PGP when replying
encrypted messages.

     (setq mew-protect-privacy-encrypted t)
     (setq mew-protect-privacy-encrypted-type 'pgp-encryption)

In Draft mode, `C-cC-pC-a' toggles
`mew-protect-privacy-always' and `C-cC-pC-e' toggles
`mew-protect-privacy-encrypted'.

You can specify privacy services for the current draft in Draft mode
beforehand so that you do not forget to apply the privacy services
when sending. To set privacy services to the current draft evaluated
when typing `C-cC-m' or `C-cC-c', type `C-cC-pC-d', and then input one
of privacy services listed above. To cancel the current privacy
service, just type `RET' instead of selecting the privacy service.

When you compose a message by `C-cC-c' or `C-cC-m', and if signing
and/or encryption fails, the cursor gets back to the draft. At this
time, the service that you specified is canceled. If you type `C-cC-c'
or `C-cC-m' in this situation, a plain message is created, so please
be careful. After correcting the cause of the failure, if you want the
same service, type `C-cC-pC-d' to specify your service explicitly or
use `C-cC-s', `C-cC-e', etc.

If `mew-use-old-pgp' is set to `t' (the default value is `nil'),
`C-cC-s' and `C-cC-e', etc create old fashioned PGP message instead of
PGP/MIME. If the attachment region exists, an error occurs.

`mew-protect-privacy-*' described above are effective only to
PGP/MIME, not to old PGP. If you want to create old PGP signature with
`C-cC-m' or `C-cC-c' always, set
`mew-protect-privacy-with-old-pgp-signature' to `t'.

For PGP/MIME and S/MIME, Mew supports GnuPG 1.x and 2.0, not 2.1.

Mark based composer
===================

To support PGP/MIME, S/MIME and ZIP, mark based composing is
provided. Remember the previous example.

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
     B    2  Image/Gif                    MagicPoint logo            mgp.gif
     Q    3  Application/Postscript       Presentation Material      ohp.ps
          4                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

You can find the `B' mark and the `Q' mark at the beginning of the
line. Mew provides you with a new concept of "encoding". Encoding
includes Base64, Quoted-Printable, Gzip64 (Gzip + Base64), signature,
encryption.

At present, 8 marks are prepared.

`" "'
     No encoding. But 8bit text would be encoded.
`B'
     Base64
`Q'
     Quoted-Printable
`G'
     Gzip64 (compressed with gzip then encoded with Base64. This is
     experimental. Do not use this if receivers do not use Mew.)
`PS'
     Sign with PGP
`PE'
     Encrypt with PGP
`SS'
     Sign with S/MIME
`SE'
     Encrypt with S/MIME

Additional key binding for marks in attachments is as follows:

`B'
     Put the `B' mark to encode with Base64.
`Q'
     Put the `Q' mark to encode with Quoted-Printable.
`G'
     Put the `G' mark to encode with Gzip64. This is applicable only
     to Text/Plain and Application/Postscript since compression is not
     effective with other objects. For example, JPEG is already
     compressed.
`S'
     Put the `PS' mark to sign with PGP.
`E'
     Put the `PE' mark to encrypt with PGP. Input decrypters'
     addresses.
`M-s'
     Put the `SS' mark to sign with S/MIME.
`M-e'
     Put the `SE' mark to encrypt with S/MIME. Input decrypters'
     addresses.
`Z'
     Encrypt the part with ZIP immediately. After the encryption, the
     `B' mark appears.
`U'
     Unmark. The original mark appears.

Consider the following example: The second part will be signed with
PGP then encrypted with PGP for "kazu". Don't be alarmed. Its
description is overwritten but saved. The third part will be encoded
with Gzip64.

     ----------------------------- attachments -----------------------------
           Multipart/Mixed                                         1/
          1  Text/Plain(guess)                                       CoverPage*
     PSPE 2  Image/Gif                    kazu@example.org          mgp.gif
     G    3  Application/Postscript       Presentation Material      ohp.ps
          4                                                          .
     --------0-1-2-3-4-5-6-7-8-9--------------------------------------------

After applying marks, type `C-cC-m' or `C-cC-c' to create messages.

PGP key distribution
====================

To distribute a PGP public key, please use `p' on attachments in Draft
mode. It asks whose public key you want to distribute. Just type `RET'
if it is yours. If you want to distribute someone else's key, input
his e-mail address with completion. The PGP public key will
distributed as Content-Type: Application/Pgp-Keys.

If Mew finds that the part is Application/Pgp-keys, it tries to add
the PGP public key onto your PGP public keyring. Remember that Mew is
not responsible for TRUST or VALIDITY. It is YOU who set these
values. Please use the commands described by Mew to set these as
necessary. If you do not know the meaning of TRUST and VALIDITY, you
should learn the web of trust system provided by PGP BEFORE using PGP
to protect your privacy.

Sending messages with anonymous receivers
=========================================

You may occasionally wish to send a message to anonymous receivers.

For instance, please imagine that Pooh is trying to invite multiple
friends to a party. Piglet should reply only to Pooh. However, Piglet
might make a mistake of replying to other people if the addresses of
all the invitees are listed in Cc:. Moreover, Pooh does not want to
disclose the names of those who he invited until the day of the party.

To handle this, Mew makes use of ":;" for anonymous addresses. Please
look at the following example.

     To: party:piglet@example.org,roo@example.org;
     From: Pooh <winnie-the-pooh@example.net>

Here, there is a colon (":") after the explanatory comment
"party". This is followed by some addresses that are delimited by
"," and terminated by ";". If you write addresses in this format, Mew
sends the message to the addresses with them removed form the
header. In this example, Piglet and Roo will receive the following
message.

     To: party:;
     From: Pooh <winnie-the-pooh@example.net>

The receiver knows that the sender is Pooh, but will not know who else
received the message. Also, the string "party:;" is not address, so
the receiver cannot reply to it.

You should understand that enumerating many addresses on To: or Cc: is
basically not a good practice anyway. If you often have the occasion
to send messages a set group of people, you should create a
mailing-list.

Funny marks
***********

Here is a listing of marks that a user can use for insertion or
deletion in Summary mode. This mark is displayed in the beginning of a
line as follows: (Note that the marks that Mew inserts are displayed
left side of date.)

     D 03/12 Hidenori Ohta  This weekend              |Let's go to StoneMagic
     oM03/14 Momo-chan      The pictures of Noto      |Attached are the pictu
     * 03/15 Neat Sumikawa  Re: wine                  |OK. I vote for Wednesd

There are six marks at present.

`U'
     The unread mark.
`D'
     The delete mark.
`X'
     The delete mark.
`o'
     The refile mark, that is, to move a message to another folder.
`*'
     The target mark.
`$'
     The mark to save another mark temporarily.

Just putting a mark on to a message does NOT process anything at all.
It is typing `x' that processes the marks including `o', `D', `X'. So,
take it easy to put marks but take care to type `x'.

The marks above are explained in sequence. The marks which Mew inserts
are summarized here as well.

Unread `U'
==========

With the following configuration, messages are marked with the unread
mark `U' when scanning the messages.

     (setq mew-use-unread-mark t)

When you read a message with `SPC', `n', or `p' and etc, the `U' mark
disappears.

These three commands read through messages marked with the `*' mark,
the `U' mark, and non-marked messages. If you type `zSPC', they read
through messages marked with the `*' mark and the `U' mark only. This
is convenient to read through unread messages. Typing `zSPC' again
gets the target messages back.

When you move onto the current message by putting a mark on the
previous message, the `U' mark is deleted. It's sure that you want to
read the current message if you move onto it by `SPC', `n', and
`p'. However, you might not intend to read the current message when
you move onto it by putting a mark. If this is the case, this spec is
inconvenient for you. If you want to retain the unread mark on the
current message when you move onto it by putting a mark on the
previous message, configure as follows:

     (setq mew-delete-unread-mark-by-mark nil)

The followings are summary of commands related to the `U' mark.

`zSPC'
     Toggle the target of `SPC', `n', and `p'. Toggling means change
     one to the other out of "the `U' mark, the `*' mark, and
     non-mark" and "the `U' mark and the `*' mark".
`M-u'
     Put the `U' mark to the current message.

Delete `D' and `X'
==================

If you want to delete a message, type `d' in Summary mode to put the
`D' mark on it. Don't be worried about losing the message by
mistake. Since putting the `D' mark has no immediate effect, it does
not result in a serious mistake. By default, typing `x' moves messages
marked with `D' to a trash.

For local folders, a trash is +trash. For IMAP, it is %trash.

To really delete messages in the trashes, there are two methods:

  1. Type `D' in Summary mode.
  2. Put the `D' mark in the trashes then type `x'.

Exactly speaking, the following rule is applied for local folders.
(`mew-trash-folder' is default to +trash.
`mew-trash-folder-list' is default to `nil'.)

   - If `mew-trash-folder' is `nil', messages marked with
     `D' are deleted.
   - If `mew-trash-folder-list' is defined, messages marked with `D'
     in one of the folders defined in it are deleted. Otherwise, they
     are moved to the trash.
   - If `mew-trash-folder-list' is `nl', messages marked with `D' in
     `mew-trash-folder' are deleted.  Otherwise, they are moved to the
     trash. (This is default.)

For IMAP, the same rule is applied according to both
`mew-imap-trash-folder' and `mew-imap-trash-folder-list'

It is convenient if you can change the `*' mark to the `D' mark since
you can put many the `D' marks at once. To achieve this, use `md'.

Also, typing `Md' put the `D' mark to all duplicated messages
excluding one for each.

There is also another mark, `X', which is like the mark `D'.
Messages marked with `X' are deleted when `x' is typed. The
`X' mark can be put by `M-d'.

`mxM-d' processes messages marked with `X' only. Typing
`mM-d' converts all `*' marks to `X'.

The following is a summary regarding with the `D' mark and the
`X' mark.

`d'
     Put the `D' mark.
`M-d'
     Put the `X' mark.
`md'
     Convert all `*' marks to `D'.
`mM-d'
     Convert all `*' marks to `X'.
`x'
     Process marked messages.
`mxd'
     Process messages marked with `D' only.
`mxM-d'
     Delete messages marked with `X' only.
`D'
     Delete all messages in a trash.
`C-uD'
     Delete all messages in a specified folder.

Refile `o'
==========

To refile a message, type `o' and input a folder name, then
`o' is put. A folder is guessed neatly, so most time what you
should to is just type `RET'. For more information, refer to
Refile.

If you type `o' on a message marked with `o', the refile folder is
shown. When typing `x', messages marked with `o' are actually refiled.

Consider that you specify multiple folders and refiles actually. If
your file system has hard link, the message is moved to the first
folder, and hard links are created from the other folders. Otherwise,
the message is moved to the first folder, and it is copied to the
other folders.

If the number of specified folders are 1, and it is the current
folder, refiling means do nothing. If the number is more than two and
the current folder is included, refiling means that the message number
in the current folder remains and hard links are created from the
other folders (or it is copied to the other folders).

Mew provides `c' which is very similar to `o'. `c' shows the current
folder as a candidate in addition to guessed folders.

A summary about the `o' mark is here.

`o'
     Put the `o' mark.
`c'
     Put the `o' mark. Showing the current folder as a candidate in
     addition to guessed folders.
`x'
     Refile messages marked with `o'.
`mxo'
     Refile messages marked with `o' only. This command does not
     process other marks.
`C-umxo'
     Refile messages marked with `o', whose destination is the same as
     that of the current message.

Target `*'
==========

Please put the `*' mark onto messages that you want to review
later. `?' also put the `*' mark onto matched messages (for more
information, refer to search). Use `N' and `P' to walk around
messages marked with `*'.

Here is a summary for `*' commands.

`*'
     Put the `*' mark.
`N'
     Jump to the message marked with `*' below and display it.
`P'
     Jump to the message marked with `*' above and display it.
`ma'
     Put the `*' mark to all unmarked messages.
`mr'
     Put the `*' mark to all matching messages with specified regular
     expression.

The `*' mark is used to handle multiple messages. The following is a
list of commands which handle multiple messages.

`F'
     Prepare a draft to forward multiple messages marked with `*' in
     MIME format.
`J'
     A large message is occasionally fragmented into multiple messages
     whose Content-Type: is Message/Partial. Mew puts the `P' mark to
     these messages. Now a user marks these messages with `*' and
     executing this commands results in producing the original
     message.
`mI'
     Retrieve the rest of truncated(`T') messages marked with
     `*'.
`C-umI'
     Perform `mI'.
`M-b'
     De-capsulate messages embedded in the messages marked with `*'.
`M-\'
     Executing an external command specifying messages marked with `*'
     as arguments.
`M-t'
     Apply "uudecode" on messages marked with `*'.

For `M-t', messages marked with `*' are supposed to be in the right
order. If out of order, sorting with `S' would help.

Escape `$'
==========

Suppose that you want to put the `*' marks to messages matched to a
pattern specified to the `/' command. If there are messages marked
with `*' already, these messages are merged to the results of
`/'. Thus, you would want to escape the current messages marked with
`*'.

For this sake, the escape mark `$' is provided. A typical usage is as
follows:

  1. Change the `*' marks to the `$' marks with `m$'.
  2. Put the `*' marks to messages, for instance, with `/' and process
     the messages marked with `*'.
  3. Cancel the `*' marks with `U*'.
  4. Get the old `*' marks back with `m*'.

Here is summary of the commands related to the `$' mark.

`m$'
     Change the `*' marks to the `$' marks.
`m*'
     Change the `$' marks to the `*' marks.

Deleting marks
==============

Refiling and deleting is not processed unless you type `x'. So, if you
press `u' to unmark before you type `x', messages do not disappear
accidentally.

Here is a summary for unmark commands.

`u'
     Cancel the mark on this message.
`U'
     Cancel all marks according to what you input.

The method with the `$' mark, that is, preserve the `*' marks and
operate something then get them back, is friendly to users since it is
visible. But since messages are marked, they would not be the targets
of the operation.

To solve this problem, a method to recover `*' marks is provided.  The
command is bound to `M*'. This method would not be friendly to users
since the `*' marks to recover are invisible. But because the marks
are canceled, these message are surely the target of any operations.

`M*'
     Recover the `*' marks which are canceled by the last `U*'.

Overwriting marks
=================

Marks have levels of strength. You can override a mark by another
same-level mark weak mark. Also stronger marks can override weaker
marks.

The followings shows the marks in the strong order:

`o', `D', and `X'
     After marking a message newly, the next message is shown. After
     overriding another mark, the cursor stays on the message.
`*' and `$'
     After marking a message, the cursor stays on the message.
`U'
     After marking a message, the cursor stays on the message.

refer to summary-mode to know which direction the cursor moves
after putting a strong mark.

You can exchange marks as follows:

`m$'
     `*' -> `$' :: Preserve the `*' marks temporarily.
`m*'
     `$' -> `*' :: Get the `*' marks back.
`ms'
     `$' <-> `*'
`mM-u'
     `*' -> `U' :: It is useful when you put `U' marks to messages
     picked by `?'.
`md'
     `*' -> `D' :: It is useful when you put `D' marks to messages
     picked by `?'.
`mM-d'
     `*' -> `X' :: It is useful when you put `X' marks to messages
     picked by `?'.
`mo'
     `*' -> `o' :: It is useful when you put `o' marks to messages to
     be moved picked by `?'.  `*' -> `o' :: It is useful when you put
     `o' marks to messages to be copied picked by `?'.
`e'
     Exchange the first input mark to the second one. The `o' mark is
     not exchangeable.

Mark consistency against an IMAP server
=======================================

Mew can maintain consistency of the following marks against an IMAP
server:

`U'
     Whether a message is read or not. This IMAP flag is \Seen. This
     is usually valid in %inbox only.
`*'
     Review mark. This IMAP flag is \Flagged.

To allow off-line operations, Mew synchronizes marks with an IMAP
server everytime when a user makes an action. Mew does not
automatically synchronize marks repeatedly. The followings are how Mew
synchronizes marks.

  1. `s' + 'update
        - Reflecting modified marks of the existing messages to the server
        - For newly arrived messages, reflecting flags of the server
          to the messages.

  2. `x'
        - Reflecting modified marks of the existing messages to the server

  3. `s' + 'sync
        - Reflecting modified marks of the existing messages to the server
        - Clearing `*',`U', `$', ` ' mark on the existing messages.
        - Reflecting flags of the server to the existing messages
        - Removing messages which were deleted in the server

Processing marks off-line for IMAP
==================================

An IMAP user may want to cache messages in folder A and go out. Then
he may want to put the `o' and/or `D' marks, and process the marks
off-line. In this story, these jobs should be done in his IMAP server
after connecting the Internet.

If a message in folder A is moved to folder B with IMAP, the cached
message in folder A usually must be deleted and a corresponding
message in folder B must be retrieved from his IMAP server again. This
is because information embedded in a cached message in folder A is
valid only in folder A.

Suppose you refile a message in folder A to folder B off-line. It is
very inconvenient for you to retrieve a corresponding message in
folder B from your IMAP server , in order to read it, after refile
jobs are done online. You may want to read the messages refiled to
folder B by just going to the folder B, without retrieval form the
IMAP server.

Mew implements delayed jobs processing and viewing refiled messages
without retrieval. If you want to process marks off-line, type `lx'.
`lx' carries out the following jobs.

  1. Deleting messages marked with `o' and/or `D' from folder A.
  2. Queuing these jobs in %queue.
  3. Moving messages marked with `o' to folder B and marking them
     invalid.

'invalid' means that you can read it but you cannot put the `o'/`D'
mark on it. Invalid messages are marked with `#'. When you go to
folder B by typing `g', a list of invalid messages is displayed
automatically.

If you want to let your IMAP server process jobs in %queue after you
get back online, type `C-cC-c' in %queue.

Typing `s' in folder B after jobs in %queue are done in your IMAP
server results in deletion of invalid messages and caching valid
messages.

Marks displayed by Mew
======================

Here is a summary of marks displayed by Mew.

`M'
     This message is a multipart. Please refer to multipart.
`-'
     This message contains a Multipart/Alternative content. Please refer to
     analysis.
`T'
     This message was truncated by Mew. Please refer to
     retrieving.
`S'
     This message is signed. Please refer to cipher-viewing.
`E'
     This is a cipher message. Please refer to cipher-viewing.
`P'
     This message is fragmented. Please refer to target mark.
`#'
     This message is invalid. Please refer to off-line.

Happy refiling
**************

When you come to receive hundreds of messages in a day (do not you
believe it?), refiling messages becomes a very tough job. Mew neatly
guesses default folders where the message is supposed to be refiled
when you type `o'. You can see an example below.

     Folder name (+work/mew-dist): +

If the default value in () is proper, just type `RET'. The messages
will be marked with `o' if its refiling folders are decided.

You can refile a message to folders of the same world to which the
message belong. As described above, a world is identified by a
combination of "case" and proto. When you input a folder to which the
message is refiled, you must not specify "case" and you must input a
folder whose proto is the same. The reason why you must not specify
"case" is that the "case" is already known. With other commands, you
have to specify the "case", if necessary, when you input folder name
in minibuffer. This command is only the exception.

Mew also provides `c' which is very similar to `o'. To know the
difference, please refer to refile mark.

As you know, the more excellent refiling guess algorithms become, the
less user's job troublesome. Mew provides you with the following
rules.

Guess by mailing-list folders
=============================

Many users tend to refile messages destined to a mailing-list to a
folder whose name is the same as the mailing-list. Mew provides a
mechanism to guess a mailing-list folder for messages destined to
mailing-lists.

Suppose that you have a folder named +misc/pooh-lovers. The following
message is probably to be refiled to this folder.

     To: pooh-lovers@example.org

Likewise, Mew searches a matching folder forward with addresses on To:
and Cc:. There are many people who do not use recursive folders. With
Mew, however, you would not be smart if you do not use it.

Smart users may wonder that they get a trouble in the following
situation where private addresses are on To: or Cc:.

     To: piglet@example.org
     Cc: pooh-lovers@example.org

Since Pooh is a member of pooh-lovers, he receives this message. But
he has a folder for his friend, Piglet. So, +from/piglet may be
chosen.

To avoid this, Mew allows you to specify which folders are to be
ignored. The default is +from. So, please take a convention to refile
personal messages under +from.

When Mew guesses a candidate by the folders, it asks you:

     Folder name (+misc/pooh-lovers): +

Just type `RET' if the default is exactly what you want.

If you specify a new folder with `o', the folder is created and added
to the folder list to be used for guess. Convenient, isn't it?

The function name to provide this feature is
`mew-refile-guess-by-folder'.

If you don't use capital letters for folder names, configure as
follows to make this function faster:

     (setq mew-use-fast-refile t)

By default, candidate includes node folders as well as leaf folders.
If you want to not select node folders but leave folders only,
configure as follows:

     (setq mew-use-node-folder nil)

Guess by user defined rules
===========================

There are some cases where the refile guess mechanism by folders does
not work as you wish. For example, for both a message whose To: is
staff@example.jp and another message whose To: is staff@example.net,
the same folder would be selected with guess by folders
(e.g. "+net/staff"). So, Mew allows you to define your own rules
explicitly. (You must use the new format for
`mew-refile-guess-alist'.  For more information, see

Let's look at an example.

     (setq mew-refile-guess-alist
       '(("To:"
           ("staff@example.jp"  "+jp/staff")
           ("staff@example.net" "+net/staff"))))

This means that if To: contains staff@example.jp +jp/staff is selected
and if To: has staff@example.net +net/staff is chosen.

The format of this rule is as follow:

     rule ::= '<rule>
     <rule> ::= ((<key> <alist>) (<key> <alist>) ... [<special>])

The whole is a list of (<key> <alist>). A field name is specified for
<key>. The format for <alist> is as follows:

     <alist> ::= (<value> <folder>|<rule>) (<value> <folder>|<rule>) ...

<value> is a field value for <key>. <folder> means a folder to be
chosen if matched. You can write <rule> recursively instead of
<folder>.  (see config2.)

There are two special <key>s: `nil' and `t'. `nil' is used to specify
<folder> to be returned when nothing is guessed. `t' can specify
<folder> to be returned in addition to guessed values.

     <special> ::= (t <folder>) | (nil <folder>)

If you know regular expression, a more advanced rule can be defined
like this.

     (setq mew-refile-guess-alist
       '(("Newsgroups:"
         ("^nifty\\.\\([^ ]+\\)" "+Nifty/\\1")
         (".*"                   "+rec/news"))
        ("To:"
         ("\\(inet\\|wide\\)@wnoc-fuk" "+wide/\\1-wnoc-fuk"))
        ("From:"
         ("uucp@"    "+adm/uucp")
         ("ftpsync@" "+adm/ftpsync"))
        (nil "+unknown")))

The function name to provide this feature is
`mew-refile-guess-by-alist'.

Guess by thread
===============

Mew provides a mechanism to guess a folder where the parent message of
a current message was refiled before.

For example, Pooh, Piglet, and Roo had a chat to go and get honey. So,
Pooh made +project/honey then refiled the message to it. The further
messages, if they are properly replied, they are supposed to be
refiled to +project/honey.

Information that which folder was chosen for messages is stored to
"~/Mail/.mew-refile-msgid-alist". `mew-lisp-max-length'
controls the amount of this information. The default value is 2000
messages. If you want limits it to 3000 messages, put the following to
"~/.mew.el".

     (setq mew-lisp-max-length 3000)

The function name to provide this feature is
`mew-refile-guess-by-message-id'.

Guess by private folders
========================

In addition to the mechanism to select a mailing-list folder described
in by-folder, Mew provides a mechanism to choose a private
folder. Since private folders locate under +from, we can say that this
mechanism select a folder from the folders under +from. Let's see the
following example:

     To: pooh@example.net
     From: piglet@example.org

Pooh received a message from Piglet. If Pooh uses this mechanism,
+from/piglet will be chosen according to From:. (Folders under +from
can be recurse. And you can select the entire address for a folder
name instead of the user part.)

The function to provide this feature is
`mew-refile-guess-by-from-folder'.

Next, let's consider a care where Pooh replied to Piglet. Since Pooh
Cc:ed the message to himself, the message was also delivered to him.

     To: piglet@example.org
     Cc: pooh@example.net
     From: pooh@example.net

How do you feel if you are Pooh? You may want to refile this to
+from/pooh. Also, you may want to move this to +from/piglet. So, it
can be customized.

If `mew-refile-guess-from-me-is-special' is `t' and if an address in
From: is yourself, `mew-refile-guess-by-from-folder' select a folder
under +from according to To: and/or Cc:.

Guess by From:
==============

Mew also provides a mechanism to guess a folder by the place where a
message that has the same From: field is refiled.

Suppose that Piglet has two addresses, piglet@example.org and
p-p-p@example.org. Pooh wants to refile messages from Piglet to
+from/piglet no matter what his From: is. This policy can, of course,
be implemented if Pooh specifies rules explicitly as follows:

     (setq mew-refile-guess-alist
       '(("From:"
           ("piglet@example.org" "+from/piglet")
           ("p-p-p@example.org"  "+from/piglet"))))

But such a work may bother you. So, first refile a message whose From:
is piglet@example.org to +from/piglet. At this time, +from/piglet is
created. Next, refile a message whose From: is p-p-p@example.org to
+from/piglet. Here Mews learns that p-p-p@example.org was refiled to
+from/piglet. After this, when messages whose From: is
p-p-p@example.org are refiled, +from/piglet is chosen.

For another example, you can refile messages from machinery to
+adm/misc without defining an explicit rule.

Information for relationship between From: and folder is stored to
"~/Mail/.mew-refile-from-alist". `mew-lisp-max-length'
controls the amount of this information as the same as
by-thread.

The function name to provide this feature is
`mew-refile-guess-by-from'.

If the value of `mew-refile-guess-from-me-is-special' is `t',
`mew-refile-guess-by-from' acts as
`mew-refile-guess-by-from-folder' (see by-from-folder).

Guess by Newsgroups:
====================

For those who read articles of NetNews received by e-mail with Mew,
Mew provides a mechanism to guess a folder by Newsgroups:. The
function name to provide this feature is
`mew-refile-guess-by-newsgroups'.

Guess by default rule
=====================

The default rule is to extract a user name from From: and to choose
`+from/user'. But if `mew-refile-guess-strip-domainpart' is
`nil', it extracts the entire address. So,
`+from/user@domain' is chosen. The default value of
`mew-refile-guess-strip-domainpart' is `t'.

The function name is `mew-refile-guess-by-default'.

Controlling rules
=================

Mew controls guess rules by two variables,
`mew-refile-guess-control' and `mew-refile-ctrl-multi'. If you
want multiple candidates, set `mew-refile-ctrl-multi'
`t'. Otherwise, set it `nil'.

By default, `mew-refile-guess-control' is declared as follows (since
it is a declaration, `defvar' is used):

     (defvar mew-refile-guess-control
       '(mew-refile-guess-by-alist
         mew-refile-ctrl-throw
         mew-refile-guess-by-newsgroups
         mew-refile-guess-by-folder
         mew-refile-ctrl-throw
         mew-refile-ctrl-auto-boundary
         mew-refile-guess-by-thread
         mew-refile-ctrl-throw
         mew-refile-guess-by-from-folder
         mew-refile-ctrl-throw
         mew-refile-guess-by-from
         mew-refile-ctrl-throw
         mew-refile-guess-by-default))

Mew executes every function defined in `mew-refile-guess-control' in
order. Each function may guess multiple candidates.

Let's see the following example of `mew-refile-guess-control' action.

`mew-refile-guess-by-alist'
         guessed +aaa and +bbb.
`mew-refile-guess-by-folder'
         guessed +ccc and +ddd.
`mew-refile-guess-by-default'
         guessed +eee.

If you want to provide all candidates, +aaa - +eee, set
`mew-refile-ctrl-multi' `t'. If you want to provide +aaa only, set it
`nil'.

If you want +aaa - +ddd but do not want left candidates, in other
words, you want +eee only when no candidate is guessed by functions
executed before, set `mew-refile-ctrl-multi' `t' and insert
`mew-refile-ctrl-throw' between `mew-refile-guess-by-folder' and
`mew-refile-guess-by-default'.

`C-uo' displays the flow of guess rules in Message buffer.

Auto refile
===========

Those who receives many messages everyday is prone to store thousands of
messages in the +inbox (or %inbox) folder. In such a case, they may want
to speak out like this, "Hey messages, get out of the folder to
somewhere". Mew provides a feature to satisfy such laziness. :)
`M-o' is the spell.

When you execute this function, it marks specific messages with
`o'. The specific messages mean messages which are not marked
with `o' nor `D' if
`mew-refile-auto-refile-skip-any-mark' is `nil'. If
`mew-refile-auto-refile-skip-any-mark' is `t', they mean
non-marked messages (i.e. read). The default value of
`mew-refile-auto-refile-skip-any-mark' is `nil'.

`C-uM-o' targets messages marked with `*' regardless the value of
`mew-refile-auto-refile-skip-any-mark'.

Refile rule is the same described in the previous section. Please note
that what this function does is just mark messages with
`o'. Messages are not refiled until you will press `x'.

Mew's refile mechanism is so smart that it would be harmful for this
function. That is, most users would not understand where messages have
been refiled if Mew made most use of its guess mechanism. :) For this
reason, break is provided to limit usage of guess functions. Recall
the declaration up above.

     (defvar mew-refile-guess-control
       '(mew-refile-guess-by-alist
         mew-refile-ctrl-throw
         mew-refile-guess-by-newsgroups
         mew-refile-guess-by-folder
         mew-refile-ctrl-throw
         mew-refile-ctrl-auto-boundary
         mew-refile-guess-by-thread
         mew-refile-ctrl-throw
         mew-refile-guess-by-from-folder
         mew-refile-ctrl-throw
         mew-refile-guess-by-from
         mew-refile-ctrl-throw
         mew-refile-guess-by-default))

You can find the `mew-refile-ctrl-auto-boundary' function in
`mew-refile-guess-control'. Only when auto refile is used, Mew
ignores guess functions below this function. If guess functions above
`mew-refile-ctrl-auto-boundary' didn't guess any folder for a
message, the message is not marked with `o'. Insert
`mew-refile-ctrl-auto-boundary' before you ruin.

Copying messages across worlds
==============================

"Refile" described above is moving messages in the same world. By
contrast, you may want to move messages from a world to another
world. You can accomplish this by copying messages from a world to
another and deleting the original messages. Here we describe how to
copy messages to another world.

You may want to copy a message to a local folder. For this, type
`lc'. If you execute `lc' in a remote folder, Mew removes information
related to the remote folder from the cached message and copy it to a
local folder. (You can use `lc' in a local folder, too. In this case,
a message is moved in the same world.)

To opy a message in a folder to an IMAP folder (the server side), type
`li'.

To copy messages marked with `*' to a local folder, use `mlc'.  To
copy messages marked with `*' to an IMAP folder, use `mli'.

Here is a summary of commands which copy messages from a world to
another.

`lc'
     Copy a message to a local folder.
`mlc'
     Copy messages marked with `*' to a local folder.
`li'
     Copy a message to the server side of IMAP.
`mli'
     Copy messages marked with `*' to the server side of IMAP.

Virtual folder
**************

Virtual mode is a virtual folder and it consists of "selection" and
"thread".

`Selection'
     A virtual folder collecting necessary messages from several
     folders.  Its folder name has "*" on the left side.
`Thread'
     A virtual folder to visualize message flow with indentation,
     created from a folder or a virtual folder. Its folder name has
     "*" on the both sides.

In Virtual mode, you can use most commands that you can find in
Summary mode.

If you put a mark on a message in Virtual mode and if corresponding
Summary mode exists, the mark is also put onto the corresponding
message there.  But if you put a mark on a message in Summary mode,
the mark is not put any corresponding messages in Virtual mode.

You cannot process marks in Virtual mode. Even if you type `x' to
process marks in Virtual mode, the cursor moves to corresponding
Summary mode, if exsists, and you are asked to type `x' again.

You should take note that Virtual folder is really virtual and it does
not exist in file system. If you exit Mew, it then disappears.  To
know how to delete Virtual mode, please refer to Quit.

Selection
=========

Selection is a virtual folder collecting necessary messages from
several folders. There are five ways to create selection:

`m/'
     Listing messages marked with `*' on a folder. see
     sorting.
`S'
     Sorting messages on a folder and display them. (No effect to the
     original folder.) see dialog.
`V'
     Listing messages which have relationship with the current message. See
     dialog.
`/'
     Listing messaged matched to a search condition on a folder. see
     search.
`k/'
     Listing messaged matched to a search condition from all folders. See
     search.

Sorting
=======

To make selection by sorting messages, use `S'. Then you will be asked
to input the field name as follows:

     Sort by? (default date):

There are some cases where strings stored in the specified field
should not be compared as text. For example, while Subject: can be
considered as text, Date: and X-Mail-Count: should be treated as date
and number, respectively. In this way, we call the distinctions in
methods of string sorting "modes". Default modes for typical field
names are configured in `mew-sort-key-alist'.

When you want to specify the mode of sorting, the mode is followed by
`:'. For example, to sort with the X-Mail-Count: field as arithmetic
value (not text), input like this:

     x-mail-count:num

You can complete field names and modes with `TAB'.

Mew provides four modes for sorting:

`text'
     String with preceding "Re: " and or "Fw: " removed.
`ml'
     The same as text but preceding mailing-list-string removed.
`num'
     Number.
`date'
     Date.

The default field name, your response to the prompt "Sort by?", can be
specified in `mew-sort-default-key'. The following example changes the
default value from "date" to "x-ml-count".

     (setq mew-sort-default-key "x-ml-count")

You can also set a default field name for each folder by
`mew-sort-default-key-alist'. For folders not explicitly specified
here, `mew-sort-default-key' is used for their default field name.
The following is an example that specifies "subject" for the +inbox
folder and "x-mail-count" for the +mew-dist folder.

     (setq mew-sort-default-key-alist
           '(("+inbox" "subject")
             ("+mew-dist" "x-mail-count")))

To really sort messages in a local folder, use `M-s'. This command is
not available in remote folders.

Dialog
======

Mew can list messages which have relationship with the current
message. Let's call this "dialog". This is different from thread
described later in the following points:

   - Thread can be made from one folder or one virtual
     folder. Messages relating to dialog can ubiquitously exists in
     several folders.

   - Thread visualizes tree structres with indentation. while dialog
     lists up messages in order of time.

To use the feature of dialog, execute `kI' to create database. New
messages are not automatically registered in to the database, you
should periodically execute `kI'. `kI' updates the database
incrementally by default. This method is fast but garbages are
left. So, sometime you should type `C-ukI' to update the database
fully.

To make dialog, type `V' on the current message. This command displays
him, his ancestors, and his children only. His brothers and so on are
not shown. If you display the entire of the family, type `V' again on
the first message of the dialog, which is the origin of the family.

Searching
=========

Mew provides the following method to search messages:

`?'
     Put the `*' mark onto messages in this folder, which are matched
     to a specified pattern. Either `mewl' or `grep' is called
     according to the specified pattern.
`C-u?'
     `?' with a region specified.
`/'
     Make selection with messages in this folder, which are matched to
     a specified pattern. Either `mewl' or `grep' is called according
     to the specified pattern.
`C-u/'
     `/' with a region specified.

We can also search messages with a search engine, including Spotlight,
Windows Desktop Search, etc. This feature is supported by the
following commands.

`k?'
     Put the `*' mark onto messages in this folder, which are matched
     to a specified pattern.
`k/'
     Make selection with messages in all folders, which are matched to
     a specified pattern.
`C-uk/'
     Make selection with messages in specified folders, which are
     matched to a specified pattern. If you want to specify multiple
     folders, separate them with ",". You can also use a wildcar "*".

How to input search conditions
==============================

If you type `?' or `/', Mew asks you to input search pattern as
follows:

     mewl/grep pick pattern:

If you specify just a keyword, Mew executes `grep'.  On the contrast
if you type an expression, Mew calls `mewl'.

Here is a list of expression elements. (In the strong order)

`field=string'
     Match if the "field" field contains the "string" string
     (case-insensitive). If you specify "head", it means the entire
     header.
`field==string'
     Match if the "field" field contains the "string" string
     (case-sensitive). If you specify "head", it means the entire
     header.
`field!=string'
     Match if the "field" field does not the "string" string
     (case-insensitive). If you specify "head", it means the entire
     header.
`field!==string'
     Match if the "field" field does not the "string" string
     (case-sensitive). If you specify "head", it means the entire
     header.
`( <pattern> )'
     Evaluate <pattern> first.
`! <pattern>'
     Match if not <pattern>.
`<pattern1> & <pattern2>'
     Match if <pattern1> AND <pattern2>. You can omit this.
`<pattern1> | <pattern2>'
     Match if <pattern1> OR <pattern2>.

Some examples are shown below.

(a) Messages whose From: contains "kazu".

     from=kazu

(b) Messages whose To: contains "mew" OR Cc: contains "mew".

     to=mew | cc=mew

(c) Messages whose To: contains "mew" OR Cc: contains "mew" AND From:
contains "kazu".

     (to=mew | cc=mew) & from=kazu

When you execute `?' or `/' and if you just type `RET' to a pattern,
you can specify a command to be executed.

     Cmd opts pattern: grep -l -e

When you use an search engine with `k?' or `k/', the pattern
(including just a keyword and an expression) will be converted to the
syntax of the search engine.

For example, you can write an expression, that From: is "kazu" and
body contains "wine" but does not contain "bordeaux", as follows:

     from=kazu wine ! bordeaux

If you set `mew-pick-pattern-list' to a list of pattern, you can enjoy
circular completion with `C-cTAB'. In this case, the first member is
displayed as a default value.

Search Engine
=============

To operate search engines, the following commands are provided:

`km'
     Make index for the current folder.
`kM'
     Make index for all folders.
`kc'
     Switch one search engine to another.

The followings are expiation of each search engines.

`Hyper Estraier'
     Type `kM' periodically. It's OK to execute "mewest" on the
     command line instead. If you want to update the index for the
     current folder quickly, you can use `km'. Both `k?' and `k/' are
     available. When you specify folders with `C-uk/', sub-folders, if
     any, are included in the target.
`Spotlight'
     Type `kM' just once. `km' is not necessary. Both `k?'  and `k/'
     are available.
`Windows Desktop Search'
     Type `kM' just once. `km' is not necessary.
`Google Desktop'
     Type `kM' just once. `km' is not necessary. Only `k/' is
     available.

The default search engine is automatically set to the one found first.
If you explicitly specify it, set `mew-search-method' to one out of
'est, 'spotlight, 'wds, and 'google. The following is an example to
choose Hyper Estraier.

     (setq mew-search-method 'est)

Highlighting a keyword
======================

The keyword which you specified on search is shorted in a buffer. You
can display messages with the keyword highlighted. The commands to
enable this functionality are as follows:

`M-n'
     Display a message in the forward direction and find a keyword and
     highlight it. In Summary mode, the target is messages marked with
     `*'. In Virtual mode, it is all messages. If you repeat this
     command, text around the keyword is displayed from one to
     another. If no key word is set to the variable, this command
     first asks you a keyword.
`C-uM-n'
     The same as `M-n' except that you can change the stored keyword
     explicitly.
`M-p'
     A reverse version of `M-n'.
`C-uM-p'
     A reverse version of `C-uM-n'.

Thread
======

When in the process of exchanging messages, the relationship of the
messages is presented in a tree structure. Visualization of the
structure with indentation is called thread. Here is an example:

       03/12 Hidenori Ohta  This weekend              |Let's go to StoneMagic
       03/13 Kazu-kun        +Re: This weekend        |Since it'll be rainy,
       03/15 Hidenori Ohta   | +Re: This weekend      |OK. Get together at 12
       03/14 Oda-chan        +Re: This weekend        |Sounds lovely. I'd lik

The thread feature is implemented as virtual folder. For instance, if
you make threads for +inbox, a buffer *+inbox* is prepared.

To make thread, the following commands exist.

`tt'
     Make threads from Summary mode or selection and move the cursor
     to the current message. If corresponding threads already exist,
     switch to the Virtual mode. When this command is executed on
     threads, switch to the original folder and move the cursor to the
     current message.
`C-utt'
     Make threads for messages in the region.
`mt'
     Make threads for messages marked with `*'.
`tr'
     Make threads for messages matched to a regular expression.

Thread operations
=================

Here are the commands used for moving to thread presentation.

`tp'
     Move to the top of the current thread. If the current message is
     a top node, move to the top of the next thread.
`tn'
     Move to the top of the next thread.
`^'
     Move to the parent message of the current message. (Available in
     both Summary and Virtual)
`&'
     Move to the child message of the current message. (Available in
     both Summary and Virtual)
`('
     Search backward by one sibling message of the current message.
`)'
     Search forward by one sibling message of the current message.

Here are commands to mark messages in a thread.

`t*'
     Put the `*' mark all messages of the current sub-thread. Please
     refer to target mark for more information.
`t$'
     Put the `$' mark all messages of the current sub-thread. Please
     refer to escape mark for more information.
`td'
     Put the `D' mark all messages of the current sub-thread. Please
     refer to delete mark for more information.
`tM-d'
     Put the `X' mark all messages of the current sub-thread. Please
     refer to delete mark for more information.
`to'
     Put the `o' mark all messages of the current sub-thread. Please
     refer to refile mark for more information.

A command to unmark all messages of the current sub-thread is `tu'.

Here are commands to manipulate a thread:

`tSPC'
     Hide children and leave the parent only. If its children are
     hidden, "+" is displayed on the parent. Also, if this command is
     executed on a message whose children are hidden, they appear.
`ta'
     Toggle appearance of children for all threads.
`tg'
     Graft a thread to a message. To specify which thread is grafted,
     type `C-SPC' on the root of the thread. Then move onto your
     target message, and typing `tg' grafts the thread to the target
     message as children.

If `mew-use-thread-separator' is `t', threads are
distinguished by a separator defined by `mew-thread-separator'
(its default value is "--").

Give me a break
***************

Here are how to quit and suspend Mew and how to erase a mode (buffer).

<Summary mode and Virtual mode>

`q'
     Suspend Mew then switch to another buffer. All buffers of Mew
     remain, so you can resume with buffer operations.
`Q'
     Quit Mew. All buffers of Mew are erased.
`C-cC-q'
     Erase the current mode (buffer).

<Draft mode and Header mode>

`C-cC-q'
     Erase the draft.

<Addrbook mode>

`C-cC-q'
     Erase the buffer.

Customizing Mew
***************

Here are explained how to change default setting of Mew and make Mew
your favorite. Edit "~/.mew.el" to do it!

Summary mode
============

You can specify the format of Summary mode by `mew-summary-form'.  The
default value is as follows:

     (setq mew-summary-form '(type (5 date) " " (14 from) " " t (30 subj) "|" (0 body)))

Like this, `mew-summary-form' is a list of list, symbol, and string.

  1. A string is printed as it is.
  2. A list consists of an integer and a symbol. The symbol specifies
     a function to be called. The name of the function is produced by
     concatenating "mew-summary-form-" and the symbol name.
     (e.g. `mew-summary-form-date' for the symbol 'date'). Pre-defined
     symbols are 'type, 'time, 'date, 'year, 'size, 'from, 'subj and
     'body. For more details, see the explanation of the functions
     called `mew-summary-form-<symbol>'. The integer specifies the
     width of field which will be filled with a return string of the
     function. A positive value means padding SPCs on the right if
     necessary. A negative value means padding SPCs on the left if
     necessary. If a negative value is specified, the corresponding
     function must return an ASCII string. 0 means the remaining width
     of the line and is treated as a positive value.
  3. A symbol is equivalent to (1 symbol).
  4. '(mark) is appended to `mew-summary-form' when used.
  5. `t' means the position of thread indentation.

An example is as follows:

     (setq mew-summary-form
           '(type (5 date) " " (-4 size) " " (14 from) " " t (30 subj) "|" (0 body)))

`mew-summary-form-from-me-prefix' is the prefix to be prepend to an
destination address if the message is originated by me. The default is
"To:".

`mew-summary-form-extract-rule' is a list to specify what part to
extract from the From: field. Each element must be 'name, 'comment,
'address, 'nickname, or appropriate "regex". The default value is
'(nickname).

Consider the following examples:

     A: Kazu Yamamoto <kazu@example.org>
     B: kazu@example.org (Kazu Yamamoto)
     C: Kazuhiko Yamamoto (Kazu) <kazu@example.org>

Each element returns the following value:

  1. 'name:: Name part, if any
          A. Kazu Yamamoto
          B. (No match)
          C. Kazuhiko Yamamoto (Kazu)
  2. 'comment:: Comment part, if any
          A: (No match)
          B: Kazu Yamamoto
          C: (Kazu)
  3. 'address:: Address part
          A: kazu@example.org
          B: kazu@example.org
          C: kazu@example.org
  4. 'nickname:: one element of personal information in Addrbook
     according to `mew-addrbook-for-summary'. The default value of
     `mew-addrbook-for-summary' is `'nickname'. So, From: is converted
     a nickname by default. To know what kind of value can be used,
     refer to draft-mode.
  5. (regex):: The substring first matched.

If a element does not match, the next element is applied. If no
element matches to the From: field, or this value is `nil', the whole
of the From: field is used.

If `mew-summary-form-mark-delete' is `t', the `D' mark
automatically is put onto duplicated messages. The default is
`nil'.

If `mew-summary-form-mark-spam' is `t', the `D' mark automatically is
put onto SPAM messages. A message is considered a SPAM message if the
MD5 checksum of its body is duplicated in a scan. The default is
`nil'.

If `mew-summary-form-mark-review' is `t', the `*' mark
automatically is put onto messages destined to me. The default is
`nil'.

If you want to use Mew with full Emacs frame, set like this.

     (setq mew-use-full-window t)

`SPC' in Summary mode decide the next action to view a message
according to `mew-summary-show-direction'. Likewise, you can specify
the cursor direction after putting a strong mark by
`mew-summary-mark-direction'. You can select one from the following
candidates.

`up'
     Display the message above.
`down'
     Display the message below.
`next'
     Display the next message in the direction.
`stop'
     Do not display the next message.

The default value for both is `next'. If you read messages from the
bottom, set as follows:

     (setq mew-summary-show-direction 'up)

Message mode
============

It is impossible to display a file to the Message buffer if its data
type is not supported by Emacs. Install an external program which
converts the data to text and you can display the file to the Message
buffer.

Text/Html can be displayed in Message mode, if you add the following
to "~/.mew.el".

     (setq mew-use-text/html t)		; decode HTML for all folders

With this, Text/Html can be displayed in Message mode as if it were
Text/Plain. Even in this situation, `C-cC-e' described below is a
valid operation.

By default, Text/Html is displayed using Emacs's built-in HTML
renderer.

Alternatively, you can display Text/Html using the w3m browser.
First, install "w3m" and "emacs-w3m".
(Please note that multilingualized "w3m", not pure
"w3m", is necessary for "wvHtml", "xlhtml", and "ppthtml"
described below.)  When you install both of them, add the following to
"~/.mew.el".

     (condition-case nil
         (require 'mew-w3m)
       (file-error nil))

If you install "wvHtml", "xlhtml", and "ppthtml", you can display text
parts of WORD, Excel, and PowerPoint file in Message,
respectively. Since these commands uses HTML, the configuration of
Text/Html above is required. With this, a WORD file, for example, can
be displayed in Message mode as if it were text.

You can display the file with an external application itself instead
of displaying it in the Message buffer. For this, type `C-cC-e'.

You can visualize an image file into the Message buffer. Also, you can
display it with an external application by typing `C-cC-e', of course.

You can display an HTML file to a browser with `C-cC-e'. A default
browser is used on Windows and Mac. On Unix, "mozilla" is set to a
default browser as follows:

     (defvar mew-prog-text/html-ext '("mozilla" ("-remote" "openFile(%s)") t))

If you want to set it to "firefox", for example, configure like this:

     (setq mew-prog-text/html-ext
           '("firefox" ("-a" "firefox" "-remote" "openFile(%s)") t))

You can visualize an Office-family file to each application by typing
`C-cC-e'. On Windows and Mac, an Office-family application is
executed. On Unix, "soffice" is set to the default application as
follows:

     (defvar mew-prog-msword-ext "soffice")
     (defvar mew-prog-msexcel-ext "soffice")
     (defvar mew-prog-mspowerpoint-ext "soffice")

If you want to set it to "xdg-open", for instace, do like this:

     (setq mew-prog-msword-ext "xdg-open")
     (setq mew-prog-msexcel-ext "xdg-open")
     (setq mew-prog-mspowerpoint-ext "xdg-open")

If you want to not visualize an Office-family file into the Message
buffer, but want to display it with "wvHtml", configure as follows:

     (setq mew-prog-msword  '(nil mew-mime-application/msword))
     (setq mew-prog-msexcel '(nil mew-mime-application/msexcel))
     (setq mew-prog-mspowerpoint '(nil mew-mime-application/mspowerpoint))

If you want to specify an application instead of the pre-defined
application, type `C-uC-cC-e'.

Recently there are many message whose have Multipart/Alternative,
which consists of Text/Plain and Text/Html. By default, Mew selects
Text/Plain. If you prefer to choose
Text/Html, add the following to "~/.mew.el". (Now, it's a
good idea to get back to multipart to review how to use
`:'.)

     (setq mew-mime-multipart-alternative-list
           '("Text/Html" "Text/Plain" ".*"))

You can decrypt a ZIP attach file and display it with `zz'.

Draft mode
==========

Define `mew-cc' to use Cc:. When replying, another Cc: field may be
prepared from the target message. If there are multiple Cc: fields,
they are combined to one field on sending.

If you want to receive your originating messages for backup without
specifying your address, use Dcc:. Set your address to `mew-dcc'.

Set header fields that you want to insert every time when you write
messages to `mew-header-alist' as an associate list. The following is
an example.

     (setq mew-header-alist
           '(("X-fingerprint:" "6B 63 38 88 67 5E 96 8E  CE A4 62 73 3F 11 64 94")
             ("X-URL:" "http://www.example.org/~kazu/")))

To customize citation label, define field to cite in `mew-cite-fields'
and format in `mew-cite-format'. Define citation prefix to
`mew-cite-prefix'. The default declaration is as follows:

     (defvar mew-cite-fields '("From:" "Subject:" "Date:"))
     (defvar mew-cite-format "From: %s\nSubject: %s\nDate: %s\n\n")
     (defvar mew-cite-prefix "> ")

To add Message-ID: to citation label, take this way.

     (setq mew-cite-fields '("From:" "Subject:" "Date:" "Message-ID:"))
     (setq mew-cite-format "From: %s\nSubject: %s\nDate: %s\nMessage-ID: %s\n\n")

To add a user part of an address to the citation prefix, configure as
follows:

     (setq mew-cite-prefix-function (function mew-cite-prefix-username))

With this, the citation prefix becomes like this:

     From: SUMIKAWA Munechika <sumikawa@ebina.hitachi.co.jp>
     Subject: Wine
     Date: Wed, 23 Jul 1997 11:40:50 +0900

     sumikawa> Hi, it's Sumikawa, the guy who's neat from good morning
     sumikawa> to good night.
     sumikawa>
     sumikawa> Talking about the wonderful wine party, I would propose
     sumikawa> Cabernet Sauvignon, Bordeaux, '90.

Both an address in the citation label and the citation prefix can be
converted to an element of a personal information in Addrbook. They
can be configured by `mew-addrbook-for-cite-label' and
`mew-addrbook-for-cite-prefix', respectively. The default values are
`nil' and `'username', respectively. You can set out of the following
values.

'shortname
     Short name
'address
     Address
'username
     User part of address
'nickname
     Nickname
'name
     Full name

Let's consider the following example.

     (setq mew-addrbook-for-cite-label 'nickname)
     (setq mew-addrbook-for-cite-prefix 'nickname)

With the first line, an address in the citation label is replaced with
its nickname. The second line indicates that the cite prefix is
replaced with its nickname.

     From: sumitch
     Subject: Wine
     Date: Wed, 23 Jul 1997 11:40:50 +0900

     sumitch> Hi, it's Sumikawa, the guy who's neat from good morning
     sumitch> to good night.
     sumitch>
     sumitch> Talking about the wonderful wine party, I would propose
     sumitch> Cabernet Sauvignon, Bordeaux, '90.

Character set
=============

As described in charset-guess, Mew automatically chooses an
appropriate charset for the message when composing.

If characters of multiple languages exist, and if it is necessary to use
an international charset, `mew-charset-m17n' is used. Its default
value is "utf-8" (equivalent to Unicode). If you want to set it to
"iso-2022-jp-2", configure like this:

     (setq mew-charset-m17n "iso-2022-jp-2")

If you want to check a chosen charset when composing, configure
`mew-ask-charset'.

`nil'
     Not ask.
`A list of charset'
     Ask if the charset is not a member of the list.
`t'
     Ask if `mew-charset-m17n' is used.

For instance, if you want to check when charset other than US-ASCII,
ISO-8859-1, and ISO-8859-15, configure like this:

     (setq mew-ask-charset '("us-ascii" "iso-8859-1" "iso-8859-15"))

For example, when "utf-8" is chosen for a message with this
configuration, you are asked like this:

     utf-8 is used. OK? (y or n)

Typing `y' makes the composed message sent (or queued). If you type
`n', you will go back to the original draft.

In Europe Latin 9 (ISO-8859-15 or Latin 0), which includes the euro
sign, is getting more and more popular instead of Latin 1
(ISO-8859-1). If characters of both Latin 1 and Lain 9 exist in a
draft, Mew takes the following step to decide a charset.

  1. If `unify-8859-on-decoding-mode' is used:
       1. Use "iso-8859-1" if no loss.
       2. Otherwise, use "utf-8".
  2. If `unify-8859-on-decoding-mode' is not used:
       1. If both ISO-8859-1 and ISO-8859-15 can be used with no loss,
          "ISO-8859-1" is used.
       2. Use "iso-8859-1" if no loss.
       3. Use "iso-8859-15" if no loss.
       4. Otherwise, use "utf-8".

The default value of `mew-charset-latin' is "iso-8859-15". If you want
to set it to "iso-8859-1", configure like this:

     (setq mew-charset-latin "iso-8859-1")

If you want to always use UTF-8 for any characters other than
US-ASCII, configure as follows:

     (setq mew-cs-database-for-encoding
           `(((ascii) nil "7bit" "7bit")
             (nil utf-8 "base64" "B")))

Highlighting
============

If `mew-use-highlight-mark' is `t', marked message are
highlighted. The default is `t'.

If `mew-use-highlight-header' is `t', the header of a message is
highlighted. The default is `t'.

If `mew-use-highlight-body' is `t', the body of a message is
highlighted. The default is `t'. The limit to be highlighted can be
set by `mew-highlight-body-max-size'. The default is 10000 bytes.

If `mew-use-highlight-url' is `t', a spell is cast to URL strings in a
message. So, when you move the cursor onto the URL, it is
highlighted. The default is `t'.

If `mew-use-cursor-mark' is `t', the mark specified `mew-cursor-mark'
is putted to the beginning of the current line.  The default is
`nil'. The default of `mew-cursor-mark' is ">".

If `mew-use-highlight-cursor-line' is `t', underline is put on the
cursor line in Summary mode. The default is `t'.

If `mew-use-highlight-mouse-line' is `t' on Emacs which supports mouse
highlight, the mouse line is painted in Summary mode. This is very
convenient to read messages clicking the middle button of the
mouse. The default value is `nil'.

If `mew-use-highlight-x-face' is `t', X-Face: in a header is iconified
in Message mode. The default value is `t'. To use this feature,
install the "netpbm" package and the "compface" package.

To modify colors, copy "dot.theme" contained Mew's source file to
an appropriate place, say "~/.mew-theme.el". First, set
`mew-theme-file' to this file name in ".mew.el" as follows:

     (setq mew-theme-file "~/.mew-theme.el")

Then, change the contents. For instance, you can find the following
configuration.

     (mew-setface-bold header-subject
       :tty "red" :light "Firebrick" :dark "OrangeRed")

The symbol `header-subject' means the value of the "Subject:" field in
a header. :tty is the case where Emacs is executed on a terminal while
:light and :dark indicates the case where the background of Emacs
executed with a window is white and black, respectively.

If you wish green for a terminal, ForestGreen for the white
background, and LimeGreen for the black background, modify the
configuration as follows:

     (mew-setface-bold header-subject
       :tty "green" :light "ForestGreen" :dark "LimeGreen")

To know what kind of symbols are prepared, see the "dot.mew".

The method above does not prepare symbols for all field names and
field value. So, `mew-header-color' and `mew-header-color-bold' exist
to change colors easily. If you use the latter, characters become
bold. The former results in normal.  The following is a typical usage:

     (mew-header-color-bold "Subject:" "LimeGreen" "OrangeRed")

With this configuration, "Subject:" becomes bold LimeGreen and its
value turns into bold OrangeRed.

The second method cannot specify the cases of terminal or background.
If you omit the field value color, the field name color is used for
the field value.

Hooks
=====

Here is a summary of hooks used in Mew.

`mew-env-hook'
     Hook called at initialize time before setting environment.
`mew-init-hook'
     Hook called at initialize time.
`mew-status-update-hook'
     Hook called at status update(`Z').
`mew-summary-mode-hook'
     Hook called in Summary mode.
`mew-virtual-mode-hook'
     Hook called in Virtual mode.
`mew-thread-display-hook'
     Hook called after new threads are displayed.
`mew-header-mode-hook'
     Hook called in Header mode.
`mew-draft-mode-hook'
     Hook called in Draft mode.
`mew-draft-mode-newdraft-hook'
     Hook called in Draft mode only when new draft is prepared.
`mew-draft-mode-reedit-hook'
     Hook called in Draft mode when a message not in +draft is
     re-edited.
`mew-draft-mode-reedit-draft-hook'
     Hook called in Draft mode when a message in +draft is re-edited.
`mew-draft-mode-reedit-queue-hook'
     Hook called in Draft mode when a message in +queue or +postq is
     re-edited.
`mew-draft-mode-edit-again-hook'
     Hook called in Draft mode when a message returned with the old
     style is edited again.
`mew-message-mode-hook'
     Hook called in Message mode.
`mew-message-hook'
     Hook called whenever message displayed.
`mew-make-message-hook'
     Hook called before making a message in Draft mode. A good example
     is as follows: (add-hook 'mew-make-message-hook 'ispell-message)
`mew-send-hook'
     Hook called before sending/queuing an e-mail message in Draft
     mode.  Note that this hook is called before composition of the
     message
`mew-post-hook'
     Hook called before posting/queuing a NetNews message in Draft
     mode.  Note that this hook is called before composition of the
     message.
`mew-real-send-hook'
     Hook called before sending/queuing an e-mail message in Draft
     mode.  Note that this hook is called after composition of the
     message.
`mew-real-post-hook'
     Hook called before sending/queuing a NetNews message in Draft
     mode.  Note that this hook is called after composition of the
     message.
`mew-smtp-flush-hook'
     Hook called before SMTP runs if messages exist in +queue.
`mew-nntp2-flush-hook'
     Hook called before NNTP runs if messages exist in +postq.
`mew-smtp-sentinel-hook'
     Hook called when a SMTP process finished.
`mew-nntp-sentinel-hook'
     Hook called when a NNTP process to receive messages finished.
`mew-nntp2-sentinel-hook'
     Hook called when a NNTP process to post messages finished.
`mew-pop-sentinel-hook'
     Hook called when a POP process finished.
`mew-pop-sentinel-non-biff-hook'
     Hook called when a non-Biff POP process finished.
`mew-imap-sentinel-hook'
     Hook called when a NNTP process to post messages finished.
`mew-imap-sentinel-hook'
     Hook called when an IMAP process finished.
`mew-imap-sentinel-non-biff-hook'
     Hook called when a non-Biff IMAP process finished.
`mew-scan-sentinel-hook'
     Hook called when scan finished.
`mew-summary-ls-no-scan-hook'
     Hook called when mew-summary-ls does not scan a folder.
`mew-summary-exec-hook'
     Hook called when `x' in Summary mode finished.
`mew-refile-guess-by-from-learn-hook'
     Hook called in mew-refile-guess-by-from-learn.
`mew-sort-hook'
     Hook called when `M-s' in Summary mode finished.
`mew-pack-hook'
     Hook called when `O' in Summary mode finished.
`mew-summary-delete-folder-hook'
     Hook called when a folder deleted.
`mew-summary-rename-folder-hook'
     Hook called when a folder renamed.
`mew-summary-toggle-disp-msg-hook'
     Hook called when `v' in Summary finished.
`mew-syntax-format-hook'
     Hook called when mew-syntax-format is called.
`mew-addrbook-mode-hook'
     Hook called in Addrbook mode.
`mew-cite-hook'
     Hook for an external cite mechanism. If you want to use
     super-cite, (setq mew-cite-hook 'sc-cite-original).
`mew-before-cite-hook'
     Called in mew-summary-reply-with-citation before citation.
`mew-suspend-hook'
     Hook called on suspend.
`mew-quit-hook'
     Hook called on quit.

Here are some example configurations of hook

Draft mode evaluates `text-mode-hook' and `mew-draft-mode-hook' in
order. If you do not set `auto-fill-mode' to `text-mode-hook', It
would be useful to define `mew-draft-mode-hook' as follows:

     (add-hook 'mew-draft-mode-hook
               (lambda ()
                 (auto-fill-mode 1)
                 (set-fill-column 70)))

In this example, the number of fill column is also set to 70.

POP
===

Mew can POP to retrieve messages. This section describes following
variables to control POP.

`mew-pop-server'
     The name of your POP server.
`mew-pop-ssh-server'
     The name of SSH server which forwards the POP3 port.
`mew-pop-ssl'
     If non-nil, POP connections are made over SSL.
`mew-pop-ssl-port'
     The port for POP over SSL.
`mew-pop-user'
     The user name on your POP server. The default is your login name.
`mew-pop-auth'
     The authentication method for POP3. 'pass means the
     authentication with USER/PASS (i.e. plain password). 'apop means
     the authentication with APOP. `t' means SASL according to
     `mew-pop-auth-list'. The default is 'apop.
`mew-pop-auth-list'
     A list of SASL methods in the preferred order. Currently,
     "CRAM-MD5" can be used.
`mew-pop-delete'
     Whether or not delete messages on a POP server after retrieval by
     POP.  If `t', delete the messages. If `nil', retain the messages.
     If number N, delete the messages N days after the first
     access. The default is `t'.
`mew-pop-size'
     The limit size of messages to be retrieved by POP. The default is
     55296 byte. 0 means unlimited, so you can get all messages from
     the POP server. To know how to retrieve the rest of a truncated
     message, please refer to retrieving.
`mew-pop-body-lines'
     *The limit of body lines to get when the size of message exceeds
     `mew-pop-size'. The default is 40.
`mew-pop-header-only'
     Whether or not the body of a message is retrieved by POP. If
     non-nil, only header is retrieved. The default is `nil'

IMAP
====

Mew can use IMAP to retrieve messages. This section describes
following variables to control IMAP.

`mew-imap-server'
     The name of your IMAP server.
`mew-imap-ssh-server'
     The name of SSH server which forwards the IMAP4 port.
`mew-imap-ssl'
     If non-nil, IMAP connections are made over SSL.
`mew-imap-ssl-port'
     The port for IMAP over SSL.
`mew-imap-user'
     The user name on the IMAP server. The default is your login name.
`mew-imap-auth'
     The authentication method for IMAP4. `nil' means the authentication with
     LOGIN (i.e. plain password). `t' means SASL according to
     `mew-imap-auth-list'. The default is `t'.
`mew-imap-auth-list'
     A list of SASL methods in the preferred order.  Currently,
     "CRAM-MD5" and "LOGIN" can be used.
`mew-imap-delete'
     Whether or not delete messages on an IMAP server after retrieval
     by IMAP. If `t', delete the messages. If `nil', retain the
     messages. If number N, delete the messages N days after the first
     access. Otherwise they are not deleted. The default is `t'.
`mew-imap-size'
     The limit size of messages to be retrieved by IMAP. The default
     is 55296 byte. 0 means unlimited, so you can get all messages
     from the IMAP server. To know how to retrieve the rest of a
     truncated message, please refer to retrieving.
`mew-imap-header-only'
     Whether or not the body of a message is retrieved by IMAP. If
     non-nil, only header is retrieved. The default is `nil'

NNTP
====

Mew uses NNTP to read/write News articles. This section describes
following variables to control NNTP.

`mew-nntp-server'
     The name of your NNTP server.
`mew-nntp-ssh-server'
     The name of SSH server which forwards the NNTP port.
`mew-nntp-ssl'
     If non-nil, NNTP connections are made over SSL.
`mew-nntp-ssl-port'
     The port for NNTP over SSL.
`mew-nntp-user'
     The user name on the NNTP server. If non-nil, authentication is
     used.  (Note that mew-nntp-auth does not exist.)
`mew-nntp-newsgroup'
     The name of default Newsgroup.
`mew-nntp-size'
     The limit size of messages to be retrieved by NNTP. The default
     is 55296 byte. 0 means unlimited, so you can get all messages
     from the NNTP server.
`mew-nntp-header-only'
     Whether or not the body of a message is retrieved by NNTP. If
     non-nil, only header is retrieved.
`mew-nntp-msgid-user'
     A user name for creation of Message-Id:. If `nil', the value of
     `mew-user' is used. The default is `nil'.
`mew-nntp-msgid-domain'
     A domain name for creation of Message-Id:. If `nil', the value of
     `mew-mail-domain' is used. The default is `nil'.

A value of Message-Id: for NNTP is created by the following rule:

     message-id = *random*.nntp-msgid-user@nntp-msgid-domain

SMTP
====

Mew uses SMTP to send messages. If an SMTP server requires
authentication, Mew automatically asks you to input your
password. This section describes following variables to control SMTP.

`mew-smtp-server'
     The name of your SMTP server.
`mew-smtp-port'
     The port for SMTP.
`mew-smtp-ssh-server'
     The name of SSH server which forwards the SMTP port.
`mew-smtp-ssl'
     If non-nil, SMTP connections are made over SSL.
`mew-smtp-ssl-port'
     The port for SMTP over SSL.
`mew-smtp-user'
     The user name on your SMTP server. If not configured, your e-mail
     address is automatically set.
`mew-smtp-auth-list'
     A list of SMTP AUTH methods in the preferred order.  Currently,
     "CRAM-MD5", "PLAIN", and "LOGIN" can be used.
`mew-smtp-helo-domain'
     An e-mail domain to tell a SMTP server with HELO/EHLO. The
     default is "localhost".
`mew-smtp-mail-from'
     The default is `nil'. An e-mail address to tell a SMTP server
     with MAIL FROM:. If `nil', an address specified by the From:
     field is used.
`mew-smtp-msgid-user'
     A user name for creation of Message-Id:. If `nil', the value of
     `mew-user' is used. The default is `nil'.
`mew-smtp-msgid-domain'
     A domain name for creation of Message-Id:. If `nil', the value of
     `mew-mail-domain' is used. The default is `nil'.
`mew-use-8bit'
     Whether or not send 8bit text without MIME encoding. If `nil', an
     appropriate MIME encoding is applied. The default is `nil'.

A value of Message-Id: for SMTP is created by the following rule:

     message-id = *random*.smtp-msgid-user@smtp-msgid-domain

If you want to use Message Submission (SMTP for submission whose port
number is 587), configure as follows:

     (setq mew-smtp-port "submission")

Please refer also to SSL (see SSL) and TLS (see TLS).

Some SMTP servers are mis-configured. They requests authentication
though errors occur if passwords are received. Mew automatically ask a
user to input user's password and send it to an SMTP server if it
requires authentication. To get along with such SMTP servers above,
configure as follows:

     (setq mew-use-smtp-auth nil)

`mew-use-smtp-auth'
     If non-nil, Mew send user's password if an SMTP server requests
     authentication. The default value is `t'.  If `nil', Mew does not
     send user's password even if the (mis-configured) SMTP server
     requests authentication.

Changing receiving/sending behavior
===================================

With `mew-config-alist', you can differ actions of sending/receiving
messages. Let's look at the following example:

     (setq mew-config-alist
           '((home
              (inbox-folder   "+inbox-home")
              (pop-server     "pop.iij4u.or.jp"))
             (ext
              (pop-ssh-server "ssh.example.org"))
             (default
              (proto          "%")
              (imap-server    "imap.example.org")
              (pop-server     "pop.example.org"))))

This example defines three "cases": "home", "ext", and "default". For
each case, some pair of key and value are defined.

We explain the semantics of `mew-config-alist' with this example.
If the "case" is "home", looking up "pop-server" results in
"pop.iij4u.or.jp". If the "case" is "ext", looking up "pop-server"
results in "pop.example.org" since there is no specified key for the
"case" and the "default" is used. If the "case" is "default",
looking up "pop-server" results in "pop.example.org".

If the "case" is "home", looking up "inbox-folder" results in
"+inbox-home". If the "case" is "ext", looking up "inbox-folder"
results in the value of `mew-inbox-folder' since there is no
specified key for both "ext" and "default". If the "case" is
"default", looking up "inbox-folder" also results in the value of
`mew-inbox-folder'.

"proto" (`mew-proto') is used to specify a folder which is selected
when you type `M-x mew'. (If you input `M-x mew' when Mew is not
executed, ""proto" for the "default" "case" is used. If you type `M-x
mew' when Mew is running, "proto" is chosen according to the value of
the "case".

Candidates of the value are "+", "$", "%", and "-". These means
"+inbox", "$inbox", "%inbox", and "-fj.mail.reader.mew" without
any special configuration.

Each key which can be specified in `mew-config-alist' corresponds to
the variable `mew-"key"'. The following list enumerates such keys.

     name, user, mail-domain,
     cc, fcc, dcc, reply-to, organization, header-alist, proto,
     smtp-server, smtp-port, smtp-ssh-server, smtp-ssl, smtp-ssl-port,
     smtp-user, smtp-auth-list,
     smtp-msgid-user, smtp-msgid-domain, smtp-helo-domain, smtp-mail-from,
     pop-server, pop-port, pop-ssh-server, pop-ssl, pop-ssl-port,
     pop-user, pop-auth, pop-auth-list,
     pop-size, pop-header-only, pop-delete, pop-body-lines,
     pop-proxy-server, pop-proxy-port,
     imap-server, imap-port, imap-ssh-server, imap-ssl, imap-ssl-port,
     imap-user, imap-auth, imap-auth-list,
     imap-size, imap-header-only, imap-delete,
     imap-trash-folder, imap-queue-folder, imap-spam-field, imap-spam-word,
     imap-proxy-server, imap-proxy-port,
     nntp-server, nntp-port, nntp-ssh-server, nntp-ssl, nntp-ssl-port,
     nntp-user, nntp-size, nntp-header-only,
     nntp-msgid-user, nntp-msgid-domain,
     ssl-cert-directory, ssl-verify-level,
     inbox-folder, queue-folder, postq-folder,
     mailbox-type, mbox-command, mbox-command-arg,
     signature-file, content-type, refile-guess-alist,
     spam-prog, spam-prog-args, ham-prog, ham-prog-args,
     use-old-pgp, pgp-signer, smime-signer, privacy-method,
     protect-privacy-always, protect-privacy-always-type,
     protect-privacy-encrypted, protect-privacy-encrypted-type,
     protect-privacy-with-old-pgp-signature,
     use-format-flowed

A value for From: is made of 'name', 'user', and 'mail-domain'
according to the following rule:

     from = name <user@mail-domain>

Unless you set `mew-from-list' by yourself, `mew-from-list' is
automatically set collecting 'from' for each "case" according to the
rule above. see cheader.

Cases configured in `mew-config-alist' can be specified to the
"case". When Mew boots up, both the "case" is "default".

If you want to change the "case", type `C'. You can use completion by
`TAB' and circular completion by `C-cTAB'.

If the "case" is not "default", they are displayed in the mode line of
Summary mode. The following is an example where the "case" is "home".

     (Summary home)

In Draft mode, if the "case" is not "default", the value is displayed
in mode line. The following is an example that the "case" is "home".

     (Draft home)

To change the "case" of a draft in Draft mode, use `C-cC-o'. Its
header is dynamically modified according to the value of the
'mail-domain' key and the 'header-alist' key. Note that the "case" is
a local variable of the Draft mode.

You can automatically set the "case" in Draft mode.

`mew-case-guess-when-prepared'
     If this variable is `t', the "case" is automatically guessed
     according `mew-case-guess-alist' when a draft is prepared. The
     default is `t'.
`mew-case-guess-when-composed'
     If this variable is `t', the "case" is automatically guessed
     according `mew-case-guess-alist' when a message is composed. The
     default is `nil'.
`mew-case-guess-when-replied'
     If this variable is `t', the "case" is automatically guessed
     according `mew-case-guess-when-replied-alist' when a draft is
     prepared by replying. The default is `t'.

The syntax of `mew-case-guess-alist' and
`mew-case-guess-when-replied-alist' is the same as
`mew-refile-guess-alist'. For more information, please refer to
by-alist.

When typing `C-cC-c' in Draft mode to send a draft, the "case" in
Draft mode is used to determine an SMTP/NNTP server, etc. When typing
`C-cC-c' in Summary mode to flush messages in +queue/+postq, the
"case" in Summary mode is used even if it is different from the
one which was used in Draft mode. `C-uC-cC-c' in Summary mode let
you specify the "case" to flush messages in +queue/postq.

The following is a summary of commands concerned with the "case".

`C'
     In Summary mode, set the "case".
`C-cC-o'
     In Draft mode, set the "case" of a draft.

The format of configuration
===========================

In Mew 6.1, configuration format of "mew.el" is improved. You can use
a new format as well as the old format.

   - In the old format, sometime "." appears. In the new fomat, no "."
     appears at all. For instance, you can write ("foo" "bar") instead
     of ("foo" . "bar").
   - In the old format, a numeric port is specified as string. An
     example is "25". In the new format, you can write it as
     integer. An example is 25. The string is still valid. An example
     is "smtp".
   - In the old format, the cases and the keys of `mew-config-alist'
     are written as string. In the new format, you can specify them as
     symbol.

Here is an example of the new format:

     (setq mew-config-alist
           '((home
              (imap-server       "imap.example.org")
              (imap-ssl          t)
              (imap-ssl-port     993)
              (smtp-server       "smtp.example.org")
              (smtp-port         "submission"))))

Compare this with the following old one:

     (setq mew-config-alist
           '(("home"
              ("imap-server"   . "imap.example.org")
              ("imap-ssl"      . t)
              ("imap-ssl-port" . "993")
              ("smtp-server"   . "smtp.example.org")
              ("smtp-port"     . "submission"))))

Again, the old format is still valid. You can also mix the new format
and the old format.

Miscellaneous
=============

In a certain environment, it would be useful to encode a file with SAMBA
encoding when saving an attached file. For this, set
`mew-use-samba-encoding' to `t'. You can set
`mew-cs-samba' to a character set for the file name. The default is
`shift_jis'.

You can print the current message by typing `#' in Summary mode.  A
function for printing can be set to `mew-print-function'.  Since its
default value is `ps-print-buffer', a message is converted into a
PostScript file before sent to a printer. You can set your own print
function as follows:

     (setq mew-print-function 'my-print-function)

You can set fields in a header to be printed to
`mew-field-for-printing'. Its default value is as follows:

     '("Subject:" "From:" "To:" "Cc:" "Date:")

For instance, if you want to print Subject:, From:, and Date: only,
configure as follows:

     (setq mew-field-for-printing '("Subject:" "From:" "Date:"))

Advanced usage
**************

Region
======

In Summary mode, there are commands which work for a region if called
with `C-u'. If a visible region is specified, these commands work for
the region without `C-u'.

For Emacs, you can use the visible region feature by putting the
following into your "~/.emacs".

     (transient-mark-mode 1)

Here is a summary of such commands.

     `?', `/', `tt', `x', `lx', `ma', `Md', `S', `mlc', `mli', `*', `$', `d', `u'

Also you can specify a repeat count before you call `*', `$', `d', and
`u'. For example, typing `3d' puts the `*' mark onto three
messages. You don't have to type `C-u' before the number.

Visiting another buffer
=======================

If you want to move to +queue after making a message and putting it to
+queue with `C-cC-m' in Draft mode, set
`mew-visit-queue-after-sending' to `t'.

If you want to visit to an appropriate inbox after setting the "case"
with `C' in Summary mode, set
`mew-visit-inbox-after-setting-case' to `t'.

If you want to move from Summary mode to a draft (Draft mode) whose
name is the smallest number, type `C-cC-o'.

Secure SHell
============

Mew supports SSH version 1 and version 2 and OpenSSH for SSH. You must
execute "ssh" on the command and obtain server's public key before you
use Mew with SSH. That is, you should set up so that you can login the
server with your user password or with the password to decrypt the
secret key of the local machine. Of source, you can omit the password
to decrypt the secret key if you use "ssh-agent".

After that, you should configure SSH variables relating to each
protocol. For example, if you want to use POP over SSH, set
`mew-pop-ssh-server' to your SSH server name.

While a connection is protected by SSH, a picture of a lock is shown
in the mode line.

The implementation of Mew does not allow to use both SSH and SSL/TLS
at the same time. If you need to use SSL/TLS over an SSH tunnel,
please configure SSL/TLS only with Mew and set up an SSH tunnel on a
command line.

Secure Socket Layer
===================

Before you use SSL, you should understand the trust model of
certificate authorities (CA). Currently, Mew supports "stunnel"
version 3, 4 and 5 for SSL.

Before you use Mew with SSL, you must be sure that an SSL connection
can be established to your SSL server. Since "stunnel" is linked to
the "openssl" library, you should understand "openssl".

Suppose we use "~/.certs" as a directory where certificates of trusted
CAs are contained. You need to copy PEM-format certificates embedded
in the source of "openssl" to this director. Each name should be
"<hash>.0".

Here we call a sample CA certificate "ca.pem". You can calculate
<hash> as follows:

     % openssl x509 -hash -noout -in ca.pem

To copy the certificate, do as follows:

     % cp ca.pem ~/.certs/`openssl x509 -hash -noout -in ca.pem`.0

The certificates in the source of "openssl" do not cover all CAs. If
the certificate of your SSL server is signed by another CA, you must
copy the certificate of the CA to the directory. You may be able to
find appropriate certificate from the following page:

     http://www.columbia.edu/~ariel/good-certs/ns45/

There are two important Mew variables to control "stunnel".
`mew-ssl-cert-directory' is the directory where you install
certificates of trusted CAs. It's default value if "~/.certs". Also,
you can set the verification level with `mew-ssl-verify-level'.  It's
default to 1. The meanings of the values are as follows:

0
     No verification.
1
     Verify server's certificate if present. If verification failed,
     an SSL/TLS connection is not created. If not present, an SSL/TLS
     connection is created.
2
     Verify server's certificate. If verification failed, an SSL/TLS
     connection is not created. If not present, an SSL/TLS connection
     is not created.
3
     Verify server's certificate which locally installed (not one from
     the server).

Then configure SSL-related variables of each protocol. For example, if
you want to use POP over SSL, set `mew-pop-ssl' to `t'.
Also, if its port is not a standard one, configure
`mew-pop-ssl-port'.

     (setq mew-pop-ssl t)

To use SSL for SMTP, configure as follows:

     (setq mew-smtp-ssl t)

While a connection is protected by SSL, a picture of a lock is shown
in the mode line.

Transport Layer Security
========================

Mew can use TLS instead of SSL. To enable TLS, Mew relies on
"stunnel", too. So, before using TLS, you should configure
according to the explanations in SSL.

Then, set the SSL port to the same one of the protocol to be
protected. For instance, configure as follows for POP:

     ;; mew-pop-port is default to "pop3" (110)
     (setq mew-pop-ssl t)
     (setq mew-pop-ssl-port mew-pop-port) ;; The default is "pop3s" (995)

That is, if the SSL port is the same as the port of the protocol to be
protected, TLS is used. Otherwise, SSL is used.

The following is an example to protect Message Submission with TLS.

     (setq mew-smtp-port "submission") ;; The default is "smtp" (25)
     (setq mew-smtp-ssl t)
     (setq mew-smtp-ssl-port mew-smtp-port) ;; The default is 465

Spam messages
=============

(1) In the case where a spam filter is running on your POP server or
your IMAP server.

You can put the `D' mark to spam messages while you are retrieving
messages in +inbox or you are scanning messages in $inbox/%inbox.

If you use "bogofilter", put the following to your "~/.mew.el".

     (defun mew-spam-bogofilter (val)
       (let ((case-fold-search t))
         (if (string-match "yes" val) ?D)))

     (setq mew-inbox-action-alist
           '(("X-Bogosity:" mew-spam-bogofilter)))

If you want to put the `o' mark so as to be refiled to the +spam
folder, instead of putting to th `D' mark, you should program the
function as follows:

     (defun mew-spam-bogofilter (val)
       (let ((case-fold-search t))
         (if (string-match "yes" val) "+spam")))

If you use "spamassassin", put the following to your "~/.mew.el".

     (setq mew-spam: "X-Spam-Flag:")
     (defun mew-spam-assassin (val)
       (let ((case-fold-search t))
         (if (string-match "yes" val) ?D)))

     (setq mew-inbox-action-alist
           '(("X-Spam-Flag:" mew-spam-assassin)))

In the case where you want to use bsfilter, see a document in the
bsfilter package.

(2) In the case where a spam filter is running in your IMAP server.

You can delete or move spam messages while you are scanning %inbox.
If you use "bogofilter", put the following to your "~/.mew.el".

     (setq mew-imap-spam-field "X-Bogosity")
     (setq mew-imap-spam-word "Yes")

If `mew-imap-spam-folder' or `mew-imap-trash-folder' is defined, spam
messages are moved to the folder. Otherwise, they are removed.

(3) In the case where you installed "bogofilter" in your local
machine, you can put the `*' mark to spam messages. First you need to
install the following script, say "bogo":

     #!/bin/sh

     bogofilter -v -T -B $* | grep S

Type `?' and `RET', then specify "bogo", and spam messages are marked
with `*'. After that, you may want to process them with `md' + `x'.

(4) In the case where you use POP and a spam filter does not run on
the POP server but you want to mark spam messages when retrieving

Since bsfilter can be a POP proxy server, you can implement your
policy. See a document in the bsfilter package.

Spam messages(2)
================

If you want to let your filter learn the current message in Summary as
a spam, type `ls'. Likewise type `lh' to let your filter learn it as a
ham (non-spam).

To use these commands, you need to configure four variables in
advance.  We consider bogofilter as an example and see three cases.

(2) To let your local filter learn:

     (setq mew-spam-prog "bogofilter")
     (setq mew-spam-prog-args '("-s" "-N" "-v"))
     (setq mew-ham-prog "bogofilter")
     (setq mew-ham-prog-args '("-n" "-S" "-v")))

(2) To let your filter on your <server> learn via SSH:

     (setq mew-spam-prog "ssh")
     (setq mew-spam-prog-args '("<server>" "bogofilter" "-s" "-N" "-v"))
     (setq mew-ham-prog "ssh")
     (setq mew-ham-prog-args '("<server>" "bogofilter" "-n" "-S" "-v")))

(3) To pass through your <firewall> with SSH and to let your filter on
your <server> learn via SSH:

     (setq mew-spam-prog "ssh")
     (setq mew-spam-prog-args '("-A" "<firewall>" "ssh" "<server>" "bogofilter" "-s" "-N" "-v"))
     (setq mew-ham-prog "ssh")
     (setq mew-ham-prog-args '("-A" "<firewall>" "ssh" "<server>" "bogofilter" "-n" "-S" "-v")))

If you use SSH, you need to configure related hosts so that you can
login them without passwords.

Warning addresses
=================

Suppose you are writing a message which must be closed in your
company. You might write an non-employee's address by mistake. If you
tells your company's domains, for instance, to Mew, it turns
non-employee's addresses to red.

There are four variables to decide which address should trun red.
They are all a list of strings. Mew takes the following rules:

  1. If an address is specified in `mew-safe-addresses', no warning.
  2. If the address is specified in `mew-warn-addresses', warning.
  3. If its domain is specified in `mew-safe-domains', no warning.
  4. If its domain is specified in `mew-warn-domains', warning.
  5. If either `mew-warn-addresses' or `mew-safe-domains' defined,
     warning.
  6. No warning.

Here is an example that an address whose domain is not "@example.org"
turns red.

     (setq mew-safe-domains '("example.org"))

If you want "customers@example.org" to turn red even its domain is
"@example.org", add the following line.

     (setq mew-warn-addresses '("customers@example.org"))

Biff
====

The functionality to check new messages is called biff. With the
following configuration Mew sees how many new messages have arrived
every 5 minutes.

     (setq mew-use-biff t)

If one or more new messages exist, the total number is displayed in
the mode line.

The server and the protocol, which Mew checks, are decided according
to `mew-proto' and the "case" (`mew-case') on boot time.

With the following configuration, Mew beeps when the number of new
messages changes from zero to one or more.

     (setq mew-use-biff-bell t)

To change the interval time of biff, set `mew-biff-interval'.  Below
is an example to set it to 10 minutes.

     (setq mew-biff-interval 10)

Edit
====

Edit mode is a mode to edit a message to generate another new message.
The followings are typical examples:

   - Saving a new message with big attachments removed
   - Saving a decrypted message whose original one is encrypted with
     PGP/MIME or S/MIME

To edit a current message in Edit mode, type `M-e'. Then, a new draft
is prepared like Draft mode. In Edit mode, you can edit a message as
if you were in Draft mode.

To save edited message to a new message, type `C-cC-c' or
`C-cC-m'. They are the exactly same command. To execute one of them,
you are asked a folder to save the new message.

Please take care that you may confuse this command as retry sending
(see sum-write). Retry seinding is to send a message after editing
while Edit mode is to save a message after modifying.

The following is summary of commands relating to Edit mode. To enter
Edit mode from Summary mode, use the following command.

`M-e'
     Entering Edit mode with the current message.

The following is a summary of commands in Edit mode.

`C-cC-c'
     Saving the edited message to a new message.
`C-cC-m'
     The same as `C-cC-c'
`Other commands'
     The same as the other commands in Edit mode

E-mail convention
*****************

When you exchange messages with other people, you should obey minimum
manner. It gives a bad impression to the people if you violate the
manner since such messages are hard to read. We always should try to
write concise yet comprehensive explanations and make an effort to
make receivers well-understood.

We should take good care of the following items.

Fill To: and Cc: fields precisely
     To: is for target receivers and Cc: is for those who are received
     for their information. If his address is not on To:, he might
     skip to read the message. We should take care not to deliver to
     wrong people by mistaking the addresses.

The number of addresses To: and Cc: should be small
     It is discouraged to specify a lot of mail addresses on To: and
     Cc:. You should create a mailing-list instead. Or, if necessary,
     you should make the destination anonymous (see anonymous).

Write a short and clear summary of body in Subject:
     There are people who decide to read contents from their
     Subject:. So, they might skip messages with improper Subject:. We
     should not write a long subject since it is hard to read.

Cite only necessary sentences
     You should not bother to remove unnecessary sentences. With Mew,
     citation must be a piece of cake.

Make your signature simple
     A long signature is just self-satisfaction.

Do not send prank messages
     I do not want to warn this kind of stuff. Nonetheless, someone
     sends Happy or Unhappy messages to others. You should understand
     that people doubt your character.

Attach data files that the receivers can read
     It is text only that you can send without any agreement with the
     receivers. If you want to send data files other than text, you
     should make an agreement with the receivers. To mailing-list, you
     should send text only.

If you wish to learn manner on the Internet more comprehensively,
please refer to RFC1855.

Implementation Issues
*********************

Why are "mewl" and "mewencode" necessary?
     With Mew, you can read throw messages in Summary mode while you
     are retrieving messages or listing the messages again. This means
     that multiple control flows of program are necessary. To make
     multiple control flows by Emacs, the only way is to make a TCP
     connection or to execute sub-process (Emacs Lisp does NOT provide
     a feature of light weight process). For POP and SMTP, Mew makes a
     TCP connection, so they are not a problem. However, to list the
     messages in Summary mode again, we have to execute a
     command. This is why "mewl" exists. The reason why "mewencode"
     exists is just for speed. When I programmed MIME encoding by
     Emacs Lisp in several ways, they are too slow to use. So, I
     decided to continue to use "mewencode". (If Base64 is implemented
     by Emacs, Mew uses the native function.)

Why does the cursor jump onto the end of line when searching(`C-s', `C-r')?
     Thread informations are not displayed in Summary mode. This is
     because the "invisible" property is dynamically put onto them
     when displayed. Strings with this property is not a target of the
     string search. But, thread informations of undisplayed lines do
     not have this property, so the string search targets them. Then a
     matched line is displayed and the "invisible" property is
     put. So, it seems to you that the string search matches the end
     of the line. Mew puts the "invisible" property for all lines in
     Summary mode in background while there are no user key
     inputs. When this word is finished, the `*' mark in the right
     side of the mode line in Summary mode disappears. In this
     situation, string search works exactly as you expect.

MS's mailers can handle file names well if I attach files with Mew 4.3
     MS's mailers use "non-standard MS original" encoding to encode
     file names.  MS mailers should migrate to the standard
     encoding. I repeatedly asked MS to do so, but they did not. So,
     Mew took the following workaround: Mew basically uses the
     standard encoding. In addition, Mew add "MS original parameter"
     with file names encoded with "MS original" encoding.

Availability and mailing-list
*****************************

This chapter describes how to get Mew and related mailing-lists.

How to get Mew?
===============

The latest Mew is available from the following repository.

     http://www.Mew.org/Release/

If you want to know about Git versions of Mew, please refer to:

     http://www.mew.org/en/git/

Mailing list
============

If you want to receive release announcements, ask questions, and/or
discuss features in English, please subscribe yourself to mew-en.

     https://groups.google.com/forum/#!forum/mew-en

Copyright
*********

Mew conforms the following copyright.

Copyright (C) 1994-2018 Mew developing team.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.
  3. Neither the name of the team nor the names of its contributors
     may be used to endorse or promote products derived from this
     software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

If you wish to distribute Mew in CD or something, please let me
know. I do not go mad even if you do not tell me but I'm very glad if
you do so.  I never have declined requirements.

The copyright of this manual belongs to the author. Permission is
granted to copy, modify, redistribute this manual but no warranty.