Hello Janos,

thanks so far :-)

I found the typo and it has to be like this:

$config['CUSTOM_PRE_AUTH_FUNCTION'] = 'my_imap';

function my_imap($username = '') {
   global $session;

   if(strstr($username, "@domain1.com")) {
      define('IMAP_SERVER', 'imap.domain1.com');
   } else if(strstr($username, "@domain2.com")) {
      define('IMAP_SERVER', 'imap.domain2.com');
   } else {
      define('IMAP_SERVER', 'imap.somedomain.com');
   }
}

Now the login page works :-)

I changed values to my own domain but i get this persistent error:

019/10/31 13:08:05 [error] 27070#27070: *9 FastCGI sent in stderr: "PHP message: PHP Warning:  stream_socket_client(): unable to connect to ssl://mail.yourdomain.com:993 (Connection timed out) in /var/piler/www/Zend/Mail/Protocol/Imap.php on line 108" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: my.example-archive.de, request: "POST /login.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "my.example-archive.de"

It seems server variables are not set correctly.

BKH


Reply via email to