From 5cba7ab897d2148b68826379218ce15f115d06c5 Mon Sep 17 00:00:00 2001 From: Sam Varshavchik Date: Thu, 18 Feb 2021 08:28:11 -0500 Subject: Replace FAM/Gamin with inotify --- imap/Makefile.am | 6 +- imap/imapd.sgml | 201 +++++++++++++++++++------------------------------------ 2 files changed, 69 insertions(+), 138 deletions(-) (limited to 'imap') diff --git a/imap/Makefile.am b/imap/Makefile.am index dda6235..a363bc1 100644 --- a/imap/Makefile.am +++ b/imap/Makefile.am @@ -74,11 +74,9 @@ imapd_SOURCES=fetch.c fetchinfo.c fetchinfo.h imapd.c imapd.h \ search.c searchinfo.c searchinfo.h \ storeinfo.c storeinfo.h -imapd_DEPENDENCIES=libimapd.la \ - ../maildir/maildir.libdeps @dblibrary@ +imapd_DEPENDENCIES=libimapd.la @dblibrary@ -imapd_LDADD=libimapd.la `cat ../maildir/maildir.libdeps` \ - @dblibrary@ @DEBUGLIB@ @LDAUTH@ -lcourierauth +imapd_LDADD=libimapd.la @dblibrary@ @DEBUGLIB@ @LDAUTH@ -lcourierauth pop3login_SOURCES=pop3login.c pop3dcapa.c proxy.c proxy.h pop3login_DEPENDENCIES=../tcpd/libspipe.la ../tcpd/libspipe.la libpop3d.la diff --git a/imap/imapd.sgml b/imap/imapd.sgml index 43b8ec3..6df09cf 100644 --- a/imap/imapd.sgml +++ b/imap/imapd.sgml @@ -1,5 +1,5 @@ - + SamVarshavchikAuthorCourier Mail Server @@ -12,12 +12,12 @@ imapd - The Courier IMAP server + The Courier IMAP server - @libexecdir@/couriertcpd + @libexecdir@/couriertcpd couriertcpd options @prefix@/sbin/imaplogin modules @@ -26,7 +26,7 @@ - @prefix@/bin/imapd + @prefix@/bin/imapd ./Maildir @@ -35,48 +35,48 @@ DESCRIPTION -imapd is the Courier +imapd is the Courier IMAP server that provides IMAP access to Maildir mailboxes. -Normally you don't have to worry about it, as imapd +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 +couriertcpd opens network ports that receive incoming IMAP connections. After an incoming network connections is established, -couriertcpd +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, +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 +are Courier server authentication modules described in the authlib7 manual page. The last daisy-chained command is -imapd, which is the actual IMAP server, +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 +The sole argument to imapd is the pathname to the default IMAP mailbox, which is usually -./Maildir. +./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 +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 +imapd implements IMAP4REV1, as defined by RFC 2060. @@ -89,11 +89,11 @@ variable, then attempts to talk IMAP on standard input and output. AUTH* -imapd examines several environment variables whose +imapd examines several environment variables whose names start with AUTH - these environment variables are set by -imaplogin and the authentication modules. +imaplogin and the authentication modules. Their absence tells -imapd that it's running from the command line. +imapd that it's running from the command line. @@ -103,15 +103,15 @@ Their absence tells MAILDIR - if defined, -imapd changes its directory to the +imapd changes its directory to the one specified by this environment variable. -Otherwise imapd changes +Otherwise imapd changes its directory to the one specified on the command line. - `pwd`/. + `pwd`/. The current directory is assumed to be the main INBOX @@ -120,7 +120,7 @@ Maildir. - `pwd`/.folder + `pwd`/.folder Maildir folders, each one containing their own @@ -131,25 +131,25 @@ tmp, new, cur, etc... Other environment variables are initialized from the -@sysconfdir@/imapd and -@sysconfdir@/imapd-ssl configuration files. +@sysconfdir@/imapd and +@sysconfdir@/imapd-ssl configuration files. These files are loaded into the environment by the system startup script -that runs couriertcpd. +that runs couriertcpd. Realtime concurrent folder status updates -Setting the IMAP_ENHANCEDIDLE to -1 in -@sysconfdir@/imapd enables realtime concurrent folder +Setting the IMAP_ENHANCEDIDLE to +1 in +@sysconfdir@/imapd enables realtime concurrent folder status updates. When relatime folder status updates are enabled all IMAP mail clients that have the same folder open will be immediately notified of any changes to the folder's contents. -The Courier IMAP server always allows +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 @@ -161,79 +161,24 @@ 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 +The IDLE extension to the base IMAP protocol provides a delivery mechanism for notifying mail clients of changes to the mail folder's contents. Although at this time it's not known to which extent -the IDLE extension is supported by IMAP mail clients, -the Courier IMAP server fully implements -the IDLE +the IDLE extension is supported by IMAP mail clients, +the Courier IMAP server fully implements +the IDLE extension provided that the following requirements are met: - Gamin or FAM + IDLE IMAP capability -Either Gamin or -FAM -must be properly installed and -configured prior to installing -the Courier IMAP server. - - -Gamin/FAM -is an application library that -provides an interface to the operating system's kernel -that applications can use to be notified when specific files -or directories are changed, and the -Courier IMAP server leverages this API to -implement realtime concurrent folder status updates. -According to the most recently available documentation, -Gamin is a Linux-specific library, and -FAM -builds and runs on Linux and IRIX. -FAM -should also build on other platforms, but without a supported kernel monitor -FAM will fall back to a polling mode. -At press time, -FAM's -web site reports that -FAM -succesfully builds (in polling mode) on FreeBSD and Solaris. - - -FAM (but not Gamin) -also works with NFS filesystems. -On NFS clients fam transparently forwards file monitoring -requests to a peer fam process on the NFS server. - - -Installation and configuration of -Gamin or -FAM is beyond -the scope of this document. This documentation presumes that Gamin or FAM is -succesfully installed. Use the resources and tools on -Gamin's or -FAM's web site -for assistance with setting them up. -Systems that use GNOME or KDE desktops already have -FAM or -Gamin -installed, as -FAM or Gamin -is used by the current versions of both desktops. - - - - - IDLE IMAP capability - - -IDLE +IDLE must be listed in the IMAP_CAPABILITY -setting in the @sysconfdir@/imapd +setting in the @sysconfdir@/imapd configuration file. @@ -242,7 +187,7 @@ configuration file. IMAP_USELOCKS -This setting in @sysconfdir@/imapd +This setting in @sysconfdir@/imapd must be enabled. This setting uses dot-lock files to synchronize updates to folder indexes between multiple IMAP clients that have the same folder opened. @@ -256,13 +201,13 @@ daemon. An IMAP mail client that fully supports the -IDLE +IDLE protocol extension. -Of course, an IMAP client that supports the IDLE +Of course, an IMAP client that supports the IDLE protocol extension is required. -At press time the status and extent of IDLE support +At press time the status and extent of IDLE support in most IMAP mail clients is not known. @@ -271,14 +216,12 @@ in most IMAP mail clients is not known. IMAP_ENHANCEDIDLE -This setting in @sysconfdir@/imapd +This setting in @sysconfdir@/imapd actually enables concurrent realtime folder status updates using the -IDLE extension. -Note that it is possible to enable the IDLE extension -even if -FAM or -Gamin -is not available, or without +IDLE extension and the inotify kernel interface. +Note that it is possible to enable the IDLE extension +even when Courier-IMAP is compiled on a platform without the inotify +kernel interface, or without enabling either the IMAP_USELOCKS and/or IMAP_ENHANCEDIDLE settings. The resulting consequences are described are as follows: @@ -297,9 +240,9 @@ confusion that results from this situation. -Without FAM or Gamin, and +Without inotify kernel interface, and IMAP_ENHANCEDIDLE set, the -Courier IMAP server will +Courier IMAP server will manually check for changes to the folder's contents every 60 seconds, in IDLE mode (instead of in real time). @@ -321,8 +264,8 @@ 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 +The following instructions use "C:" to indicate IMAP +client commands that must be entered, and "S:" to indicate the expected replies from the server. @@ -360,11 +303,11 @@ S:+ entering ENHANCED idle mode -The default Courier IMAP server +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 -@sysconfdir@/imapd +@sysconfdir@/imapd for the duration of this test. @@ -374,14 +317,7 @@ for the duration of this test. The last message from the server must be "entering ENHANCED idle mode". Otherwise, it means that some of the necessary prerequisites have not been -met. -Verify that FAM -or Gamin was set up prior to installing -The Courier IMAP server -(use ldd1 -to verify that the imapd executable is linked with -the libfam library), and verify the settings in the -@sysconfdir@/imapd. +met. @@ -410,14 +346,11 @@ a OK STORE completed. -The last command sets the \Deleted flag on the first +The last command sets the \Deleted flag on the first message in the folder. Immediately after entering the last command, -"* 1 FETCH (FLAGS (\Deleted))" should also appear +"* 1 FETCH (FLAGS (\Deleted))" should also appear in all other terminal windows. -On systems where FAM uses the fall-back polling -mode this response may appear after a brief delay of a few seconds. -The delay should never exceed 15-20 seconds. @@ -425,9 +358,9 @@ The delay should never exceed 15-20 seconds. Verify that all terminal windows reliably receive folder status updates in real time by alternatively entering the commands -"a STORE 1 -FLAGS (\Deleted)" +"a STORE 1 -FLAGS (\Deleted)" and -"a STORE 1 +FLAGS (\Deleted)", +"a STORE 1 +FLAGS (\Deleted)", to toggle the deleted flag on the first message. Observe that the message is received by all terminal windows quickly, and reliably. @@ -435,8 +368,8 @@ and reliably. -With the \Deleted flag set on the first message, -enter the EXPUNGE command, which removes the deleted +With the \Deleted flag set on the first message, +enter the EXPUNGE command, which removes the deleted message from the folder: @@ -450,7 +383,7 @@ 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 +windows may have a different RECENT message, which is fine). @@ -470,13 +403,13 @@ messages should appear in every terminal window: 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 +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. +\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. +all terminal windows have the same EXISTS message. @@ -487,7 +420,7 @@ all terminal windows have the same EXISTS mes authlib7, - + userdb8 -- cgit v1.2.3