--- lib/Driver/forwards.php.0	2005-05-21 08:02:03.000000000 +0200
+++ lib/Driver/forwards.php	2005-07-07 05:27:34.003016128 +0200
@@ -204,6 +204,8 @@
             $this->_error = $status->getMessage();
             return false;
         }
+	
+	$status = preg_replace('/ *(^|, *)\\\\' . $user . '( *, *|$)/', "", $status);
 
         return $status;
     }
@@ -230,4 +232,52 @@
         }
     }
 
+
+    /**
+     * Checks if user is keeping a local copy of forwarded mail.
+     *
+     * @param string $user      The username of the user.
+     * @param string $realm     The realm of the user.
+     * @param string $password  The password of the user.
+     *
+     * @return boolean  True if user is keeping a local copy of mail,
+     *                  otherwise false.
+     */
+    function isKeepLocal($user, $realm, $password) 
+    {
+        // Make sure the configuration file is correct.
+        if (!$this->checkConfiguration($realm)) {
+            return false;
+        }
+
+        // Build the FTP array to pass to VFS.
+        $_args = array('hostspec' => $this->_params[$realm]['host'],
+                       'port' => $this->_params[$realm]['port'],
+                       'pasv' => $this->_params[$realm]['pasv'],
+                       'username' => $user,
+                       'password' => $password);
+
+        // Create the VFS ftp driver.
+        require_once 'VFS.php';
+        $_vfs = &VFS::singleton('ftp', $_args);
+
+        // Try to login with the username/password, no realm.
+        $status = $_vfs->checkCredentials();
+        if (is_a($status, 'PEAR_Error')) {
+            $this->_error = $status->getMessage();
+            $this->_error .= '  ' .  _("Check your username and password");
+            return false;
+        }
+
+        $status = $_vfs->read('', '.forward');
+        if (is_a($status, 'PEAR_Error')) {
+            $this->_error = $status->getMessage();
+            return false;
+        }
+
+        return ( preg_match('/(^|, *)\\\\' . $user . '( *,|$)/', $status) );
+
+    }
+ 
+
 }
