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

8. Composing and Sending Mail

Af allows you to compose and send mail as well as read it. There are several different commands to send mail, each of which sends mail in a slightly different way.

Af composes messages in three stages. First you are prompted for any details needed for the message, such as the addresses to send it to. Then af starts an editor, so that you can edit the message. Finally, you are prompted for what to do with the message (its disposition).

8.1 Commands for Sending Mail  The different commands to send mail.
8.2 Initial Details for Composing Mail  The details af may ask for when sending mail.
8.3 Editing the Mail Message  Details of editing your mail message.
8.4 Options After Editing the Message  Your options after editing the message.
8.5 Composing MIME Mail.  How to compose MIME messages.
8.6 Variables Related to Composing Mail  Variables which affect composing messages.
8.7 Defining and Using Mail Aliases  Convenient abbreviations for addresses.


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

8.1 Commands for Sending Mail

There are seven commands for sending mail in af. These commands are all similar in use, but conceptually different.

M-m or M-s
Send a message to one or more people. This allows you to compose and send a mail message (send-mail). A numeric argument makes af compose a MIME message. Alternatively, you can attach files or compositions to the message later.
M-a
Prompts for a file name and then uses the contents of the file to compose a message to one or more people (send-file). You will not normally edit the text of the message. A numeric argument makes af prompt for the MIME Content-Type of the message to compose. If af detects that the file name indicates some content type other than plain text then it will default the Content-Type and prompt for the information anyway.
M-r
Reply to the current message. (reply-to-message). This lets you compose and send mail to whoever the current message is from.
C-M-r
Group reply to the current message. (group-reply-to-message). This lets you compose and send mail to whoever the message is from, and all the addresses listed in the `To:' header. Copies are sent to the addresses listed in the `Cc:' header.
M-f
Forwarding allows you to compose an annotated copy of the current message and send it to one or more people. (forward-message).
C-M-f
Allows you to compose a new message, and the current message will then be attached to the message you are sending (forward-message-as-attachment). A numeric argument makes af include the full headers of the message to attach. This is often useful when sending reports of unsolicited commercial email to the sender's postmaster.
C-x C-d
Allows you to compose a new message, and the messages in the region (see section 12. The Mark and the Region) are attached to the outgoing message as a MIME digest (forward-region-as-digest). This is useful for forwarding several messages to someone in a convenient format.
C-t C-d
Allows you to compose a new message, and the messages in the tagset (see section 13. Tags) are attached to the outgoing message as a MIME digest (forward-tagset-as-digest). This is useful for forwarding several messages to someone in a convenient format.
M-b
Bouncing means sending an exact copy of the current message to one or more addresses, making it appear that the copy you send them is from the person who sent the message to you (bounce-message). You will not normally edit the text of the message.


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

8.2 Initial Details for Composing Mail

Depending on how you are sending mail, and how you have configured af, you will be prompted for several things when you begin composing a mail message. Normally af will only prompt for `To:' and `Subject:', and possibly `Content-Type:', `Content-Disposition:', and `Content-Description:' if you give send-file an argument, but here are all the possible questions:

`To:'
The addresses you want send the mail to.
`Subject:'
A brief description of what the message is about.
`Cc:'
Any mail addresses to send additional copies of the message to.
`Bcc:'
Any mail addresses to send blind copies of the mail to. These addresses will not be listed in the headers of the message when it is sent.
`Content-Type:'
The MIME content type which describes the contents of the message, for example `text/plain', or `image/jpeg'. See section 1.3 The Message Body.
`Content-Disposition:'
Can be set to `inline' or `attachment', indicating that the message contains an attachment which should not be viewed by default. The optional `filename' parameter (which is automatically set when you edit a file) indicates a suggested file name for the attachment. See section 1.3 The Message Body.
`Content-Description:'
A brief description of the contents of the message body. See section 1.3 The Message Body.
`Signature file'
Which signature file (see section 1.4 Signatures) do you want to include at the end of the message.
`Copy message (y/n)'
If you are replying to a message, you can copy the text of of the original message into the initial text of the reply. This is called quoting.


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

8.3 Editing the Mail Message

When you first edit a message you will normally see either a blank file, or the textual body parts of the original message with each line prefixed with `> '. You can then use your editor as usual to compose the text of the message. When you save the message, your `.signature' file will be appended to the message, separated by a line containing `-- '.

When you edit a message for the second time (or if you have configured af to do so), the headers of the message are inserted into the file you edit, separated by a blank line, and your signature will be visible at the end of the file. You can edit the headers with your editor, and af will process the changes when you exit the editor; reporting any problems to typeout. You can create headers by adding them into the header section of the file, or delete them by deleting them from the file.

You should be very careful when editing a message's headers. If you accidentally insert a blank line before the headers, then af will not find them when you exit the editor, and will therefore think that you have deleted them all. This can normally be fixed by editing the file again, and removing the offending text from the start of the file.

If a message is a multipart MIME message, then instead of using an editor to edit the message, the various body parts of the message will be displayed in compose mode. There you can add or delete body parts, or edit existing ones. See section 8.5.4 Non-Text Messages, for more details.


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

8.4 Options After Editing the Message

When you finish editing a message and exit the editor, af will display a summary of the message's headers and prompt you with

 
Send, Edit, Attachments, Check spelling, List or Forget?

It is a very good idea to check the headers that af displays, to make sure that you are sending the message to the people you think you are, that the subject is appropriate, and so on. Your options at this point are:

`Send'
Confirm the message, and give it to the system for delivery.
`Edit'
Edit the message again, this time inserting the headers and any signature into the text for you to edit.
`Attachments'
Enter compose mode on the message you're composing, allowing you to attach files or create new body parts. See section 8.5.4 Non-Text Messages, for more details on compose mode.
`Check spelling'
Run an interactive spelling checker on the body of the message (but not the headers). This option may not be available on systems where there isn't an interactive spelling checker installed.
`List'
List the message to typeout, exactly as it will be given to the system for delivery. This can be useful for checking a message, as it is much quicker than starting up an editor.
`Forget'
Cancel the message and exit mail composition. There is no way to recover a message that you have "forgotten".


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

8.5 Composing MIME Mail.

Normally, electronic mail is composed in the `us-ascii' character set, which doesn't contain any accented or international characters. Af allows you to compose MIME messages in character sets other than `us-ascii', and to encode these messages so that they are not damaged in transit.

8.5.1 Internationalised Mail  How to send internationalised mail.
8.5.2 Encoding Mail  How to control encoding of messages.
8.5.3 International Headers  Including international text in headers.
8.5.4 Non-Text Messages  How to send non-text mail messages.


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

8.5.1 Internationalised Mail

The default `us-ascii' character set contains only the characters used in American English. If you want to include international characters such as accents, Hebrew, Cyrillic or so on, you will need to make af compose messages in another character set, for example the `iso-8859-1' character set that covers Western European languages, or the `iso-8859-8' character set for Hebrew text.

The `Content-Type:' header defines how the message is to be treated. For text messages it is usually set to `text/plain; charset=us-ascii'. If you change the value to `text/plain; charset=iso-8859-1', then the message should be interpreted as containing characters in the `iso-8859-1' character set.

The default-charset variable controls which character set you compose mail messages in by default. For example, to compose messages in the `iso-8859-1' character set, you would set the default-charset variable to `iso-8859-1'. Once you have done this, any messages you compose will be marked as containing characters from that character set. You can override this default by editing the message headers.

The person who installed af at your site may have already configured it to compose messages in the correct character set. In this case you don't need to do anything to make af handle internationalised messages correctly.

Even if you compose messages in an international character set by default, af will still mark them as `us-ascii' if they don't contain any international characters. So you should rarely, if ever, need to change the character set of a message yourself.


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

8.5.2 Encoding Mail

Unfortunately, the international mail network is often unable to handle messages including international characters properly. To avoid this, af allows you to encode the message, converting any international characters into special sequences of ascii characters. Unfortunately, this means that the message will not be properly readable if the recipient doesn't have a MIME-capable mail reader. Alternatively, you can choose not to encode your message, and risk it being damaged in transit. Which choice is better is entirely dependent on your local situation.

The default-text-encoding variable controls how international messages should be encoded. The possible values are:

`7bit'
The message consists only of us-ascii characters.

`8bit'
The message contains international characters, but will not be encoded.

`quoted-printable'
The message will be encoded with the MIME `quoted-printable' encoding. This is usually the best encoding for internationalised text messages.

`base64'
The message will be encoded with the MIME `base64' encoding. This encoding is not normally a good choice for text, unless the text consists mostly of international characters.

The person who installed af at your site may have already configured it to encode internationalised messages in the best way. In this case you don't need to do anything to make af encode internationalised messages correctly.


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

8.5.3 International Headers

Af handles international characters in headers by encoding them in a special form, to avoid damage in transit. This is done automatically whenever af encounters an international character in a header.

Sometimes you will encounter comments like `(**iso-8859-8**)' in a header containing international characters. If you are viewing the header, this means that the header contains international characters in a character set that isn't listed in the viewable-charsets variable, and is a warning that af can't correctly display the characters, what you see is a "best effort".

If you are editing the header, then such a comment means that the character set is not the one you are composing the message in. In this case the af will preserve the character set by assuming that any international characters after the comment contain characters in the specified character set. You can change this by adding another comment, such as `(**iso-8859-1**)' to force the character set back to your preference.

If you often need to type international characters into mail, the command minibuffer-set-iso-keys may be useful. This command sets the allow-meta-bindings variable (see section 21.6.1 Keymaps), and then binds all the meta characters found in the `iso-8859-*' character sets to insert themselves when typed in the minibuffer. This is often useful when composing headers in languages other than English.


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

8.5.4 Non-Text Messages

There are two ways to compose non-text messages with af. You can use the send-file command, and af will ask you for the content type, disposition, and description if it recognises that the name of the file indicates that it isn't textual (see section 21.1 Mime Configuration). Or you can use an argument to send-file to force af to ask you for the content type, disposition, and description, but that requires you to know the correct content-type. Af will encode the message with the `base64' encoding if required.

The second way is to supply an argument to the send-mail command, or select the Attachments option from the menu presented after editing the text of a message. In either case you will enter compose mode, where you can attach files or other newly-created data to the message.

Compose mode looks very much like Mail mode, except that each line displays one body part of the message. Each body part can be of any type. The commands for moving around the screen, and viewing and deleting messages that you use in mail mode all work the same way in compose mode.

You can use two commands to add a body part in compose mode. One is a or M-a (attach-file). This prompts for a file name, a Content-Type (which may be defaulted from the file name), and a Content-Description, a textual description of the new body part. The contents of the file are encoded if required, and then used to create a new body part, which is inserted into the compose buffer before point.

The second command is c or M-c (compose-body-part). This prompts for a Content-Type, Disposition, and Description, and then uses an external program to create the body-part. The system needs to be properly configured to create MIME mail, or af won't be able to find out which program to use, and will give an error message, unless the Content-Type is textual, in which case it will use an editor to create the content.

In a similar way you can use e or M-e (edit-body-part) to edit the contents of a body part. Again, if the system is not configured to do this then af will give an error message for body part's that aren't textual.

You can edit the description of a body part using d or M-d (edit-description). You will be presented with the description of the body part in the minibuffer for editing.

You can also edit the top-level headers of the composition using h or M-h (edit-headers). This presents the headers of the message in an editor, just as when creating a non-MIME message. Any text other than headers in the file will be discarded, and a warning given.

When you've finished attaching files or composing body parts, then use C-M-c or q (save-composition-and-exit). This will exit compose mode, creating a new message from the body parts. You will be prompted for the disposition of the message, just as for any other message you've edited.

If you want to abandon your changes in compose mode, then use C-M-x (abandon-composition-and-exit). You will be asked if you really want to lose all your changes, and if you confirm, then compose mode will exit, ignoring all your changes.

If you entered compose mode by supplying an argument to the send-mail command, then the entire command will be aborted. Otherwise you will be prompted for the disposition of the message normally.


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

8.6 Variables Related to Composing Mail

There are a number of configuration variables related to composing and sending mail. Here is a summary of each variable and its effects:

addresses-to-ignore
Contains mail addresses which are to be ignored in group replies, typically your mail addresses on this and other machines. Default is unset.
ask-bcc
If set to true, then af will prompt for addresses to send blind copies to whenever you send mail. Default is false.
ask-cc
If set to true, then af will prompt for addresses to send copies to whenever you send mail. Default is false.
auto-fold-headers
If set to false, then af will not automagically fold long header lines onto several lines. Default is true.
compose-line-format
Defines the format of each of the body part lines in compose mode, the the same way as header-line-format defines the format of header lines in mail mode. Defaults to %a %t %k %S.
copy-on-reply
If set to false, af will never quote the text of the original message in the initial text of a reply. If set to true af will always quote the original message. If set to ask then you will be asked each time you reply to a message. Defaults to ask.
copy-preface
If set, the value is inserted before any text copied into the body of a replying or forwarding message. Any conversion characters in the value are expanded to their full value. A good value for this variable might be `On %D, %o wrote:'. Default is unset.
copy-prefix
The prefix for lines of text copied into an outgoing message when replying or forwarding a message. Defaults to `> '.
edit-initial-headers
It set to true, headers will be placed into the file to edit the first time you edit a message. When set to accept, headers will not be displayed for editing, but any valid headers typed at the start of the message will be accepted. Defaults to false.
edit-initial-signature
When set to true, any signature will be placed into the editor the first time you edit a message. Defaults to false.
edit-reply-address
When set to true, allows editing of the destination address when replying to mail. It is intended for use by people at sites with inadequate mail configurations. Defaults to false.
editor
The program to use to edit messages. Defaults to the value of the VISUAL or EDITOR environment variable.
forward-subject
If set, the value is used as a default for the subject of a forwarded or resent message. Any conversion characters in the value are expanded to their full value. A good value for this variable might be `%s (Forwarded message from %o)'. Default is unset.
headers-to-copy
A colon separated list of header names which should be included in text copied into an outgoing message when replying to or forwarding a message. Default is unset (no headers are copied).
multiple-reply-warning
If set to true, then af will prompt for confirmation if you try to reply to a message that you have already replied to. Defaults to false.
organization
If set, the the value is inserted into an `Organization:' header in the outgoing message. Defaults to the value of the ORGANIZATION environment variable.
outbound-folder
Gives the name of a folder in which to store a copy of all messages sent with af. The messages are stored with headers (except for a `Message-ID:') in the named folder, immediately after being sent. Default is unset (don't save messages).
outbound-threshold
Gives the maximum number of lines in a message body which should be silently saved to the outbound-folder. Af will prompt for confirmation that a message longer than this limit is to be saved. If set to 0 then all outbound messages will be saved regardless of length. Default is 100 lines.
preserve-cc-in-group-reply
If set to true, any Cc: header on a message is duplicated in an outgoing group-reply to that message, so that recipients of a carbon-copy will also receive the reply. Default is true.
real-name
Your real name, for inclusion in `From:' headers. Defaults to the value of the NAME environment variable, or your details stored in the file `/etc/passwd'.
reply-address
Contains a mail address which forms a `Reply-To:' header in all messages you send, so that replies to those messages will be sent to the address you specify. Default is unset.
signature-file
The name of your signature file. If the value begins with `ask:', then you will be prompted for the signature file to use, with any value after the `ask:' being used as a default. Defaults to `.signature' in your home directory.
signature-separator
A string which will be printed on a line between the body of an outgoing message and any automatically-included signature. If not set, then no separator line is printed. Defaults to `--'.
spell-checker
The program to use to interactively spell-check the body of a message before you send it. Defaults to `ispell -x' if ispell is installed on your system, or unset otherwise.


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

8.7 Defining and Using Mail Aliases

Af will let you set mail aliases. These are short mnemonic names which stand for mail addresses or groups of mail addresses. Like many other mail programs, af expands aliases when they occur in the `To:', `From:', `Cc:', `Bcc:', and `Reply-to:' headers.

The easiest way to define a mail alias within af is with C-x C-a (set-alias). Af will prompt for the alias and then the real name and the full address of the alias, defaulted from the From: header of the current message. If the alias already exists, af will prompt for confirmation that you want to change the alias. (2)

C-x C-a sets the alias internally; but it also writes the alias to the file `.afalias' in your home directory. This file is read whenever af starts up, so your aliases will be available next time you run af. You can also edit your `.afalias' file directly; each line should either be blank, be a comment beginning with `;', or look like:

 
alias:Real Name:addresses

alias is the name of the alias; Real Name is the real name of the person or group the alias represents, and addresses stands for one or more mail addresses for alias to expand into. Separate multiple addresses with spaces or (preferably) commas. You can make an address list span more than one line by starting the second and subsequent lines with a space or tab, in the same way as mail headers are split over several lines of text.

For instance, to make afbug stand for af-bug@csv.warwick.ac.uk put in these lines:

 
; Set up the af-bug mailing list as an alias
afbug:Af Bug Mailing List:af-bug@csv.warwick.ac.uk

Af expands aliases as soon as you finish editing the mail file, so you can check that the alias expanded properly by looking at the list of headers that af shows you when it prompts for the disposition of the mail.


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

This document was generated by Malc Arnold on August, 22 2002 using texi2html