Re: Authentication against multiple IMAP servers

2019-10-31 Thread hw




Hello,

i set both parameters but the error persists.
It a little bit weird because log tells me that a connection to 
ssl://mail.yourdomain.com:993 (?) fails or ist timed out.

This cannot work.

I set all domains but it seems that these parameters are not read.
In /var/piler/www/Zend/Mail/Protocol/Imap.php an $host parameter is 
mentioned.
How is /var/piler/www/Zend/Mail/Protocol/Imap.php told to use 
IMAP_SERVER paramters?


BKH

Am 31.10.19 um 21:20 schrieb s...@acts.hu:



Hello,

I've fixed the typo in the docs. I suggest you to also set IMAP_PORT 
and IMAP_SSL parameters.

You may run ngrep to figure out what's going on the wire.

Janos

On 2019-10-31 13:15, hw wrote:

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






Re: Authentication against multiple IMAP servers

2019-10-31 Thread hw

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