table of contents
IMAPD(8) | Double Precision, Inc. | IMAPD(8) |
NAME¶
imapd - The Courier IMAP server
SYNOPSIS¶
/usr/lib/courier-imap/couriertcpd {couriertcpd options} {/usr/sbin/imaplogin} [modules...] {/usr/sbin/imapd} {./Maildir}
/usr/sbin/imapd {./Maildir}
DESCRIPTION¶
imapd is the Courier IMAP server that provides IMAP access to Maildir mailboxes. Normally you don't have to worry about it, as imapd runs automatically after receiving a network connection, accompanied by the appropriate userid and password.
couriertcpd opens network ports that receive incoming IMAP connections. After an incoming network connections is established, couriertcpd runs the command specified by its first argument, which is imaplogin passing the remaining arguments to imaplogin. imaplogin reads the IMAP login userid and password, then runs the modules specified by its remaining options, which are Courier server authentication modules described in the authlib(7)[1] manual page.
The last daisy-chained command is imapd, which is the actual IMAP server, which is started from the logged-in account's home directory. The sole argument to imapd is the pathname to the default IMAP mailbox, which is usually ./Maildir. Some authentication modules are capable of specifying a different filename, by setting the MAILDIR environment variable.
imapd may also be invoked from the shell prompt, in which case it issues a PREAUTH response, then changes the current directory to either its argument, or the contents of the MAILDIR environment variable, then attempts to talk IMAP on standard input and output.
imapd implements IMAP4REV1, as defined by RFC 2060[2].
FILES AND ENVIRONMENT VARIABLES¶
AUTH*
MAILDIR
`pwd`/.
`pwd`/.folder
Other environment variables are initialized from the /etc/courier/imapd and /etc/courier/imapd-ssl configuration files. These files are loaded into the environment by the system startup script that runs couriertcpd.
Realtime concurrent folder status updates¶
The Courier IMAP server always allows more than one mail client to have the same folder opened. However, when two or more clients have the same folder opened, the mail clients may not necessarily know when another client added or removed messages from the folder. The base IMAP protocol specification requires IMAP mail clients to explicitly check for any changes to the folder's contents. No provisions exists to notify the mail client immediately when the folder's contents are modified by another mail client.
The IDLE extension to the base IMAP protocol provides a delivery mechanism for notifying mail clients of changes to the mail folder's contents.
IDLE IMAP capability
IMAP_USELOCKS
This setting is safe to use with NFS, as it does not use actual file locking calls, and does not require the services of the problematic NFS lock daemon.
An IMAP mail client that fully supports the IDLE protocol extension.
Without inotify kernel interface, the Courier IMAP server will manually check for changes to the folder's contents every 60 seconds, in IDLE mode (instead of in real time).
Verifying realtime concurrent folder status updates¶
Use the following procedure to verify that realtime concurrent folder status updates are properly working. It is helpful to be familiar with the IMAP protocol. If that's not the case, just be extra careful in entering the IMAP protocol commands. The following instructions describe the procedure for connecting to the IMAP server, and manually issuing IMAP protocol commands, as if they originate from an IMAP client. The following instructions use "C:" to indicate IMAP client commands that must be entered, and "S:" to indicate the expected replies from the server.
Note
The actual replies from the server may differ slightly, due to the actual server configuration, and other minor factors. The following examples have long lines wrapped for readability. Slight observed differences from the expected replies are normal, but they should still be substantively the same.
S:* OK Courier-IMAP ready. Copyright 1998-2021 Double Precision, Inc.
See COPYING for distribution information. C:a login userid password S:a OK LOGIN Ok. C:a SELECT INBOX S:* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)]
Limited
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 939609418] Ok
a OK [READ-WRITE] Ok C:a IDLE S:+ entering ENHANCED idle mode
Note
The default Courier IMAP server configuration permits a maximum of four connections from the same IP address. It may be necessary to adjust this setting in /etc/courier/imapd for the duration of this test.
S:* OK Courier-IMAP ready. Copyright 1998-2021 Double Precision, Inc.
See COPYING for distribution information. C:a login userid password S:a OK LOGIN Ok. C:a SELECT INBOX S:* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)]
Limited
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 939609418] Ok
a OK [READ-WRITE] Ok C:STORE 1 +FLAGS (\Deleted) * 1 FETCH (FLAGS (\Deleted)) a OK STORE completed.
C:a EXPUNGE S:* 1 EXPUNGE
* 2 EXISTS
* 0 RECENT S:a OK EXPUNGE completed
The lines that begin with the "*" character should also appear in all other terminal windows (depending on the initial folder state one of the terminal windows may have a different RECENT message, which is fine).
* 3 EXISTS * 0 RECENT * 3 FETCH (FLAGS ())
The numbers in these messages may be different, depending upon the initial contents of the test mail folder. One of the terminal windows should have a different RECENT count, and one of the terminal windows should include a \Recent flag in the untagged FLAGS message. These difference are acceptable; the important thing is to make sure that all terminal windows have the same EXISTS message.
SEE ALSO¶
authlib(7)[1], userdb(8)[3]
AUTHOR¶
Sam Varshavchik
NOTES¶
- 1.
- authlib(7)
- 2.
- RFC 2060
- 3.
- userdb(8)
03/02/2021 | Courier Mail Server |