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

2. Commands

2.1 Buffer Entry  Commands after entering a Message buffer.
2.2 Header Commands  Commands for moving headers or changing headers.
2.3 Movement  Moving around in message buffers.
2.4 Insertion  Inserting things into message buffers.
2.5 MIME  MIME considerations.
2.6 IDNA  Non-ASCII domain name considerations.
2.7 Security  Signing and encrypting messages.
2.8 Various Commands  Various things.
2.9 Sending  Actually sending the message.
2.10 Mail Aliases  How to use mail aliases.
2.11 Spelling  Having Emacs check your spelling.


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

2.1 Buffer Entry

You most often end up in a Message buffer when responding to some other message of some sort. Message does lots of handling of quoted text, and may remove signatures, reformat the text, or the like--depending on which used settings you're using. Message usually gets things right, but sometimes it stumbles. To help the user unwind these stumblings, Message sets the undo boundary before each major automatic action it takes. If you press the undo key (usually located at C-_) a few times, you will get back the un-edited message you're responding to.


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

2.2 Header Commands


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

2.2.1 Commands for moving to headers

These following commands move to the header in question. If it doesn't exist, it will be inserted.

C-c ?
Describe the message mode.

C-c C-f C-t
Go to the To header (message-goto-to).

C-c C-f C-o
Go to the From header (message-goto-from). (The "o" in the key binding is for Originator.)

C-c C-f C-b
Go to the Bcc header (message-goto-bcc).

C-c C-f C-f
Go to the Fcc header (message-goto-fcc).

C-c C-f C-c
Go to the Cc header (message-goto-cc).

C-c C-f C-s
Go to the Subject header (message-goto-subject).

C-c C-f C-r
Go to the Reply-To header (message-goto-reply-to).

C-c C-f C-n
Go to the Newsgroups header (message-goto-newsgroups).

C-c C-f C-d
Go to the Distribution header (message-goto-distribution).

C-c C-f C-o
Go to the Followup-To header (message-goto-followup-to).

C-c C-f C-k
Go to the Keywords header (message-goto-keywords).

C-c C-f C-u
Go to the Summary header (message-goto-summary).

C-c C-f C-i
This inserts the `Importance:' header with a value of `high'. This header is used to signal the importance of the message to the receiver. If the header is already present in the buffer, it cycles between the three valid values according to RFC 1376: `low', `normal' and `high'.

C-c C-f C-a
Insert a reasonable `Mail-Followup-To:' header (see section 1.11 Mailing Lists) in a post to an unsubscribed list. When making original posts to a mailing list you are not subscribed to, you have to type in a `Mail-Followup-To:' header by hand. The contents, usually, are the addresses of the list and your own address. This function inserts such a header automatically. It fetches the contents of the `To:' header in the current mail buffer, and appends the current user-mail-address.

If the optional argument include-cc is non-nil, the addresses in the `Cc:' header are also put into the `Mail-Followup-To:' header.


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

2.2.2 Commands to change headers

C-c C-o
Sort headers according to message-header-format-alist (message-sort-headers).

C-c C-t
Insert a To header that contains the Reply-To or From header of the message you're following up (message-insert-to).

C-c C-n
Insert a Newsgroups header that reflects the Followup-To or Newsgroups header of the article you're replying to (message-insert-newsgroups).

C-c C-l
Send a message to the list only. Remove all addresses but the list address from To: and Cc: headers.

C-c M-n
Insert a request for a disposition notification. (message-insert-disposition-notification-to). This means that if the recipient support RFC 2298 she might send you a notification that she received the message.

M-x message-insert-importance-high
Insert an `Importance' header with a value of `high', deleting headers if necessary.

M-x message-insert-importance-low
Insert an `Importance' header with a value of `low', deleting headers if necessary.

C-c C-f s
Change the current `Subject' header. Ask for new `Subject' header and append `(was: <Old Subject>)'. The old subject can be stripped on replying, see message-subject-trailing-was-query (see section 3.1 Message Headers).

C-c C-f x
Set up the `FollowUp-To' header with a target newsgroup for a cross-post, add that target newsgroup to the `Newsgroups' header if it is not a member of `Newsgroups', and insert a note in the body. If message-cross-post-default is nil or if this command is called with a prefix-argument, only the `FollowUp-To' header will be set but the the target newsgroup will not be added to the `Newsgroups' header. The function to insert a note is controlled by the message-cross-post-note-function variable.

C-c C-f t
Replace contents of `To' header with contents of `Cc' or `Bcc' header. (Iff `Cc' header is not present, `Bcc' header will be used instead.)

C-c C-f w
Insert `To' and `Cc' headers as if you were doing a wide reply even if the message was not made for a wide reply first.

C-c C-f a
Insert `X-No-Archive: Yes' in the header and a note in the body. The header and the note can be customized using message-archive-header and message-archive-note. When called with a prefix argument, ask for a text to insert. If you don't want the note in the body, set message-archive-note to nil.


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

2.3 Movement

C-c C-b
Move to the beginning of the body of the message (message-goto-body).

C-c C-i
Move to the signature of the message (message-goto-signature).

C-a
If at beginning of header value, go to beginning of line, else go to beginning of header value. (The header value comes after the header name and the colon.) This behavior can be disabled by toggling the variable message-beginning-of-line.


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

2.4 Insertion

C-c C-y
Yank the message that's being replied to into the message buffer (message-yank-original).

C-c C-M-y
Prompt for a buffer name and yank the contents of that buffer into the message buffer (message-yank-buffer).

C-c C-q
Fill the yanked message (message-fill-yanked-message). Warning: Can severely mess up the yanked text if its quoting conventions are strange. You'll quickly get a feel for when it's safe, though. Anyway, just remember that C-x u (undo) is available and you'll be all right.

C-c C-w
Insert a signature at the end of the buffer (message-insert-signature).

C-c M-h
Insert the message headers (message-insert-headers).

C-c M-m
Mark some region in the current article with enclosing tags. See message-mark-insert-begin and message-mark-insert-end.

C-c M-f
Insert a file in the current article with enclosing tags. See message-mark-insert-begin and message-mark-insert-end.


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

2.5 MIME

Message is a MIME-compliant posting agent. The user generally doesn't have to do anything to make the MIME happen--Message will automatically add the Content-Type and Content-Transfer-Encoding headers.

The most typical thing users want to use the multipart things in MIME for is to add "attachments" to mail they send out. This can be done with the C-c C-a command, which will prompt for a file name and a MIME type.

You can also create arbitrarily complex multiparts using the MML language (see section `Composing' in The Emacs MIME Manual).


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

2.6 IDNA

Message is a IDNA-compliant posting agent. The user generally doesn't have to do anything to make the IDNA happen--Message will encode non-ASCII domain names in From, To, and Cc headers automatically.

Until IDNA becomes more well known, Message queries you whether IDNA encoding of the domain name really should occur. Some users might not be aware that domain names can contain non-ASCII now, so this gives them a safety net if they accidently typed a non-ASCII domain name.

The message-use-idna variable control whether IDNA is used. If the variable is nil no IDNA encoding will ever happen, if it is set to the symbol ask the user will be queried, and if set to t (which is the default if IDNA is fully available) IDNA encoding happens automatically.

If you want to experiment with the IDNA encoding, you can invoke M-x message-idna-to-ascii-rhs RET in the message buffer to have the non-ASCII domain names encoded while you edit the message.

Note that you must have GNU Libidn installed in order to use this functionality.


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

2.7 Security

Using the MML language, Message is able to create digitally signed and digitally encrypted messages. Message (or rather MML) currently support PGP (RFC 1991), PGP/MIME (RFC 2015/3156) and S/MIME. Instructing MML to perform security operations on a MIME part is done using the C-c C-m s key map for signing and the C-c C-m c key map for encryption, as follows.

C-c C-m s s

Digitally sign current message using S/MIME.

C-c C-m s o

Digitally sign current message using PGP.

C-c C-m s p

Digitally sign current message using PGP/MIME.

C-c C-m c s

Digitally encrypt current message using S/MIME.

C-c C-m c o

Digitally encrypt current message using PGP.

C-c C-m c p

Digitally encrypt current message using PGP/MIME.

C-c C-m C-n
Remove security related MML tags from message.

These commands do not immediately sign or encrypt the message, they merely insert the proper MML secure tag to instruct the MML engine to perform that operation when the message is actually sent. They may perform other operations too, such as locating and retrieving a S/MIME certificate of the person you wish to send encrypted mail to. When the mml parsing engine converts your MML into a properly encoded MIME message, the secure tag will be replaced with either a part or a multipart tag. If your message contains other mml parts, a multipart tag will be used; if no other parts are present in your message a single part tag will be used. This way, message mode will do the Right Thing (TM) with signed/encrypted multipart messages.

Since signing and especially encryption often is used when sensitive information is sent, you may want to have some way to ensure that your mail is actually signed or encrypted. After invoking the above sign/encrypt commands, it is possible to preview the raw article by using C-u C-c RET P (mml-preview). Then you can verify that your long rant about what your ex-significant other or whomever actually did with that funny looking person at that strange party the other night, actually will be sent encrypted.

Note! Neither PGP/MIME nor S/MIME encrypt/signs RFC822 headers. They only operate on the MIME object. Keep this in mind before sending mail with a sensitive Subject line.

By default, when encrypting a message, Gnus will use the "signencrypt" mode, which means the message is both signed and encrypted. If you would like to disable this for a particular message, give the mml-secure-message-encrypt-* command a prefix argument, e.g., C-u C-c C-m c p.

Actually using the security commands above is not very difficult. At least not compared with making sure all involved programs talk with each other properly. Thus, we now describe what external libraries or programs are required to make things work, and some small general hints.


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

2.7.1 Using S/MIME

Note! This section assume you have a basic familiarity with modern cryptography, S/MIME, various PKCS standards, OpenSSL and so on.

The S/MIME support in Message (and MML) require OpenSSL. OpenSSL performs the actual S/MIME sign/encrypt operations. OpenSSL can be found at http://www.openssl.org/. OpenSSL 0.9.6 and later should work. Version 0.9.5a cannot extract mail addresses from certificates, and it insert a spurious CR character into MIME separators so you may wish to avoid it if you would like to avoid being regarded as someone who send strange mail. (Although by sending S/MIME messages you've probably already lost that contest.)

To be able to send encrypted mail, a personal certificate is not required. Message (MML) need a certificate for the person to whom you wish to communicate with though. You're asked for this when you type C-c C-m c s. Currently there are two ways to retrieve this certificate, from a local file or from DNS. If you chose a local file, it need to contain a X.509 certificate in PEM format. If you chose DNS, you're asked for the domain name where the certificate is stored, the default is a good guess. To my belief, Message (MML) is the first mail agent in the world to support retrieving S/MIME certificates from DNS, so you're not likely to find very many certificates out there. At least there should be one, stored at the domain simon.josefsson.org. LDAP is a more popular method of distributing certificates, support for it is planned. (Meanwhile, you can use ldapsearch from the command line to retrieve a certificate into a file and use it.)

As for signing messages, OpenSSL can't perform signing operations without some kind of configuration. Especially, you need to tell it where your private key and your certificate is stored. MML uses an Emacs interface to OpenSSL, aptly named smime.el, and it contain a custom group used for this configuration. So, try M-x customize-group RET smime RET and look around.

Currently there is no support for talking to a CA (or RA) to create your own certificate. None is planned either. You need to do this manually with OpenSSL or using some other program. I used Netscape and got a free S/MIME certificate from one of the big CA's on the net. Netscape is able to export your private key and certificate in PKCS #12 format. Use OpenSSL to convert this into a plain X.509 certificate in PEM format as follows.

 
$ openssl pkcs12 -in ns.p12 -clcerts -nodes > key+cert.pem

The `key+cert.pem' file should be pointed to from the smime-keys variable. You should now be able to send signed mail.

Note! Your private key is now stored unencrypted in the file, so take care in handling it. Storing encrypted keys on the disk are supported, and Gnus will ask you for a passphrase before invoking OpenSSL. Read the OpenSSL documentation for how to achieve this. If you use unencrypted keys (e.g., if they are on a secure storage, or if you are on a secure single user machine) simply press RET at the passphrase prompt.


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

2.7.2 Using PGP/MIME

PGP/MIME requires an external OpenPGP implementation, such as GNU Privacy Guard. Pre-OpenPGP implementations such as PGP 2.x and PGP 5.x are also supported. One Emacs interface to the PGP implementations, PGG (see section `PGG' in PGG Manual), is included, but Mailcrypt and Florian Weimer's gpg.el are also supported.

Note, if you are using the gpg.el you must make sure that the directory specified by gpg-temp-directory have permissions 0700.

Creating your own key is described in detail in the documentation of your PGP implementation, so we refer to it.

If you have imported your old PGP 2.x key into GnuPG, and want to send signed and encrypted messages to your fellow PGP 2.x users, you'll discover that the receiver cannot understand what you send. One solution is to use PGP 2.x instead (i.e., if you use pgg, set pgg-default-scheme to pgp). If you do want to use GnuPG, you can use a compatibility script called gpg-2comp available from http://muppet.faveve.uni-stuttgart.de/~gero/gpg-2comp/. You could also convince your fellow PGP 2.x users to convert to GnuPG. As a final workaround, you can make the sign and encryption work in two steps; separately sign, then encrypt a message. If you would like to change this behavior you can customize the mml-signencrypt-style-alist variable. For example:

 
(setq mml-signencrypt-style-alist '(("smime" separate)
                                    ("pgp" separate)
                                    ("pgpauto" separate)
                                    ("pgpmime" separate)))

This causes to sign and encrypt in two passes, thus generating a message that can be understood by PGP version 2.

(Refer to http://www.gnupg.org/gph/en/pgp2x.html for more information about the problem.)


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

2.8 Various Commands

C-c C-r
Caesar rotate (aka. rot13) the current message (message-caesar-buffer-body). If narrowing is in effect, just rotate the visible portion of the buffer. A numerical prefix says how many places to rotate the text. The default is 13.

C-c C-e
Elide the text between point and mark (message-elide-region). The text is killed and replaced with the contents of the variable message-elide-ellipsis. The default value is to use an ellipsis (`[...]').

C-c C-z
Kill all the text up to the signature, or if that's missing, up to the end of the message (message-kill-to-signature).

C-c C-v
Delete all text in the body of the message that is outside the region (message-delete-not-region).

M-RET
Insert four newlines, and then reformat if inside quoted text.

Here's an example:

 
> This is some quoted text.  And here's more quoted text.

If point is before `And' and you press M-RET, you'll get:

 
> This is some quoted text.

*

> And here's more quoted text.

`*' says where point will be placed.

C-c M-r
Rename the buffer (message-rename-buffer). If given a prefix, prompt for a new buffer name.

TAB
If message-tab-body-function is non-nil, execute the function it specifies. Otherwise use the function bound to TAB in text-mode-map or global-map.


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

2.9 Sending

C-c C-c
Send the message and bury the current buffer (message-send-and-exit).

C-c C-s
Send the message (message-send).

C-c C-d
Bury the message buffer and exit (message-dont-send).

C-c C-k
Kill the message buffer and exit (message-kill-buffer).


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

2.10 Mail Aliases

The message-mail-alias-type variable controls what type of mail alias expansion to use. Currently only one form is supported--Message uses mailabbrev to handle mail aliases. If this variable is nil, no mail alias expansion will be performed.

mailabbrev works by parsing the `/etc/mailrc' and `~/.mailrc' files. These files look like:

 
alias lmi "Lars Magne Ingebrigtsen <larsi@ifi.uio.no>"
alias ding "ding@ifi.uio.no (ding mailing list)"

After adding lines like this to your `~/.mailrc' file, you should be able to just write `lmi' in the To or Cc (and so on) headers and press SPC to expand the alias.

No expansion will be performed upon sending of the message--all expansions have to be done explicitly.


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

2.11 Spelling

There are two popular ways to have Emacs spell-check your messages: ispell and flyspell. ispell is the older and probably more popular package. You typically first write the message, and then run the entire thing through ispell and fix all the typos. To have this happen automatically when you send a message, put something like the following in your `.emacs' file:

 
(add-hook 'message-send-hook 'ispell-message)

If you're in the habit of writing in different languages, this can be controlled by the ispell-message-dictionary-alist variable:

 
(setq ispell-message-dictionary-alist
      '(("^Newsgroups:.*\\bde\\." . "deutsch8")
        (".*" . "default")))

ispell depends on having the external `ispell' command installed.

The other popular method is using flyspell. This package checks your spelling while you're writing, and marks any mis-spelled words in various ways.

To use flyspell, put something like the following in your `.emacs' file:

 
(defun my-message-setup-routine ()
  (flyspell-mode 1))
(add-hook 'message-setup-hook 'my-message-setup-routine)

flyspell depends on having the external `ispell' command installed.


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

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.