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

9 Advanced usage


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

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


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

9.2 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’.


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

9.3 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. In addition, 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.


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

9.4 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 directory. 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. Its default value is "~/.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.


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

9.5 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 Secure Socket Layer.

Then, set the SSL port to the same one of the protocol to be protected. For instance, configure as follows for POP:

;; A default value of mew-pop-port is "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

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

9.6 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 the ‘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.


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

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

(1) 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.


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

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

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

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

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

9.10 Edit

Edit mode is a mode to edit a message to generate another new message. The followings are typical examples:

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 section Write, answer, and forward). 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 Draft mode


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

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