[imp] 'smtphost' in servers.php don't fully work

Лукьянов Владимир lichnoye at macbox.ru
Tue Feb 1 06:29:05 PST 2005


If anybody interesting, we solve this problem by changing next lines to ../horde/imp/lib/Sessions.php

was

            if ($conf['mailer']['type'] == 'smtp') {
                if (!empty($settings['smtphost'])) {
                    $_SESSION['imp']['smtphost'] = $settings['smtphost'];
                }
                if (!empty($settings['smtpport'])) {
                    $_SESSION['imp']['smtpport'] = $settings['smtpport'];
                }

became

            if ($conf['mailer']['type'] == 'smtp') {
                $_SESSION['imp']['smtphost'] = isset($ptr['smtphost']) ? $ptr['smtphost'] : null;
//                if (!empty($settings['smtphost'])) {
//                    $_SESSION['imp']['smtphost'] = $settings['smtphost'];
//                }
                $_SESSION['imp']['smtpport'] = isset($ptr['smtpport']) ? $ptr['smtpport'] : null;
//                if (!empty($settings['smtpport'])) {
//                    $_SESSION['imp']['smtpport'] = $settings['smtpport'];
//                }


  This is my story.

  I have:

  - server0 (Apache2, Horde3+Imp4+PHP4)
  - server1 (IMAP/SMTP) for mail domain example1
  - server2 (IMAP/SMTP) for mail domain example2

  We already install and configure Horde, Horde and IMP working fine only if we have one IMAP server
  and add two lines in /horde/conf.php:

  $conf['mailer']['params']['host'] = 'server1.example1';
  $conf['mailer']['params']['port'] = 25;

  But we have two (ore more) IMAP servers and must send separate mail for each domain using
  apropriate IMAP/SMTP server.

  I read in servers.php...

  * smtphost: If specified, and $conf['mailer']['type'] is set to 'smtp',
  *           IMP will use this host for outbound SMTP connections.  This
  *           value overrides any existing $conf['mailer']['params']['host']
  *           value at runtime.

  ... and try to use this feature, but IMP still send mail to host specified in horde conf file (or
  if not, IMP use local sendmail).
  I can sucessfully authorizate on IMAP server, read mail, but only can't send messages.
  This feature don't work!

  This is my conf files.

  /horde/conf.php

  $conf['auth']['params']['app'] = 'imp';
  $conf['auth']['driver'] = 'application';
  $conf['mailer']['params']['auth'] = false;
  $conf['mailer']['type'] = 'smtp';


  /horde/imp/servers.php

  $servers['example1'] = array(
        'name' => 'NAME1',
        'server' => 'server1.example1',
        'hordeauth' => 'false',
        'protocol' => 'imap',
        'port' => 143,
        'folders' => '',
        'namespace' => '',
        'maildomain' => 'example1',
        'smtphost' => 'server1.example1',
        'realm' => 'example1',
        'preferred' => '',
        'hierarchies' => array()
  );
  $servers['example2'] = array(
        'name' => 'NAME2',
        'server' => 'server2.example2',
        'hordeauth' => 'false',
        'protocol' => 'imap',
        'port' => 143,
        'folders' => '',
        'namespace' => '',
        'maildomain' => 'example2',
        'smtphost' => 'server2.example2',
        'realm' => 'example2',
        'preferred' => '',
        'hierarchies' => array()
  );

  Best regards,
  Lukyanov Vladimir


More information about the imp mailing list