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 sj




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




Re: Authentication against multiple IMAP servers

2019-10-31 Thread Janos SUTO
Hello,

then there must be a syntax error on the introduced function. Check out the 
error logs of the webserver.

If it doesn't help, then show me the function in a private email.

Janos


 Original Message 
From: BKH - Post 
Sent: Thu Oct 31 11:25:37 GMT+01:00 2019
To: piler-user@list.acts.hu
Subject: Re: Authentication against multiple IMAP servers



Hello Janos,

i tried this and set CUSTOM_PRE_AUTH_FUNCTION as described in the docs.
For testing reasons i copied your "my_imap"-script into config-site.php.

After this tried to log into piler with different users but the login 
page is shown as acompletely blank page.
Disabling the script, which is mentioned in the docs, login page is 
shown correctly.

I changes domain values to my domains but this error persists.

Can you help me with this?

BKH

Am 29.10.19 um 20:20 schrieb s...@acts.hu:
>
>
> Hello,
>
> I've just updated the custom authentication docs at
> http://www.mailpiler.org/wiki/current:custom-authentication
>
> Please check out the CUSTOM_PRE_AUTH_FUNCTION feature at the end.
>
> Janos
>
> On 2019-10-29 10:12, BKH - Post wrote:
>> Hi @all,
>>
>> is there a possibility to establish an authentication against multiple
>> IMAP servers?
>> Having here a scenario with two to three internal IMAP servers in
>> different workgroups i don't want to setup three mailpiler instances.
>> In fact that setting setting up such system is not a problem i want to
>> reduce administrative tasks.
>>
>> Thanks for your advice.
>>
>> Regards
>>
>> BKH
>



Re: Authentication against multiple IMAP servers

2019-10-31 Thread BKH - Post




Hello Janos,

i tried this and set CUSTOM_PRE_AUTH_FUNCTION as described in the docs.
For testing reasons i copied your "my_imap"-script into config-site.php.

After this tried to log into piler with different users but the login 
page is shown as acompletely blank page.
Disabling the script, which is mentioned in the docs, login page is 
shown correctly.


I changes domain values to my domains but this error persists.

Can you help me with this?

BKH

Am 29.10.19 um 20:20 schrieb s...@acts.hu:



Hello,

I've just updated the custom authentication docs at
http://www.mailpiler.org/wiki/current:custom-authentication

Please check out the CUSTOM_PRE_AUTH_FUNCTION feature at the end.

Janos

On 2019-10-29 10:12, BKH - Post wrote:

Hi @all,

is there a possibility to establish an authentication against multiple
IMAP servers?
Having here a scenario with two to three internal IMAP servers in
different workgroups i don't want to setup three mailpiler instances.
In fact that setting setting up such system is not a problem i want to
reduce administrative tasks.

Thanks for your advice.

Regards

BKH






Re: Authentication against multiple IMAP servers

2019-10-29 Thread sj




Hello,

I've just updated the custom authentication docs at
http://www.mailpiler.org/wiki/current:custom-authentication

Please check out the CUSTOM_PRE_AUTH_FUNCTION feature at the end.

Janos

On 2019-10-29 10:12, BKH - Post wrote:

Hi @all,

is there a possibility to establish an authentication against multiple
IMAP servers?
Having here a scenario with two to three internal IMAP servers in
different workgroups i don't want to setup three mailpiler instances.
In fact that setting setting up such system is not a problem i want to
reduce administrative tasks.

Thanks for your advice.

Regards

BKH




Authentication against multiple IMAP servers

2019-10-29 Thread BKH - Post




Hi @all,

is there a possibility to establish an authentication against multiple 
IMAP servers?
Having here a scenario with two to three internal IMAP servers in 
different workgroups i don't want to setup three mailpiler instances.
In fact that setting setting up such system is not a problem i want to 
reduce administrative tasks.


Thanks for your advice.

Regards

BKH