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

Here are described marks in Summary mode. Mark is displayed right side
of message number as follows:

         1D 07/17 Itojun         v6: items to be no in6_pcbnotify() doesn't
         2o 07/18 Utashiro       Re: behavior after I'm afraid that mark-ring
         38 07/19 Nom-sun        refile info.       Sorry for my late respon

There are four marks at present.

`D'
     The mark to delete.
`o'
     The mark to refile, that is, to move a message to another folder.
`@'
     The mark to process messages at the same time.
`*'
     The mark to review.

They are explained step by step.

Delete `D'
==========

If you want to delete a message, type `d' in Summary mode to put the
`D' mark on it. Take it easy. Since putting the `D' mark causes
nothing, mistakes are not fatal. By default, typing `x' moves messages
marked with `D' to the +trash folder.

To delete messages in the +trash folder really, there are two methods
by default.

  1. Execute `imclean' on the command line.
  2. Put the `D' mark in the +trash folder then type `x'.

So far, the word "by default" was repeated. This means that
`mew-msg-rm-policy' is set to `'trashonly'. You can set one of the
following values to `mew-msg-rm-policy'. Each explanation is about
action when `x' is pressed.

`'totrash'
     Refile to the +trash folder if not in the +trash folder.  Just
     umark the 'D' mark if in the +trash folder.
`'always'
     Really remove messages marked with 'D' always anyway.
`'trashonly'
     Really remove messages marked with 'D' if in the +trash folder.
     In other fonders, refile to the +trash folder.
`'uselist'
     Really remove messages marked with 'D' if in a folder found in
     `mew-msg-rm-folder-list'. In other folders, refile to the +trash
     folder.
`other values'
     Considered as 'trashonly.

Customize the action of `x' as you like.

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'.

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

`d'
     Put the `D' mark.
`x'
     Process messages marked with `D' according to
     `mew-msg-rm-policy'.
`md'
     Change all `*' mark to the `D' mark.

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.

A summary about the `o' mark is here.

`o'
     Put the `o' mark.
`x'
     Refile messages marked with `o'
`mo'
     Change all `*' marks to the `o' mark to be refiled.

Multiple `@'
============

To process multiple messages, put the `@' mark. Here is a summary
concerned with the `@' mark.

`@'
     Put the `@' mark.
`F'
     Prepare a draft to forward multiple messages marked with `@' in
     MIME format.
`M-s'
     Apply unshar on messages marked with `@'.
`M-t'
     Apply "uudecode" on messages marked with `@'.

For `M-s' and `M-t', messages marked with `@' are supposed to be in
order(numbers can be discrete). If out of order, sorting with `S'
would help.

Review `*'
==========

Please put the `*' mark onto messaages that you want to review
later. `?' also put the `*' mark onto matched messages(for more
information, refer to Pick). 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 inputed regular
     expression.
`md'
     Change `*' marks to `D' mark.  It is useful to delete messages
     selected by `?'.
`mo'
     Change the `*' marks to the `o' mark.  It is useful to refile
     messages selected by `?'.

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

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

Here is a summary for unmark commands.

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

Mark strength
=============

Marks are classified into two categories, "strong mark" and "weak
mark".  The same level mark can be overwritten. A strong mark can
overwrite a weak mark.

When you put a mark, the following action is taken.

Strong marks :: `o' and `D'
     If marks an unmarked message, display the next message. If
     overwrites, stay the current line.
Weak marks :: `*' and `@'
     Stay the current line always.

You can exchange marks as follows:

`m@'
     `*' -> `@' :: It is useful when you pick messages by `?'  then
     pass them to "uumerge" with `M-t'.
`m*'
     `@' -> `*'
`ms'
     `@' <-> `*'
`md'
     `*' -> `D' :: It is useful when you put `D' marks to messages
     picked by `?'.
`mo'
     `*' -> `o' :: It is useful when you put `o' marks to messages
     picked by `?'.

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

When you come to receive hundred of messages in a day(don't you
believe it?), refiling messages becomes a very tough job. Mew neatly
guesses a default folder 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'. Messages are
marked with `o' if their refiling folders are decided.

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 folders
================

Just with information from a header, folder candidates are
infinity. So, if you don't have any clue, it is an SF story to decide
a refiling folder. But wait. Clue is on your hand. You get a list of
folders from your home directory. The number of folders is limited, so
it is not so difficult to select a candidate from the folder list.

Suppose there is a folder named +work/happy-networking. We can guess
that the following message may be refiled to the folder.

     To: happy-networking@mew.org

Likewise, Mew searches a matching folder name forward with addresses
on To: and Cc:. There are many people who don't use recursive
folders. With Mew, however, you would be fool if you don't use it.

Smart users may wonder that they get a trouble in the following
situation.

     To: simozono
     Cc: happy-networking@mew.org

Since kazu is a member of happy-networking, he receives this
message. But he has a folder for his friend, simozono, so +simozono
may be chosen.

To avoid this, Mew allows you to specify ignore folders. The default
is "~/Mail/from". So, please take a convention to refile personal
messages under "~/Mail/from"(like "+from/simozono").

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

     Folder name (+work/happy-networking): +

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 name of function to provide this feature is
`mew-refile-guess-by-folder'.

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

Guess by folders is really cool but not perfect. Consider this
scenario.  For a message

     To: staff@mew.org

and for another message

     To: staff@iijlab.net

the same folder is selected with guess by folders(e.g. "+net/staff").
So, Mew allows you to define your own rules explicitly.

Let's look at an example.

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

This means that if To: contains staff@mew.org +net/mew/staff is
selected and if To: has staff@iijlab.net +net/iijlab/staff is chosen.

The format of this rule is as follow:

     rule ::= '((<key> <alist>) (<key> <alist>) (<key> <alist>) ...)

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. Please note that <value> and <folder> is separated
with `.'.

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

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 name of function to provide this feature is
`mew-refile-guess-by-alist'.

Guess by Message-ID
===================

Mew has a mechanism to guess a folder by the place where its parents
are refiled tracing Message-Id on In-Reply-To: field.

For example, Alice, Bob, and Chris had a chat to go on a ski. So, Bob
made +tmp/ski then refiled the message to it. The further messages, if
they are truly replied, they are supposed to be refiled to +tmp/ski.

Information for relationship between Message-Id and folder is stored
to "~/Mail/.mew-refile-msgid-alist". `mew-refile-alist-max-length'
controls the amount of this information. If you want limits it to 500
messages, put the following to "~/.emacs".

     (setq mew-refile-alist-max-length 500)

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

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.

Alice sent Bob housing information on the skip trip. Unfortunately it
is not a replied message. So, guess by Message-ID fails. But we really
want that it is refiled to +tmp/ski. If the previous message from her
was refiled to +tmp/ski, +tmp/ski is selected.

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

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

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

For those who read NetNews received by Email with Mew, Mew provides a
mechanism to guess a folder by Newsgroups:. It will be also useful
when Mew integrates NetNews in the future.  The name of function to
provide this feature is `mew-refile-guess-by-newsgroups'.

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

The default rule is extract a user name from From: and chooses
`+from/username'. 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-guess-by-newsgroups
         mew-refile-guess-by-folder
         mew-refile-ctrl-throw
         mew-refile-ctrl-auto-boundary
         mew-refile-guess-by-msgid
         mew-refile-guess-by-from
         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, +bbb.
`mew-refile-guess-by-folder'
         guessed +ccc, +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 don't 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'.

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

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

`M-x mew-summary-auto-refile' is the spell. This spell is so powerful
that the author hesitates to bind it to any key. When you execute this
function, it marks messages, which are not marked with `o' nor `D',
with `o'. 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 never 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-guess-by-newsgroups
         mew-refile-guess-by-folder
         mew-refile-ctrl-auto-boundary
         mew-refile-guess-by-msgid
         mew-refile-ctrl-throw
         mew-refile-guess-by-from
         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.

How to selects message which you want
*************************************

You may want to pick up messages whose Subject: contains a string
"party" and whose From: is kazu@mew.org. Mew provides three methods to
accomplish this.

`?'
     Pick messages according to a pick pattern which you input, then
     put the `*' mark onto them.
`/'
     Pick messages according to a pick pattern which you input, then
     list them up.
`V'
     Go to Virtual mode which gives a single view to picked messages
     from multiple folders. Enter a virtual folder name,
     comma-separated folders, and pick pattern. For more information,
     please refer to virtual.

Following sections describes how to input conditions and Virtual mode
in detail.

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

When Mew asks a user to input pick pattern, the following message is
displayed.

     pick pattern:

Input pick pattern combining the following keywords:

`field=string'
     Match if the "field" field contains the "string" string. If you
     specify "head", "body" or "all" as "field", it means the entire
     header, the body, and the entire message, respectively.
`<pattern1> & <pattern2>'
     Match if <pattern1> AND <pattern2>.
`<pattern1> | <pattern2>'
     Match if <pattern1> OR <pattern2>.
`! <pattern>'
     Match if not <pattern>.
`( <pattern> )'
     Evaluate <pattern> first.

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

Now you can guess how to input more complex patterns.

Virtual mode
============

Virtual mode gives you a single view for matching messages from
multiple folders. Press `V' in Summary mode to enter Virtual mode.

First you are asked a name of virtual folder

     Virtual folder name (virtual) :

Input an appropriate string. If you type just `RET', "++virtual" is
selected. Then you are asked to input a single or multiple folder
name.  If you want to specify multiple folders, please separate them
with ",".  Of course, you can complete folder names with `TAB'.

     Folder name (+inbox) : +inbox, +mew

Now input conditions.

     pick pattern:

OK. You get a Virtual mode. In Virtual mode, you can use same commands
that you can find in Summary mode except refile, delete, pick and etc.
You should take note that Virtual folder is really virtual and it
never exists in file system. If you exit Mew, it then disappears.

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
     retain, 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>

`C-cC-q'
     Erase the draft.

<"*Mew watch*" buffer>

`C-cC-q'
     Erase the current buffer.

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

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

Beginner course
===============

Here are described the following variables.

   - mew-draft-mode-hook
   - mew-from
   - mew-fcc
   - mew-cc
   - mew-dcc
   - mew-window-use-full
   - mew-summary-show-direction

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

     (setq mew-draft-mode-hook (function (lambda () (auto-fill-mode 1))))

You may want to use another address than which your Email manager
defined. An example is the case that a host name appears in your Email
address since the configuration by your Email manager is
imperfect. (In this case, ask him to resolve this problem first.) If
From: is specified on a draft, Mew treats it as it is. You can specify
From: with completion. If you want to prepare From: in drafts, set
`mew-from' as follows:

     (setq mew-from "Kazu Yamamoto <Kazu@Mew.org>")

This feature means that you cannot trust From: in all cases. I would
sincerely ask all Mew users NOT to cheat others with this feature. And
please note that a bad guy can set himself up as another guy very
easily. For important messages, use PGP/MIME.

If you want to back up your messages every time when you write them
with Fcc:, put the following line into ".emacs".

     (setq mew-fcc "+Backup")

Define `mew-cc'(`mew-dcc') to use Cc:(Dcc:).

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

     (setq mew-window-use-full t)

`SPC' in Summary mode decide the next action to view a message
according to `mew-summary-show-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'
     Never display the next message.

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

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

Junior course
=============

Here are described the following variables.

   - mew-use-highlight-cursor-line
   - mew-use-highlight-mouse-line
   - mew-use-highlight-mark
   - mew-use-highlight-header
   - mew-use-highlight-body
   - mew-use-highlight-url
   - mew-use-highlight-x-face

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 XEmacs, 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 on XEmacs
is `t'.

If `mew-use-highlight-mark' is `t' and you are in Summary mode on one
of folders enumerated in `mew-highlight-mark-folder-list', marked
lines are painted. The default of `mew-highlight-mark-folder-list' is
'("+inbox") and that of `mew-use-highlight-mark'is `t'.

If `mew-use-highlight-header' is `t', a header is painted in both
Message mode and Draft mode.  The default is `t'.

If `mew-use-highlight-header' is `t', a body is painted in both
Message mode and Draft mode. The default is `nil'.

If `mew-use-highlight-url' is `t' , strings containing URL are
emphasized in Message mode. The default is `t'.

If `mew-use-highlight-x-face' is `t' on XEmacs, X-Face: in a header is
iconified in Message mode. The default value on XEmacs is `t'.

Senior course
=============

Here are described the following variables.

   - mew-header-alist
   - mew-cite-fields
   - mew-cite-format
   - mew-cite-prefix

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.mew.org/~kazu/")))

To customize citation label, define field to cite in `mew-cite-fields'
and format in `mew-cite-format'. Define citation symbol 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 and to change the prefix with a
user name, 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")
     (setq mew-cite-prefix-function 'mew-cite-prefix-username)

Hooks
=====

Here is a summary of hooks used in Mew.

`mew-init-hook'
     Evaluated when Mew starts.
`mew-summary-mode-hook'
     Evaluated at the entrance of Summary mode.
`mew-virtual-mode-hook'
     Evaluated at the entrance of Virtual mode.
`mew-message-mode-hook'
     Evaluated at the entrance of Message mode.
`mew-message-hook'
     Evaluated every time when messages are displayed in Message mode.
`mew-draft-mode-hook'
     Evaluated at the entrance of Draft mode.  Evaluated every time
     when messages are displayed in Message mode.
`mew-cite-hook'
     Evaluated every time when you cite a message. It is usually used
     for supercite.
`mew-send-hook'
     Evaluated just before a message is sent.
`mew-quit-hook'
     Evaluated at exit of Mew.
`mew-summary-inc-sentinel-hook'
     Evaluated when "inc" is finished.
`mew-summary-scan-sentinel-hook'
     Evaluated when "scan" is finished.
`mew-summary-exec-hook'
     Evaluated when `x' in Summary mode is finished.

Config
======

If you specify "case" blocks in your IM "Config" file, you can change
actions of imget and imput. Suppose that the followings are specified
in Config.

     Imget.Src=pop/apop:kazu@mail.mew.org
     FromDomain=Mew.org
     case wide
     Imget.Src=pop/rpop:kazu@mx.wide.ad.jp
     FromDomain=wide.ad.jp
     case iijlab
     Imget.Src=imap:kazu@mailbox.iijlab.net
     FromDomain=iijlab.net

By default, imget retrieves kazu's messages from mail.mew.org by APOP.
And if the From: field doesn't exist in a message to be sent(e.g. when
mew-from is set to nil), the user name "kazu" and Mew.org is
concatenated with "@" then imput specifies it in the From: field.

If you specify --config=wide to imget, it retrieves kazu' messages
from mx.wide.ad.jp by RPOP. Also, imput chooses kazu@wide.ad.jp for
the From: field.

In this way, imget and imput selects valid case block according to the
--config option. As you see above, with this feature, it is very
convenient since you can change mailbox and your address.

When Mew boots up, it investigates case statements. If there are one
or more kinds of case statements, `mew-config-list' is set. The block
to be read when --config is not specified is represented as "default".
In the case up above, '("default" "wide" "iijlab") is set to
`mew-config-list'.

If you type `C' in Summary mode, you can complete the value to be
specified with the --config option for imget, using `mew-config-list'
as candidates. The default value is "default". If other value is
selected, say "wide", `i' displays the following message.

     Getting +inbox (wide)...

To specify case block to imput, you can use the Config: field in a
messge to be sent as well as the --config option. In Draft mode, you can
complete the Config: field itself by `TAB' as described in
header. Also, you can complete its value by `TAB' using
`mew-config-list' as candidates. Moreover, you can use circular
completion of `mew-config-list' by `C-cTAB'.

However, you may think this is a boring job. You would want Mew to
guess a value of Config: because Mew can guess refile folders. Of
course, Mew supports this kind of guess feature. You can specify your
guess rule to `mew-config-guess-alist'. Its syntax is exactly the same
as `mew-refile-guess-alist' explained in by-alist.

Let's look at one example:

     (setq mew-config-guess-alist
        '(("To:"
           ("wide.ad.jp" . "wide")
           ("mew.org" . "mew"))))

In this case, if To: matches wide.ad.jp, "Config: wide" is
inserted. If it matches mew.org, "Config: mew" is inserted.

There are three changes that you can insert the Config: field with
this feature.

  1. When a draft is prepared if `mew-config-insert-when-prepared' is
     `t'.
  2. When a message is composed by `C-cC-m' if
     `mew-config-insert-when-composed' is `t'.
  3. Anytime when you type `C-cC-o'.

This is just for your information. If you want select Config: by
hostname, put the following line in your ".emacs".

     (setq mew-config-guess-alist
        (list (cons nil (system-name))))

Getting Mew started faster
==========================

The reason when starting process of Mew becomes slow is due to
increase of numbers of folders. Remember Mew corrects a list of folder
names at the beginning.

To make start faster, execute "impath" by cron as follows. Mew reads
"~/Mail/.folders" instead of executing "impath" if it exists.

     impath --list + > ~/Mail/.folders

Also, add the followings in your "~/.emacs".

     (setq mew-use-folders-file-p t)

If mew-use-folders-file-p is t, Mew reads "~/Mail/.folders" when
boots.  If mew-use-folders-file-p is t, `C-uZ' stores updated folder
list to "~/Mail/.folders".

Life with icons
***************

It depends how to compile Text Emacs, though, its menu is so awkward
that users may be discouraged to use it. But wait! XEmacs's menu is
cool enough. Moreover, it has toolbars which hold icons bounded to
each function.

If you use Mew on XEmacs, you can read and/or write messages with
icon-based interface. The icon-based interface was designed totally
equivalent to the original key-based interface.

So, how to use the icon-based interface? I believe that it is
intuitive enough that no future explanation is necessary. Nonetheless,
some basic rules are shown below.

To execute a function bounded to each BASIC icon in Summary, Virtual,
and Draft mode toolbar, click the left button of your mouse.

For multipart messages, multipart icons appears in toolbars. Clicking
the left button on a multipart icon visualizes the part. When you
press the multipart icon, a popup menu appears. Thanks to this menu,
many operations can be applied to the part.

By default, multipart icons are displayed at the right size of the
basic icons in toolbars. If you like the left size, configure as
follows:

     (setq mew-multipart-icon-position 'left)

If you hesitate to install XEmacs, please gain access to the following
URL to see snapshots of the icon-based interface.

     http://www.Mew.org/

Email 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.

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.

Carriage return means end of line and null line expresses end of paragraph. One line should be limited to 70 characters or so.
     It is very hard to read if you write a message on every other
     line or in a long line without folding. Especially long lines are
     trouble to cite. Some people write a message with indent but it
     is meaningless. Text is displayed differently on each machines,
     so even if the layout is excellent on your machine, it might not
     be so on other machines.

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.

Never send prank messages
     I don't want to warn this kind of stuff. Nonetheless, someone
     sends Happy or Unhappy messages to others. You should understand
     that people doubt your character.

If you wish to learn manner on the Internet more comprehensively,
please refer to RFC1855(see Bib).

What's MIME?
************

Messages so far, more exactly RFC822 messages, cannot contain objects
other than text. MIME is multi-purpose message to extend RFC822.

MIME has

     MIME-Version: 1.0

field in its header. Without this field, it is an RFC822 message. In
MIME, Content-Type: to indicate data type and
Content-Transfer-Encoding to specify encoding are important
fields. The following sections describe these fields and feature of
MIME.

Labeling data type
==================

With MIME, data type can be specified in Content-Type:(CT:) field. The
following is an example message whose body is US-ASCII text.

     MIME-Version: 1.0
     Content-Type: Text/Plain; charset=us-ascii
     Content-Transfer-Encoding: 7bit
     Subject: hello
     From: Kazu

     Hi all,

If CT: is omitted, the content is treated as "Text/Plain;
charset=us-ascii". And if CT: is "Text/Plain" and charset is not
specified, its charset is considered as US-ASCII.

Likewise, if CT: is text, charset can be specified in the context of
MIME. For Japanese, ISO-2022-JP is used.

MIME can embed multiple objects in its body, so called multipart. Each
part in multipart consists of content-header and content-body. CT:
appears in content-header as well as header. In the contrary, you can
take header as a special type of content-header.

For more information, please refer to mime-multi.

Important CT: is listed below.

`Text/Plain'
     Text
`Message/Rfc822'
     Message including MIME which has a header and a body
`Multipart/Mixed'
     Multipart
`Application/Postscript'
     PostScript
`Application/Octet-stream'
     Binary stream. Can be considered as a binary file
`Image/Gif'
     GIF
`Image/Jpeg'
     JPEG
`Audio/Basic'
     Audio file with AU format
`Video/Mpeg'
     MPEG
`Message/External-body'
     An phantom object whose real object exists outside of the message

Encoding for transport-safe
===========================

"uuencode" has been used for a long time to transport binary. It
encodes three 8-bit characters into four 6-bit characters, however,
the result contains many kinds of symbols. Some of them have special
meanings in header so they cannot be used to extent header
functionality.

Space character bothers the transport system. Space character cannot
exist in end of line of the file system of BITNET. Suppose that an
encoded object with uuencode contains space character in end of line.
When a message gateway BITNET received this kind of message, it
removes the space character, of course. In the result, receivers
cannot decode and extract the original object.

MIME specified 2 encoding methods for body.

Base64 encoding
     Encode three 8-bit characters into four 6-bit characters with 64
     letters, "0-9A-Za-z/+". PEM originates it.
Quoted-Printable encoding
     Represent non-printable characters in hexagonal preceded by "=".

Encoding is specified by Content-Transfer-Encoding:(CTE:) in
content-header. The candidate values are as follows:

7bit
     No encoding is applied. The content consists of 7 bit lines.
8bit
     No encoding is applied. The content consists of 8 bit lines.
binary
     No encoding is applied. The content is 8 bit stream.
base64
     Encoded with Base64. The content consists of 7 bit lines.
quoted-printable
     Encoded with Quoted-Printable. The content consists of 7 bit
     lines.

If CTE: is omitted, it is treated as `7bit'.

Since ISO 2022 JP is 7bit character set, CTE: is 7bit. That it, CTE:
can be omitted. You may encode it with base64 or quoted-printable, of
course. However, you cannot read messages in folder directly with such
a encoding, I don't recommend.

Multipart structure
===================

If CT: is multipart, its content-body has multiple objects. They are
separated with a string specified in the "boundary" parameter. Let's
look at an example.

     Message-Id: <13060.789566615@iijlab.net>
     From: Kazuhiko Yamamoto =?ISO-2022-JP?B?GyRCOzNLXE9CSScbKEI=?=
             <kazu@iijlab.net>
     Subject: =?ISO-2022-JP?B?GyRCPC8kTjMoGyhC?=
     To: m-sakura@ccs.mt.nec.co.jp
     Mime-Version: 1.0
     Content-Type: Multipart/Mixed; boundary=simple
     Content-Transfer-Encoding: 7bit

     --simple
     Content-Type: Text/Plain; charset=us-ascii
     Content-Transfer-Encoding: 7bit

     Here is a picture of deer.

     --Kazu

     --simple
     Content-Type: Image/Gif
     Content-Transfer-Encoding: base64
     Content-Description: "Deer on the Nara park"

     R0lGODdhFwG8ANUAABETDCoYDC8lFi4dJxcnKTMwLkUUC04uG2opEkgeJ04yMWg4Ly1FLVJG
     NWdSMywyTks1Tmc3RjdRVjNcalRMUG9UU1xbY051eG9pcIcxEp5bM8d1NI1VSJhrVrRwUpR0
     cKZ1dcN9WXuHOWmHc7WJN6yLbcyEWNCZdDZjjml0i5t7im+TmGeRonWly5aLlrCLlK+arJmn
     pbettMabktWumM+zsrnCrtTLua21ycq6x6/J3NbQ1+bk29na5dzp8+7w8ywAAAAAFwG8AAAG
     /8CLcPhYtVgNyirWasZYEgDhIWGxRiXWcTIATHS/Hs6K2+1wt59azYtdJnBhKrVaWYcp7==

     --simple--

In this case, a string "simple" is used. A string specified in the
"boundary" parameter is preceded with "--". The last one is also
followed by "--".

Each part consists of a content-header and a content-body. They are
separated with a null line as header and body. Changing a point of
view, header and body is special content-header and special
content-body respectively.

When you send objects other than text, you should use multipart. Of
course, it is not illegal to contain, for example, Audio/Basic in body
but the receivers would be really confused. You are kind if you
enclose describing text in the first part and embed Audio/Basic in the
second part.

Multipart can take recursive. So, you can enjoy multipart of
multipart.

By the way, preceding CRLF is included in a boundary. For example up
above, the boundary is "CRLF--simpleCRLF".

Header extensions
=================

Header contains information used for transportation, so it should be
strongly prohibited to insert improper characters that make transport
agents misoperated. With MIME, non-ASCII characters are encoded into
transport-safe characters then embedded in a header with the following
format.

     =?<charset>?<encoding>?<encoded-string>?=

<charset> is identical to the charset parameter of CT: Text/Plain. For
<encoding>, `B' or `Q' is used. The former is exactly base64 and the
latter is a kind of Quoted-Printable.

For ISO 2022 JP, `B' is encouraged. `Q' is also acceptable, however,
few message interfaces support it(of course, Mew does).

For instance, let's encode Japanese representation of my name:

     =?ISO-2022-JP?B?GyRCOzNLXE9CSScbKEI=?=

Ahhh, Kanji code
****************

"Kanji" is main characters for Japanese which typically have meanings
and two sounds. The total number of Kanji usually used is over
3,000. Kanji was originated from Chinese characters and had been
modified and simplified in Japan for a long time.

There are also about 80 characters, so called "Hiragana", each
expresses just one sound and has a soft shape. Kanji is mainly used
for nouns and beginning portion of verbs while Hiragana is used for
other parts including last portion of verbs. Japanese sentences
typically consist of Kanji in 30% and Hiragana in 70%. There is one
more character set, called "Katakana", which is another notation of
Hiragana. Katakana has exactly same sound of Hiragana and a little
hard shape and is used to express exported words from other countries
based on their sounds.

I describe an example of struggle history for non-alphabetical
character set in messaging system.

Email and localization
======================

A spec of Email, RFC822, was defined with a hope to ensure
interoperability in 1982. Since Email was grown in America, its header
and body could not contains other character sets than US-ASCII.

It is, however, very inconvenient for people whose language is not
English. So, despite of extension of header, many people from various
countries extended RFC822 messages to contain non-English characters
from their native language.

In Europe, Latin 1 started to be used that presents umlaut(accent)
characters by 8 bit word. Latin 1 is sometime called ISO 8859 1.

In Japan, there are three major codes, (1) JIS code which is 7-bit 2
characters, (2) EUC code which is 8-bit 2 characters and is used in
UNIX, (3) SJIS which is 8-bit 2 characters and is used in
PCs. Pioneers of JUNET which is the antecedent of Japanese Internet
chose a switch mechanism of ASCII and JIS with ESC sequence, so called
JUNET code, for transportation.

JUNET code is sometime called ISO 2022 JP. With JUNET code, we can
tell what their character sets are in addition to switch them.

The extension such as Latin 1 and JUNET code is an agreement within
the region. You are compelled to use English to send a message across
regions in the context of RFC822.

RFC822 is so ambiguous that we misunderstand that JUNET code can be
used for header and body since it is 7 bit. Probably this is a good
explanation to blow away your misunderstanding. "RFC822 defines that
the syntax of header and body is 7bit and the semantics of header and
body is US-ASCII". JUNET code is syntactically legal but its semantics
is illegal.

The appearance of MIME
======================

To satisfy users' desire such as transportation of picture and audio
and to bridge localized RFC822, MIME was defined in 1992. With MIME,
the character parameter can be specified. Since JUNET code is called
ISO 2022 JP, Japanese message looks as follows:

     Content-Type: Text/Plain; charset=iso-2022-jp
     Content-Transfer-Encoding: 7bit

     Japanese text.

Is this charset useful? Absolutely! The charset parameter can tell
user interface an exact character set. Suppose that a Norway guy send
a message with ISO 8859 1 to Japanese. If his interface supports ISO
8859 1 then it is no problem to display the body. Otherwise the
interface can safely ignore the body. Mew makes use of the charset
parameter to convert messages to Mule's internal representation.

Some people say like this; "If we use ISO 2022 JP2 which is upper
compatible to ISO 2022 JP and can handle numerous character set, the
charset parameter is not necessary since ISO 2022 JP2 itself contains
information about character set." Maybe, just maybe, such people don't
understand MIME.

Ideally speaking, this assessment is correct. But MIME takes a
practical stance. MIME never supposes that all people in the world
will start using ISO 2022 JP2 tomorrow. Moreover, MIME is designed to
be robust against unstable transfer programs. All transfer program in
the world are not well implemented. And all site cannot use rich
resources. If you ask to use UNICODE as of today, how do you feel?

MIME provides the charset parameter to bridge between numerous
localized regions. The additional procedure under MIME is to label the
charset parameter and we can use ISO 2022 JP as we used to. If you
wish to make ISO 2022 JP2 an Internet standard, you should make an
effort to spread region where ISO 2022 JP2 is used by
default. Likewise, ISO 2022 JP2 and MIME is not inconsistent. Rather,
ISO 2022 JP2 can make most use of MIME to make itself widely
spread. Of course, the name of "charset" is not proper for character
switching mechanisms such as ISO 2022 xx.

With MIME, you can encode non-ASCII character set and insert it into
header. This scheme prevents errors of Email transfer programs and
makes it possible to convey non-ASCII strings in header. We don't have
to say "never use Japanese on Subject:" anymore!

MIME is not a spec to prohibit localized RFC822. So, MIME interfaces
are supposed to act as follows:

Viewing

  1. Allow user to choose a default charset.
  2. If MIME-Version: doesn't exist, the body is treated as the
     default charset.
  3. If MIME-Version: exists and Content-Type: is not provided, the
     body is treated as US-ASCII.
  4. If both MIME-Version: and Content-Type: exist, specified charset
     is used.

Composing

  1. Specify MIME-Version:, Content-Type:, and its charset.
  2. Choose minimum character set for charset. For instance, US-ASCII
     for English. With this rule, such situations never occur that
     kterm(Kanji terminal) is launched even if the body is US-ASCII
     only.

If you store messages in a spool or folders after conversion from ISO
2022 JP to EUC Japan, please don't be blind. You should check charset
out, and convert only ISO 2022 JP messages to EUC Japan.

Insertion of non-ASCII in header is one of MIME features but in fact
MIME-Version: is not necessary.

The concept of canonicalization
===============================

Unfortunately, each computer in the world represents data with its own
format. The followings are end of lines used in major OSes.

   - UNIX :: LF(0x0a)
   - MS-DOS :: CRLF(0x0d0a)
   - MacOS :: CR(0x0d)

As you know, if there is no agreement for end of line, text is not
transfered between these OSes safely. RFC822 defines to transform end
of line into CRLF. This kind of format conversion is called
canonicalization. Converting SJIS and EUC Japan to JUNET code is a
kind of canonicalization.

OK, let's think about encryption and signature with PGP. Suppose that
a Mac user signed text whose line breaks are CR then sent it to a UNIX
user. If the UNIX user transforms line break to LF then verifies the
signature, it is obvious that the verification fails. You thus
understand that canonicalization is necessary.

When you encrypt or sign text with PGP, first convert it to ISO 2022
JP then transform its end of lines into CRLF.

Mew's policy
************

The following words mention Mew's spirit:

     Mew wants something simple or nothing at all.

That is, complicated mechanism is not necessary. What Mew provides is
simple yet comprehensive feature.

Many people tell me like this: "A mailer that I used before has this
kind of feature and I think it's very convenient. So, please implement
it in Mew". Sorry, such a explanation might never convince me. Mew is
trying to carry out stuff that other programs have not ever done so.
The word "good-old" seems to me not enough.

Some people say to me that Mew should support, for instance, the `R'
mark and the `F' mark for replied and forwarded messages
respectively. With many discussions, however, I decided not to support
this feature since it is hard to make sure that the `R' marks are put
on certain replied messages. What if trying to reply by `a' then
quitting by `C-cC-q' in Draft buffer? If the `R' mark is put on a
message when you type `a', wrong mark is put on the message. Rather
providing imperfect features, I would like to implement more advanced
mechanism such as multipart editor(for more information, see
todo).

If you believe in your opinion, please pursue the author
patiently. Since I'm hell-of-a busy person I'm prone to forget what
you explained before. And because I'm just a man I regret to say I'm
subjective. It is quite possible for me not to understand your novel
ideas. So, please don't give up!

Please don't say "Mew is similar to mh-e" nor "Mew is an enhanced
version of mh-e". Just because Mew is implemented with completely
different concept from mh-e in spite of the similar appearance.

Where did Mew come from?
************************

It might not be useful but let's open the book about Mew's history...

I'm sick of mh-e!
=================

I took part in the FJPEM research project of WIDE Project in the fall
of 1993. At that time, Mine had implemented mhpem to make it
convenient to use FJPEM with mh-e. Inspired by mhpem, I spend many
time to enhance mhpem as escape from my master thesis in winter
1994. :)

mhpem was a lovely program to decrypt cipher messages automatically,
however, we met some problems. The biggest one was that mh-e was not
flexible enough to enhance some features. I really wanted to cache
decrypted message to display it quickly for the second time but it was
quite hard to enhance mh-e to do so. When a new version of mh-e was
released and it appeared that mhpem didn't work with it, I decided to
kick it out.

I want to cache decrypted PEM. Also MIME. Why isn't there a good
interface to handle MIME with easy operations? Tell me the reason not
to be able to cite multiple messages to one replying message. It's
ridiculous that we can't enjoy cheerful marks. I'd hate to refile
messages with difficult operations. Yup, I was really sick of mh-e.

Auto decryption in mhpem, asynchronous scan in mhasync, dynamic window
setup in GNUS, cheerful mark system for multiple messages in
gnus-mark, refile feature in VM, message cache mechanism, and
beautiful and flexible programming style.... A pieces of puzzle was
gradually getting together in my mind. It was early in the spring of
1994.