wiki:Howto_Config

Version 5 (modified by r@…, 6 years ago) (diff)

--

IMAP server configuration

By default the login screen provides a text box where you need to enter the IMAP host which you want to connect to. This box can be hidden by setting one fixed IMAP host address:

$rcmail_config['default_host'] = 'localhost';

And if you want a dropdown list like it's explained in the comments you need something like this:

$rcmail_config['default_host'] = array('mail.example.com', 'webmail.example.com', 'ssl://mail.example.com:993');

In order to show nice labels instead of the host names in the dropdown box write it that way:

$rcmail_config['default_host'] = array(
  'mail.example.com' => 'Default Server',
  'webmail.example.com' => 'Webmail Server',
  'ssl://mail.example.com:993' => 'Secure Webmail Server'
);

Auto create user

Sometimes hard to understand is the 'auto_create_user' property in main.inc.php. If set to True a new RoundCube user is created once the IMAP login succeeds. If auto_create_user is set to False, the login only succeeds if there's a matching user-record in the local RoundCube database. Even if a user enters the correct password and the IMAP login succeeds, the login will fail with the message "Login failed".

Configuring for Courier-IMAP support

Courier-IMAP strictly adheres to the IMAP4 standards. Therefore, it follows the IMAP namespacing guidelines. Under the standards, the namespace of "INBOX." is used to contain all private user-created and user-specific folders. The namespace of "shared." is used to store all public folders. Courier-IMAP uses this by default, and it is up to the Mail User Agent (MUA), such as RoundCube, Thunderbird, Outlook, etc., to properly reference the namespace while creating/modifying/storing in folders.

The default RC configuration files do not have this built in, or at least did not support my experience of Courier-IMAP/Postfix under Debian.

The common side effect of this is when a user tries to send a message; the message reaches the SMTP server and is sent to the recipient, however a "Sending Message" notification comes up and results in a time out after 2 minutes. (You can reference logs and see that it is occurring in a php file readin function). This is because the Sent folder is configured outside of the INBOX. namespace and RC does not have the ability to write the sent message to that folder. In addition, a user will not be able to move files from the Inbox folder to any of the Drafts, Junk, Trash, and Sent folders.

Configure main.inc.php and prepend a "INBOX." to any folder references in order to have RC correctly reference the IMAP namespace for private user folders.

The resulting lines will look like this:

$rcmail_config['drafts_mbox'] = 'INBOX.Drafts';
$rcmail_config['junk_mbox'] = 'INBOX.Junk';

... [ apply same format to rest of lines ] ...

$rcmail_config['default_imap_folders'] = array('INBOX.Drafts', 'INBOX.Sent', 'INBOX.Junk', 'INBOX.Trash');

If this is correctly done, upon refresh of the main RC page you will see the Drafts, Sent, Junk, and Trash folders as subfolders of the Inbox.

If you have residual top level folders of Drafts, Sent, Junk, Trash, you can delete them by going to Personal Settings -> Folders. If the top level folders do not show up (they will not have INBOX. in the name) you must change the following line in main.inc.php to FALSE:

$rcmail_config['protect_default_folders'] = FALSE;

This will allow you to delete top level folders. Change back to TRUE when you are done in order to prevent users from accidentally deleting the default folders.