fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / change_password / backend / poppassd.php
index 280238b00588ba50d371e7e86b0286681a91953a..e710f0013bc204de020086d018b148ce0af3bd91 100644 (file)
@@ -3,7 +3,9 @@
 /**
  * Poppassd change password backend
  *
- * @author Seth Randall <sethr@missoulafcu.org>
+ * @author Seth Randall <sethr at missoulafcu.org>
+ * @copyright 2004-2022 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage change_password
@@ -84,8 +86,13 @@ function cpw_poppassd_go($username, $old_pw, $new_pw, $debug = 0) {
     global $poppassd_server;
     global $imapServerAddress;
 
+    /** sqimap_get_user_server() function */
+    include_once(SM_PATH . 'functions/imap_general.php');
+
     if($poppassd_server == '') {
-        $poppassd_server = $imapServerAddress;
+        // if poppassd address is not set, use imap server's address
+        // make sure that setting contains address and not mapping
+        $poppassd_server = sqimap_get_user_server($imapServerAddress,$username);
     }
 
     $messages = array();
@@ -128,5 +135,3 @@ function cpw_poppassd_go($username, $old_pw, $new_pw, $debug = 0) {
 
     return $messages;
 }
-
-?>
\ No newline at end of file