www.delorie.com/gnu/docs/emacs/gnus_186.html   search  
 
Buy the book!


Gnus Manual

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

6.5.6 IMAP

IMAP is a network protocol for reading mail (or news, or...), think of it as a modernized NNTP. Connecting to a IMAP server is much similar to connecting to a news server, you just specify the network address of the server.

IMAP has two properties. First, IMAP can do everything that POP can, it can hence be viewed as POP++. Secondly, IMAP is a mail storage protocol, similar to NNTP being a news storage protocol. (IMAP offers more features than NNTP because news is more or less read-only whereas mail is read-write.)

If you want to use IMAP as POP++, use an imap entry in mail-sources. With this, Gnus will fetch mails from the IMAP server and store them on the local disk. This is not the usage described in this section. See section 6.3.4 Mail Sources.

If you want to use IMAP as a mail storage protocol, use an nnimap entry in gnus-secondary-select-methods. With this, Gnus will manipulate mails stored on the IMAP server. This is the kind of usage explained in this section.

A server configuration in ~/.gnus with a few IMAP servers might look something like this:

 
(setq gnus-secondary-select-methods 
      '((nnimap "simpleserver") ; no special configuration
        ; perhaps a ssh port forwarded server:
        (nnimap "dolk"
                (nnimap-address "localhost")
                (nnimap-server-port 1430))
        ; a UW server running on localhost
        (nnimap "barbar"
                (nnimap-server-port 143)
                (nnimap-address "localhost")
                (nnimap-list-pattern ("INBOX" "mail/*")))
        ; anonymous public cyrus server:
        (nnimap "cyrus.andrew.cmu.edu"
                (nnimap-authenticator anonymous)
                (nnimap-list-pattern "archive.*")
                (nnimap-stream network))
        ; a ssl server on a non-standard port:
        (nnimap "vic20"
                (nnimap-address "vic20.somewhere.com")
                (nnimap-server-port 9930)
                (nnimap-stream ssl))))

The following variables can be used to create a virtual nnimap server:

nnimap-address

The address of the remote IMAP server. Defaults to the virtual server name if not specified.

nnimap-server-port
Port on server to contact. Defaults to port 143, or 993 for SSL.

Note that this should be a integer, example server specification:

 
(nnimap "mail.server.com"
        (nnimap-server-port 4711))

nnimap-list-pattern
String or list of strings of mailboxes to limit available groups to. This is used when the server has very many mailboxes and you're only interested in a few -- some servers export your home directory via IMAP, you'll probably want to limit the mailboxes to those in `~/Mail/*' then.

The string can also be a cons of REFERENCE and the string as above, what REFERENCE is used for is server specific, but on the University of Washington server it's a directory that will be concatenated with the mailbox.

Example server specification:

 
(nnimap "mail.server.com"
        (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*" 
                               ("~friend/Mail/" . "list/*"))))

nnimap-stream
The type of stream used to connect to your server. By default, nnimap will detect and automatically use all of the below, with the exception of SSL. (SSL is being replaced by STARTTLS, which can be automatically detected, but it's not widely deployed yet).

Example server specification:

 
(nnimap "mail.server.com"
        (nnimap-stream ssl))

Please note that the value of nnimap-stream is a symbol!

The imtest program is shipped with Cyrus IMAPD. Nnimap supports both imtest version 1.5.x and version 1.6.x. The variable imap-kerberos4-program contains parameters to pass to the imtest program.

For SSL connections, the OpenSSL program is available from http://www.openssl.org/. OpenSSL was formerly known as SSLeay, and nnimap supports it too. However, the most recent versions of SSLeay, 0.9.x, are known to have serious bugs making it useless. Earlier versions, especially 0.8.x, of SSLeay are known to work. The variable imap-ssl-program contains parameters to pass to OpenSSL/SSLeay.

For IMAP connections using the shell stream, the variable imap-shell-program specifies what program to call.

nnimap-authenticator

The authenticator used to connect to the server. By default, nnimap will use the most secure authenticator your server supports.

Example server specification:

 
(nnimap "mail.server.com"
        (nnimap-authenticator anonymous))

Please note that the value of nnimap-authenticator is a symbol!

nnimap-expunge-on-close
Unlike Parmenides, the IMAP designers decided that things that don't exist actually do exist. More specifically, IMAP has the concept of marking articles Deleted which doesn't actually delete them, and this (marking them Deleted, that is) is what nnimap does when you delete a article in Gnus (with G DEL or similar).

Since the articles aren't really removed when we mark them with the Deleted flag we'll need a way to actually delete them. Feel like running in circles yet?

Traditionally, nnimap has removed all articles marked as Deleted when closing a mailbox but this is now configurable by this server variable.

The possible options are:

always
The default behavior, delete all articles marked as "Deleted" when closing a mailbox.
never
Never actually delete articles. Currently there is no way of showing the articles marked for deletion in nnimap, but other IMAP clients may allow you to do this. If you ever want to run the EXPUNGE command manually, See section 6.5.6.3 Expunging mailboxes.
ask
When closing mailboxes, nnimap will ask if you wish to expunge deleted articles or not.

nnimap-authinfo-file

A file containing credentials used to log in on servers. The format is (almost) the same as the ftp `~/.netrc' file. See `nntp-authinfo-file' for exact syntax.

A file containing credentials used to log in on servers. The format is (almost) the same as the ftp `~/.netrc' file. See the variable nntp-authinfo-file for exact syntax; also see See section 6.2.1 NNTP.

6.5.6.1 Splitting in IMAP  Splitting mail with nnimap.
6.5.6.2 Editing IMAP ACLs  Limiting/enabling other users access to a mailbox.
6.5.6.3 Expunging mailboxes  Equivalent of a "compress mailbox" button.


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

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)