6.0.0-beta13
4/11/26
  • The imap_config parameter in IMP 4.1+'s {{servers.php}} file

##red|//As mentioned in the {{servers.php}} file, the Horde Project does not officialy support this parameter. Use at your own risk.//##

##red|For information on configuring UW-IMAP servers, see [ImpUWIMAPNamespaces IMP UW-IMAP/Namespace Configuration Tips].##

##red|This documentation is also valid for [http://www.horde.org/mimp/ MIMP 1.0].##


+++ Why use this parameter?

The IMAP_Client:: library does not currently support logins for your IMAP authentication type (i.e. kerberos, NTLM).

You both know what you are doing and you want to save a single login to the server at the beginning of a session. (i.e. you are implementing IMP in a large environment, know what these IMAP configuration items are, and want to save a bit of bandwith/CPU cycles for each session by eliminating a server access needed to obtain the IMAP server information). Quite honestly, if the auto-detect method of IMP - the default - correctly detects the IMAP server information, you really shouldn't be messing with this configuration option.


+++ Why is IMAP_Client needed at all? Or, why don't you guys just use the c-client library to get this information?

Simple. The php imap_*() functions don't provide a way for us to get this information. //Trust us//, we would gladly use those functions if they existed.


+++ What is the format of the 'namespace' parameter?

Please see the documentation for the {{namespace}} function in {{imp/lib/IMAP/Client.php}}. Or you can try going to our [http://dev.horde.org/api/imp/IMP/IMP_IMAPClient.html#getNamespace API Documentation]. (No guarantees this link will remain correct).


+++ What does an example 'imap_config' entry in {{servers.php}} look like for IMP?

Thanks for asking. It looks like the following (this is an example of a dovecot-1.0 IMAP server):

'imap_config' => array( 'children' => true, 'namespace' => array( '' => array( 'name' => '', 'delimiter' => '.', 'type' => 'personal', 'hidden' => false ), '#foo.' => array( 'name' => '#foo.', 'delimiter' => '.', 'type' => 'shared', 'hidden' => false ), '#foo2.' => array( 'name' => '#foo2.', 'delimiter' => '.', 'type' => 'public', (or 'other' if using IMP 4.2+) 'hidden' => false ) ), 'search_charset' => array( 'UTF-8' => true ) )

This is an example of an UW-IMAP server:

'imap_config' => array( 'children' => false, 'namespace' => array( 'INBOX/' => array( 'name' => 'INBOX/', 'delimiter' => '/', 'type' => 'personal', 'hidden' => false, ), ), 'search_charset' => array( 'UTF-8' => true ) )

Another UW-IMAP example:

'imap_config' => array( 'children' => false, 'namespace' => array( 'mail/' => array( 'name' => 'mail/', 'delimiter' => '/', 'type' => 'personal', 'hidden' => false, ), ), 'search_charset' => array( 'UTF-8' => true ) )

Obviously, //don't copy this code directly into servers.php and expect it to work!// This is merely an example. Your IMAP server configuration is almost certainly different.

##red|Note: MIMP does not require the 'search_charset' value.##
##red|Note: As of IMP 4.2.1, the 'children' value is no longer needed.##


+++ Notes for Perdition Imap/Pop3 Proxy
Please, pay attention with imap capability command. IMAP_Client run CAPABILITY before login, so, perdition proxy don't realy return a full capability string. You can use perdition parameter to fix it:

imap_capability "IMAP4rev1 CHILDREN NAMESPACE"


+++ Notes for dovecot using maildir INBOX and mbox Mail/ folders with dimp 1.1.1
There is a strange bug with imp1.1.1 and dovecot in the configuration in the subject.
My old config which used to work fine with imp was:

'imap_config' => array(
'children' => true,
'namespace' => array(
'Mail/' => array(
'name' => 'Mail/',
'delimiter' => '/',
'type' => 'personal',
'hidden' => false
),
),
'search_charset' => array(
'UTF-8' => true
)
)

but using this config with dimp 1.1.1, when selecting a new message from the inbox, the preview would never show up and the "working" icon would never go away. if a message was not marked as new, it could be previewed without any problems. also preview of new messages under Mail/ folders worked fine as well.

To make the preview work for new messages in the INBOX i had to add a new namespace definition (maildir style):

'namespace' => array(
'' => array(
'name' => '',
'delimiter' => '.',
'type' => 'personal',
'hidden' => true
),

any maildir namespace will do to fix the issue. we dont want to support both formats so i am hiding this definition.