RainLoop / rainloop-webmail

Simple, modern & fast web-based email client
http://rainloop.net
MIT License
4.1k stars 890 forks source link

Rainloop poppassd plugin wont allow user to change password (with proposed fixes) #2181

Open marciomaiajr opened 2 years ago

marciomaiajr commented 2 years ago

Rainloop poppassd plugin wont allow user to change password

Rainloop Current Version. Wont accept changes in user password when using poppassd password plugin.

To replicate it just install poppassd password plugin and try to change user password.

Suggested FIX:

Add $sClientCert = '' in the function prototype in the file: rainloop-webmail/rainloop/v/0.0.0/app/libraries/MailSo/Poppassd/PoppassdClient.php

public function Connect($sServerName, $iPort = 106,
$iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT,
$bVerifySsl = false, $bAllowSelfSigned = true, $sClientCert = '')

and $sClientCert a couple of lines bellow when the function is called:

parent::Connect($sServerName, $iPort, $iSecurityType, $bVerifySsl, $bAllowSelfSigned, $sClientCert);

this will avoid an FastCGI error ..Declaration must be compatible... in the syslog and allow the script to run without errors.

Another change that I dont think is necessary for everyone is to remove the domain from the email so only the user is sent to the poppassd process.

$getArray = explode("@",$sLogin); **** this line
$sLogin = \trim($getArray[0]);    **** this line
$sPassword = $sPassword;

I used the tcpflow tool to capture the flow in the port 106 with the command below and confirmed that the poppassd wont accept the name with the @domain.xpt attached to it. So thats why I used the explode function the separate the user name from the domain.

tcpflow -i any -C -J port 106

I'm not a PHP programmer but the steps above fixed my problems with the. I would sent a pull request but I've never done that before.

parewadrrohit commented 1 year ago

thank you so much for your help with this issue your solution worked for me user now changes their password but when i change the password message appears like "could not save new password"... how to change that message also to successful

parewadrrohit commented 1 year ago

user can change their password now but whenever the user changes their password shows the message "could not save new password" and also shows an authentication error in their mailbox ...................its works only when the user manually logout and login again.

aydinke commented 1 year ago

I can confirm, these changes worked perfectly for me - thanks so much Marcio - superb work. I commend committing these edits to the main source (incl parsing for @domain).