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

8 Customizing Mew

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


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

8.1 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 a 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 an 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 decides 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)

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

8.2 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. If you want to enlarge or reduce the image in the Message buffer, you switch to a window of the Message buffer with e.g. ‘C-xo’ and type ‘+’ or ‘-’, respectively. 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 (so-called HTML email). 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 Displaying MIME 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’.


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

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

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

8.4 Character set

As described in Defining charset, 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")))

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

8.5 Highlighting

If ‘mew-use-highlight-mark’ is ‘t’, marked messages 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 "conf/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 indicate 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 "conf/dot.theme".

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.


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

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


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

8.7 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 bytes. 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 Getting messages.

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


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

8.8 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 bytes. 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 Getting messages.

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


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

8.9 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 bytes. 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. The default is ‘nil’.

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

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

8.10 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. When an absolute pathname is specified, it will be used as a Unix domain socket.

mew-smtp-submission-family

The address family to be used for the SMTP server. The default value is ’ipv4.

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

An e-mail address to tell a SMTP server with MAIL FROM:. If ‘nil’, an address specified by the From: field is used. The default is ‘nil’.

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")

If you want to use a Unix domain socket to connect MTA, configure as follows:

(setq mew-smtp-port "/var/run/msp.sock")

If you want to use IPv6 as the transport protocol to connect MTA, configure as follows:

(setq mew-smtp-submission-family 'ipv6)

Please refer also to SSL (see section Secure Socket Layer) and TLS (see section Transport Layer Security).

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.


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

8.11 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 mean "+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, 
prog-ssl-arg, 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 Circular completions in a header.

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 values 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 Guess by user defined rules.

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.


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

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

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.


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

8.13 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:"))

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

This document was generated on February 16, 2023 using texi2html 5.0.