Go to the first, previous, next, last section, table of contents.


Draft Buffer

At Summary mode, pressing w and the like creates a new draft buffer. You can edit and send mail and news articles in this buffer.

Tips

Basically it is Emacs-standard mail mode.

Address Completion

Initially, the cursor is at the `To:' field. Fill in recipients addresses. TAB completes them.

If you want to submit a news article, add `Newsgroups:' field by yourself. Field names can be completed by TAB.

If you save the draft buffer you are editing, it is appended to the folder specified by wl-draft-folder.

Using `FCC:' field, you can specify the folder to which a copy of the message is saved when it is sent.

Editing Messages

Multi-part editing utilize MIME edit mode of SEMI. For procedures of editing, refer to respective documents. See section `MIME-Edit' in a MIME user interface for GNU Emacs. You can also see help by C-c C-x ? in draft buffer.

Dynamic Modification of Messages

You can set wl-draft-config-alist so that header and body of the message will automatically modified depending on information of header and others.

The initial setting of wl-draft-config-alist is nil.

In the example below, the header is modified when wl-draft-send-and-exit or wl-draft-send is invoked. You can set wl-interactive-send to non-nil so as to confirm changes before sending the message.

(setq wl-draft-config-alist
      '(((string-match "aaa\\.example\\.com$" (system-name))
         ;; applied if the expression is non-nil
         (wl-smtp-posting-server . "mailserver-B")
         (wl-nntp-posting-server . "newsserver-B")
         ;; settings of temporary variables
         )
        ("^To: .*user@aaa\\.bbb\\.example\\.com"
         ;; applied if it matches the header of the draft buffer
         ("Organization" . (format "Go %s" my-webpage)))
                       ;; you can write elisp expressions here (eval only)
         (top . "Hello.\n")    ;; inserted at the top of the body
         (bottom . "\nBye.\n") ;; inserted at the bottom of the body
        ))

The format of wl-draft-config-alist is:

'(("regexp of the header" or elisp expression
  ("Field" . value(elisp expression))
   (variable . value(elisp expression))
   (sub-function . value(elisp expression))
   function
   ...)
  ("regexp of the header" or elisp expression
   ("Field" . value(elisp expression))
   ...))

Per default, there are 10 following sub-functions.

'header:      Inserts the specified string at the bottom of the header.
'header-top:  Inserts the specified string at the top of the header.
'header-file: Inserts the specified file at the bottom of the header.
'x-face:      Inserts `X-Face:' field with the content of the specified file.
'top:         Inserts the specified string at the top of the body.
'top-file:    Inserts the specified file at the top of the body.
'body:        Replaces the body with the specified string.
              Specifying nil deletes the entire body string.
'body-file:   Replaces the body with the content of the specified file.
'bottom:      Inserts the specified string at the bottom of the body.
'bottom-file: Inserts the specified file at the top of the body.
'part-top:  Inserts the specified string at the top of the current part.
'part-bottom: Inserts the specified string at the bottom of the current part.
'template:    Applies the specified template.
              (refer to the next subsection)

These are defined in wl-draft-config-sub-func-alist and you can change them or add your own functions. If you read the code, you can easily find how to write the functions.

At the first of each item, a regular expression of the header or an elisp expression should be specified. In the case of an elisp expression, the item is applied when the expression is evaluated non-nil.

Per default, when multiple items match or are evaluated non-nil, all such items are applied, but if you set a variable wl-draft-config-matchone to t, only the first matching one is applied.

At the second of the item, a cons or a list of functions should be specified. The car part of the cons should be a header field, a variable, or a sub-function. When a header field is specified, the field will be modified. If a variable is specified, the value of the variable will be modified temporarily.

In the cdr part of a cons, not only a variable but also an elisp expression can be specified as is. If the car part is a header field and the cdr part is nil, the field will be deleted.

If you want to use name of parent folder, you can refer the buffer local variable wl-draft-parent-folder.

See the next example as well:

(setq wl-draft-config-alist
      '((reply                         ;; (1)
         "X-ML-Name: \\(Wanderlust\\|emacs-mime-ja\\|apel-ja\\)"
         ;; applied if it matches the header of the buffer being replied
         (body . "  Hello.\n")
         (template . "default")
         )))

As in the (1) above, if a header regexp is prepended with reply, it is applied when the draft is prepared by wl-summary-reply for example, and when it matches the header being replied. It is ignored when there is no buffer being replied, like after wl-draft was invoked.

Note that wl-draft-config-alist is applied only once when wl-draft-send-and-exit or wl-draft-send is invoked. Therefore, if you want to apply wl-draft-config-alist again after aborting transmission, execute C-c C-e (wl-draft-config-exec) explicitly.

If you don't want to apply wl-draft-config-alist when wl-draft-send-and-exit or wl-draft-send is invoked, do the following:

(remove-hook 'wl-draft-send-hook 'wl-draft-config-exec)

If you want to apply wl-draft-config-alist when a draft buffer is prepared, do the following:

(add-hook 'wl-mail-setup-hook 'wl-draft-config-exec)

If you want to apply wl-draft-config-alist when you re-edit a mail from summary mode by typing E(wl-summary-reedit), do the following:

(add-hook 'wl-draft-reedit-hook 'wl-draft-config-exec)

Inserting Templates

Set a variable wl-template-alist, and type C-c C-j or M-x wl-template-select in the draft buffer.

The format of wl-template-alist is almost the same as wl-draft-config-alist.

(setq wl-template-alist
      '(("default"
         ("From" . wl-from)
         ("Organization" . "~/.wl sample")
         (body . "Hello.\n"))
        ("report"
         (template . "default")                 ;; (a)
         ("To" . "boss@example.com")
         ("Subject" . "Report")
         (body-file . "~/work/report.txt")
         )
        ))

As you can see, the only difference is item (template) names such as `default' and `report', instead of a regexp of header. Because definition of each item is the same as wl-draft-config-alist, you can call another template, like (a).

Executing the command wl-template-select results in template selection, but the result differs depending on variable wl-template-visible-select.

If wl-template-visible-select is t (default), a buffer window is shown below the draft buffer. You can select a template by n and p seeing the buffer window.

Press the RET key and the template is actually applied to the draft buffer. If you press q, nothing is applied. In addition, you can adjust the window size by wl-template-buffer-lines.

If wl-template-visible-select is nil, you should type the name of the template in the mini buffer.

As shown in the example in wl-draft-config-alist, you can select `default' template by writing:

(template . "default")

Sending mail by POP-before-SMTP

You can send mail by POP-before-SMTP with this single line:

(setq wl-draft-send-mail-function 'wl-draft-send-mail-with-pop-before-smtp)

Configure the following variables if you need.

wl-pop-before-smtp-user
The POP user name for POP-before-SMTP authentication. If unset, elmo-pop3-default-user is used.
wl-pop-before-smtp-server
The POP server name for POP-before-SMTP authentication. If unset, elmo-pop3-default-server is used.
wl-pop-before-smtp-authenticate-type
The POP authentication method for POP-before-SMTP authentication. If unset, elmo-pop3-default-authenticate-type is used.
wl-pop-before-smtp-port
The POP port number for POP-before-SMTP authentication. If unset, elmo-pop3-default-port is used.
wl-pop-before-smtp-stream-type
If non-nil, POP connection is established using SSL. If starttls, STARTTLS (RFC2595) connection will be established. If unset, elmo-pop3-default-stream-type is used.

If variables for POP-before-SMTP (wl-pop-before-smtp-*) are unset, settings for POP folders (elmo-pop3-default-*) are used. Therefore, if SMTP server and POP server are actually the same, and if POP folder per default (such as `&') is available, no settings are required.

Refer to the following URL about POP-before-SMTP.

http://spam.ayamura.org/tools/smPbS.html
http://www.iecc.com/pop-before-smtp.html

Key Bindings

C-c C-y
Cites the content of the current message buffer. (wl-draft-yank-original)
C-c C-p
Previews the content of the current draft. This is useful for previewing MIME multi-part messages. (wl-draft-preview-message)
C-c C-s
Sends the content of the current draft. Does not erase the draft buffer. This is useful for sending multiple messages, which are a little different from each other. (wl-draft-send)
C-c C-c
Sends the content of the current draft and erases the draft buffer. (wl-draft-send-and-exit)
C-x C-s
Save the current draft. (wl-draft-save)
C-c C-k
Kills the current draft. (wl-draft-kill)
C-x k
Kills the current draft. (wl-draft-mimic-kill-buffer)
C-c C-z
Saves the current draft, and erases the draft buffer. This is useful if you want to suspend editing of the draft. You can resume editing by pressing E (wl-summary-reedit) in the `+draft' folder. (wl-draft-save-and-exit)
C-c C-r
Encodes or decodes the specified region in Caesar cipher. (wl-caesar-region)
C-l
Recenter and rehighlight current draft. (wl-draft-highlight-and-recenter)
M-t
Toggles off-line/on-line states of Wanderlust. (wl-toggle-plugged)
C-c C-o
Jumps to the other draft buffer, if exists. With prefix argument, reads a file (if any) from the draft folder when there is no such buffer. (wl-jump-to-draft-buffer)
C-c C-e
Applies wl-draft-config-alist. (wl-draft-config-exec)
C-c C-j
Selects a template. (wl-template-select)
C-c C-a
Enter Address Manager. See section Address Manager. (wl-addrmgr)
C-c C-d
Elide the text between point and mark (wl-draft-elide-region). The text is killed and replaced with the contents of the variable wl-draft-elide-ellipsis. The default value is to use an ellipsis (`[...]').

Customizable Variables

wl-subscribed-mailing-list
The initial setting is nil. Mailing lists to which you subscribe. If any of these are contained in `To:' or `Cc:' field of a reply draft, removes your own address from `Mail-Followup-To:' and `Cc:'. And if any of these are contained in `To:' or `Cc:' field of a message to be automatically re-filed, the destination folder will be leaned in connection with the address. Example:
(setq wl-subscribed-mailing-list
      '("wl@lists.airs.net"
        "apel-ja@m17n.org"
        "emacs-mime-ja@m17n.org"))
wl-insert-mail-followup-to
The initial setting is nil. If non-nil, `Mail-Followup-To:' field is automatically inserted in the draft buffer.
wl-insert-mail-reply-to
The initial setting is nil. If non-nil, `Mail-Reply-To:' field is automatically inserted in the draft buffer.
wl-auto-insert-x-face
The initial setting is t. If non-nil and there is an encoded X-Face string in a file `~/.xface' (the value of the variable wl-x-face-file), inserts it as an `X-Face:' field in the draft buffer. If nil, it is not automatically inserted.
wl-insert-message-id
The initial setting is t. If non-nil, `Message-ID:' field is automatically inserted on the transmission.
wl-local-domain
The initial setting is nil. If nil, the return value of the function system-name will be used as the domain part of `Message-ID:'. If system-name does not return FQDN (i.e. the full name of the host, like `smtp.gohome.org'), you must set this variable to the string of the local domain name without hostname (like `gohome.org'). That is, a concatenation of system-name `.' wl-local-domain is used as domain part of the `Message-ID:'. If your terminal does not have global IP, set the value of wl-message-id-domain. (You might be beaten up on the Net News if you use invalid `Message-ID:'.) Moreover, concatenation of system-name `.' wl-local-domain will be used as an argument to the HELO command in SMTP.
wl-message-id-domain
The initial setting is nil. If non-nil, this value is used as a domain part of the `Message-ID:'. If your terminal does not have global IP address, set unique string to this value (e.x. your e-mail address).
wl-message-id-domain
The initial setting is nil. If nil, the return value of the function system-name will be used as the domain part of `Message-ID:'. If system-name does not return FQDN (i.e. the full name of the host, like `smtp.gohome.org'), you must set this variable to the string of the full name of the host. Otherwise, you might be beaten up on the Net News.
wl-draft-config-alist
The initial setting is nil. Modifies the draft message just before the transmission. The content of wl-draft-config-alist will be automatically applied only once on the transmission. If you want to apply it manually, use C-c C-e. This command can be used many times.
wl-template-alist
The initial setting is nil. This variable specifies the template to be applied in the draft buffer.
wl-draft-config-matchone
The initial setting is nil. If non-nil, only the first matching item is used when wl-draft-config-alist is applied. If nil, all matching items are used.
wl-template-visible-select
The initial setting is t. If non-nil, you can preview the result of the template selection in another window.
wl-template-confirm
The initial setting is nil. If non-nil, asks for confirmation when you press the enter key to select template while previewing.
wl-template-buffer-lines
The initial setting is 7. If wl-template-visible-select is non-nil, this variable specifies the size of the preview window.
wl-draft-reply-buffer-style
The initial setting is split. split or full can be specified. In the case of full, the whole frame will be used for a reply draft buffer when it is prepared.
wl-draft-use-frame
The initial setting is nil. If non-nil, use new frame for the draft.
wl-draft-truncate-lines
The initial value is the value of default-truncate-lines. If it is non-nil, truncate long lines in draft buffer.
wl-from
The initial setting is the value of the variable user-mail-address. The value of this variable is inserted as a `From:' field of the draft when it is prepared.
wl-envelope-from
The initial setting is nil. The value of this variable is used for envelope from (MAIL FROM). If nil, the address part of wl-from is used.
wl-user-mail-address-list
The initial setting is nil. This is the User's address list. If you have multiple addresses, set this variable.
wl-fcc
The initial setting is nil. If non-nil, the value of this variable is inserted as a `Fcc:' of the draft when it is prepared. If function is specified, its return value is used.
wl-bcc
The initial setting is nil. If non-nil, the value of this variable is inserted as a `Bcc:' of the draft when it is prepared.
wl-reply-subject-prefix
The initial setting is `Re: '. In the `Subject:' of the reply draft, this string is prepended to the `Subject:' of being replied.
wl-draft-reply-use-address-with-full-name
The initial setting is t. If non-nil, insert her full name with address when prepare a draft for reply a message. If it is nil, insert her address only.
wl-draft-enable-queuing
The initial setting is t. This flag controls off-line transmission. If non-nil, the draft is sent off-line.
wl-draft-use-cache
The initial setting is nil. If the value is non-nil and wl-insert-message-id is nil, cache the message which is sent.
wl-fcc-force-as-read
The initial setting is nil. If the value is non-nil, Mark as read the message saved by `Fcc:' (only for IMAP folders).
wl-auto-flush-queue
The initial setting is t. This flag controls automatic transmission of the queue when Wanderlust becomes on-line. If non-nil, the queue is automatically transmitted (with confirmation by y-or-n-p). If you want to transmit it manually, press F in the folder mode.
wl-ignored-forwarded-headers
Initial setting is `\\(received\\|return-path\\|x-uidl\\)'. All headers that match this regexp will be deleted when forwarding a message.
wl-ignored-resent-headers
Initial setting is `\\(return-receipt\\|[bdf]cc\\)'. All headers that match this regexp will be deleted when resending a message.
wl-draft-always-delete-myself
If non-nil, always removes your own address from `To:' and `Cc:' when you are replying to the mail addressed to you.
wl-draft-delete-myself-from-bcc-fcc
If any of wl-subscribed-mailing-list are contained in `To:' or `Cc:' field, do not insert `Bcc:' or `FCC:' field.
wl-smtp-posting-server
The initial setting is nil. This is the SMTP server name for mail transmission.
wl-smtp-posting-user
The initial setting is nil. This is the user name for SMTP AUTH authentication. If nil, smtp-authenticate-user is used.
wl-smtp-authenticate-type
The initial setting is nil. This is the authentication method for SMTP AUTH authentication. If nil, smtp-authenticate-type is used. If smtp-authenticate-type is still nil, authentication will not be carried out.
wl-smtp-connection-type
The initial setting is nil. This variable specifies how to establish SMTP connections. If nil, smtp-connection-type is used. If it is starttls, STARTTLS (RFC2595) is used.
wl-nntp-posting-server
The initial setting is nil. This is the NNTP server name used for news submission. If nil, elmo-nntp-default-server is used.
wl-nntp-posting-user
The initial setting is nil. This is the user name for AUTHINFO authentication on news submission. If nil, elmo-nntp-default-user is used. If it is still nil, AUTHINFO authentication will not be carried out.
wl-nntp-posting-port
The initial setting is nil. This is the port number of the NNTP server used for news submission. If nil, elmo-nntp-default-server is used.
wl-nntp-posting-stream-type
The initial setting is nil. If nil, elmo-nntp-default-stream-type is evaluated. If non-nil, SSL is used for news submission. If starttls, STARTTLS (RFC2595) connection will be established.
wl-pop-before-smtp-user
The initial setting is nil. This is the POP user name for POP-before-SMTP. If it is nil, elmo-pop3-default-user is used.
wl-pop-before-smtp-server
The initial setting is nil. This is the POP server name for POP-before-SMTP. If it is nil, elmo-pop3-default-server is used.
wl-pop-before-smtp-authenticate-type
The initial setting is nil. This is the authentication method for POP-before-SMTP authentication. If it is nil, elmo-pop3-default-authenticate is used.
wl-pop-before-smtp-port
The initial setting is nil. This is the POP port number for POP-before-SMTP. If it is nil, elmo-pop3-default-port is used.
wl-pop-before-smtp-stream-type
The initial setting is nil. This flag controls the use of SSL for POP-before-SMTP. If it is nil, elmo-pop3-default-stream-type is used. If starttls, STARTTLS (RFC2595) connection will be established.
wl-draft-queue-save-variables
Specifies a list of variable to which queued messages are saved on the off-line transmission.
wl-draft-sendlog
The initial setting is t. If t, transmission log is written in `~/.elmo/sendlog'. It is written when: (it is written even if the transmission fails). But transmission by `im-wl.el' is not written in the `sendlog' and left to the logging function of @command{imput}.
wl-draft-sendlog-max-size
The initial setting is 20000 (in bytes). If wl-draft-sendlog is t, the log is rotated when it grows beyond the size specified by this variable.
wl-use-ldap
The initial setting is nil. If non-nil, address completion uses LDAP.
wl-ldap-server
The initial setting is `localhost'. LDAP server name for address completion.
wl-ldap-port
The initial setting is nil. If non-nil, the value is used as port number.
wl-ldap-base
The initial setting is `c=US'. LDAP search starting point (base) for address completion.
wl-draft-remove-group-list-contents
The initial setting is t. If non-nil, remove the group-lists' members in the recipients when sending the message (group-list means the description such as `Group: foo@gohome.org, bar@gohome.org;' in the recipients).


Go to the first, previous, next, last section, table of contents.