Sun Java System Messaging Server 6.3 Administration Guide

5.6 To Configure IMAP Services

You can perform basic configuration of the Messaging Server IMAP service by using the configutil command. Some of the more common IMAP services options are given in this section. A complete listing can be found in the Chapter 3, Messaging Server Configuration, in Sun Java System Messaging Server 6.3 Administration Reference. For more information, see also:

Command Line: You can set values for the IMAP attributes at the command line as follows:

To enable or disable the IMAP service:

configutil -o service.imap.enable -v [ yes | no ]

To specify the port number:

configutil -o service.imap.port -v number

To enable a separate port for IMAP over SSL:

configutil -o service.imap.enablesslport -v [ yes | no ]

To specify a port number for IMAP over SSL:

configutil -o service.imap.sslport -v number

To enable or disable password login to the IMAP service:

configutil -o service.imap.plaintextmincipher -v value

If valueis > 0, then disable use of plaintext passwords unless a security layer (SSL or TLS) is activated. This forces users to enable SSL or TLS on their client to login which prevents exposure of their passwords on the network. Default is 0.

To set the maximum number of network connections per process (see 5.3.2 Number of Connections per Process for additional information):

configutil -o service.imap.maxsessions -v number

To set the maximum idle time for connections (see 5.3.4 Dropping Idle Connections for additional information):

configutil -o service.imap.idletimeout -v number

To set the maximum number of threads per process (see 5.3.3 Number of Threads per Process):

configutil -o service.imap.maxthreads -v number

To set the maximum number of processes (see 5.3.1 Number of Processes):

configutil -o service.imap.numprocesses -v number

To specify a protocol welcome banner:

configutil -o service.imap.banner -v banner

5.6.1 Configuring IMAP IDLE

The IMAP IDLE extension to the IMAP specification, defined in RFC 2177, allows an IMAP server to notify the mail client when new messages arrive and other updates take place in a user's mailbox. The IMAP IDLE feature has the following benefits:

5.6.1.1 Prerequisites

The IMAP IDLE feature relies on the Event Notification Service (ENS) to propagate notifications. To use IMAP IDLE, you must configure the following ENS components:

For information on configuring ENS for Messaging Server, see the Sun Java System Communications Services Event Notification Service Guide.

For information on configuring the iBiff notification plug-in, see B.1 Loading the ENS Publisher in Messaging Server.

ProcedureTo Configure IMAP IDLE

  1. Configure the enpd server to accept connections only from the hosts running the message stores.

    To restrict connections to message-store hosts, set the ENS_ACCESS environment variable. The environment variable sets a list of permissions allowing access to enpd. The syntax is as follows:


    setenv ENS_ACCESS 'allowdeny ipaddress|mask;
    allowdeny ipaddress|mask; ...' 

    where

    allowdeny

    Can be either + (to specify allow) or — (to specify deny)

    ipaddress

    Specifies a dotted-decimal IP address

    mask

    Specifies a dotted-decimal IP address mask

    Examples:

    The following example allows access to the local host only:


    setenv ENS_ACCESS '+127.0.0.1|255.255.255.255'

    The following example allows access to the local host and all IP addresses 192.168.0.* except 192.168.0.17:


    setenv ENS_ACCESS '+192.168.0.1|255.255.255.0;+127.0.0.1|255.255.255.255; \
    -192.168.0.17;255.255.255.255'
  2. Run the configutil utility to specify the name of the host where the ENS server is running.


    cd msg-svr-base
    ./configutil -o local.store.notifyplugin.enshost -v "ipaddress"

    where ipaddress specifies a dotted-decimal IP address of the ENS host machine.

    Example:


    cd msg-svr-base
    ./configutil -o local.store.notifyplugin.enshost -v "127.0.0.1"
  3. Specify the event key to use for notifications.

    If the ENS event key (ensEventKey) is set to its default value, IMAP IDLE does not operate.

    You must configure the ensEventKey value to end with %M. The string %M is a substitution code that is replaced by the name of the mailbox in which the event occurred.

    Run the following configutil command:


    ./configutil -o local.store.notifyplugin.enseventkey -v "eventkey"

    where eventkey is a unique identifier used by ENS. Its default value is enp://127.0.0.1/store. The host-name portion of the event key is not used to determine the host where ENS is running; it is simply part of the identifier.

    Example:


    ./configutil -o local.store.notifyplugin.enseventkey -v "enp://127.0.0.1/store/%M"
  4. Load the libibiff notification plug-in file, which enables the ENS publisher for Messaging Server.

    Run the following configutil command:


    ./configutil -o local.store.notifyplugin -v "msg-svr-base/lib/libibiff"
  5. Enable notifications to be sent from all user mailboxes, not only the inbox.

    By default, notifications are generated only by events that occur in the inbox. However, the IMAP IDLE RFC (2177) specifies that IDLE must notify clients whenever an event occurs in any mailbox.

    To comply with the RFC, the IMAP IDLE feature requires that notifications be enabled for all mailboxes. If they are not, the IMAP server will not advertise the IDLE capability.

    To configure notifications for all mailboxes, set the configutil command, noneinbox, to a value of 1:


    ./configutil -o local.store.notifyplugin.noneinbox.enable -v 1

    where -v 1 enables notifications from all mailboxes.

  6. Stop, then restart Messaging Server.


    cd msg-svr-base/sbin
    
    ./stop-msg
    
    ./start-msg
  7. Verify that the IMAP services now include the IDLE feature. Use telnet to connect to the IMAP host and port.


    telnet IMAP_hostname port
    

    Example:


    telnet myhost imap
    trying 192.18.01.44 ... 
    connected to myhost.siroe.com
    
    * OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS
    CHILDREN BINARY UNSELECT SORT LANGUAGE STARTTLS IDLE XSENDER X-NETSCAPE
    XSERVERINFO X-SUN-SORT X-SUN-IMAP X-ANNOTATEMORE AUTH=PLAIN]
    myhost.siroe.com IMAP4 service (Sun Java(tm) System 
    Messaging Server 6.3-0.05 (built Feb 7 2006))