VM can also use the IMAP protocol to access a mailbox on a remote
host. As with POP, instead of specifying a spool file name in
vm-spool-files definition, you would give a string that tells
VM host to access to remote maildrop.
An IMAP maildrop specification has the following format:
HOST is the host name of the IMAP server.
PORT is the TCP port number to connect to (should normally be 143).
MAILBOX is the name of the mailbox on the IMAP server. This should
"inbox"', to access your default IMAP maildrop on the
AUTH is the authentication method used to convince the server
you should have access to the maildrop. Acceptable values are
"preauth"' and `
"preauth"' causes VM to skip the
authentication stage of the protocol with the assumption that
the session was authenticated in some way external to VM. The
vm-imap-session-preauth-hook is run, and it is
expected to return a process connected to an authenticated
session. The other value, `
"login"', tells VM to use the IMAP LOGIN
command for authentication.
USER is the user name sent to the server for `
PASSWORD is the secret shared by you and the server for
authentication purposes. If the PASSWORD is `
will prompt you for the password the first time you try to
retrieve mail from the maildrop. If the password is valid, VM
will not ask you for the password again during this Emacs
By default VM will retrieve all the messages from a IMAP maildrop
before returning control of Emacs to you. If the maildrop is
large, the wait could be considerable. If you set
vm-imap-max-message-size to a positive numeric value, VM will not
automatically retrieve messages larger than this size. If VM is
retrieving messages because you invoked
interactively, then VM will ask whether it should retrieve the
large message. If VM is retrieving messages automatically
vm-auto-get-new-mail is set non-
nil) then VM will skip the
large message and you can retrieve it later.
vm-imap-messages-per-session controls how many messages
VM will retrieve from a IMAP maildrop before returning control to
you. Similarly, the variable
vm-imap-bytes-per-session limits the
number of bytes VM will retrieve from a IMAP maildrop before returning
control to you. By default, the value of both variables is nil, which
tells VM to retrieve all the messages in the IMAP maildrop regardless
of how many messages there are and how large the maildrop is.
After VM retrieves messages from the maildrop, the default action
is to delete the messages from there. If you want VM to leave
messages in the remote maildrop until you explicitly request
their removal, set
nil. Messages will not be removed from the maildrop until you
vm-expunge-imap-messages; only those messages that VM has
retrieved into the current folder will be expunged.
vm-imap-auto-expunge-alist gives you a way to specify
on a per-maildrop basis which IMAP maildrops have message
automatically removed when retrieved and which ones leave the
messages on the IMAP server. The value of
vm-imap-auto-expunge-alist should be a list of IMAP mailboxes and
values specifying whether messages should be automatically
deleted from the mailbox after retrieval. The format of the list
((MAILBOX . VAL) (MAILBOX . VAL) ...)
MAILBOX should be an IMAP maildrop specification as described
in the documentation for the variable
you have the IMAP password specified in the
entry, you do not have to specify it here as well. Use `
instead; VM will still understand that this mailbox is the same as
the one in
vm-spool-files that contains the password.
VAL should be
nil if retrieved messages should be left in the
corresponding IMAP mailbox,
t if retrieved messages should be
removed from the mailbox immediately after retrieval.
Here is an example:
(setq vm-imap-auto-expunge-alist '( ;; leave message on the server ("imap:odin.croc.net:143:inbox:login:kyle:*" . nil) ;; expunge immediately ("imap:hilo.harkie.org:143:inbox:login:kyle:*" . t) ) )