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 a POP++. Secondly, IMAP is a mail storage protocol, similar to NNTP being a news storage protocol -- however, 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 a 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 the following. (Note that for SSL/TLS, you
need external programs and libraries, see below.)
(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
nnimap-server-port
(nnimap "mail.server.com" (nnimap-server-port 4711))
nnimap-list-pattern
(nnimap "mail.server.com" (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*" ("~friend/Mail/" . "list/*"))))
nnimap-stream
(nnimap "mail.server.com" (nnimap-stream ssl))Please note that the value of
nnimap-stream
is a symbol!
imap-process-connection-type
to make imap.el
use a pty instead of a pipe when communicating
with `imtest'. You will then suffer from a line length
restrictions on IMAP commands, which might make Gnus seem to hang
indefinitely if you have many articles in a mailbox. The variable
imap-kerberos4-program
contain 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 support it too - altough 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
contain parameters to pass
to OpenSSL/SSLeay. You also need `ssl.el' (from the W3
distribution, for instance).
For IMAP connections using the shell
stream, the variable
imap-shell-program
specify what program to call.
nnimap-authenticator
(nnimap "mail.server.com" (nnimap-authenticator anonymous))Please note that the value of
nnimap-authenticator
is a symbol!
imtest
.
imtest
.
digest-md5.el
.
nnimap-expunge-on-close
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
never
ask
nnimap-importantize-dormant
(setcdr (assq 'dormant nnimap-mark-to-flag-alist) (format "gnus-dormant-%s" (user-login-name))) (setcdr (assq 'dormant nnimap-mark-to-predicate-alist) (format "KEYWORD gnus-dormant-%s" (user-login-name)))In this case, you would not want the per-user dormant flag showing up as ticked for other users.
nnimap-expunge-search-string
"UID %s NOT SINCE %s"
, where the first %s
is replaced by
UID set and the second %s
is replaced by a date.
Probably the only useful value to change this to is
"UID %s NOT SENTSINCE %s"
, which makes nnimap use the Date: in
messages instead of the internal article date. See section 6.4.4 of
RFC 2060 for more information on valid strings.
nnimap-authinfo-file
ftp
`~/.netrc' file. See the
variable nntp-authinfo-file
for exact syntax; also see
section 6.2.1 NNTP.
Go to the first, previous, next, last section, table of contents.