Vilma: A null driver should really do nothing
authorBen Klang <ben@alkaloid.net>
Sat, 2 Jan 2010 17:31:12 +0000 (12:31 -0500)
committerBen Klang <ben@alkaloid.net>
Sat, 2 Jan 2010 17:31:12 +0000 (12:31 -0500)
vilma/lib/MailboxDriver/null.php

index 8fb14b3..093fb81 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2004-2010 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file LICENSE for license information (BSD). If you did not
  * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE.
  */
 class Vilma_MailboxDriver_null extends Vilma_MailboxDriver {
 
-    function _getMailboxDir($user, $domain)
+    public function checkMailbox($user, $domain)
     {
-        /*
-        if (empty($this->_params['mail_dir_base'])) {
-            require_once 'PEAR.php';
-            throw new Vilma_Exception(_("No 'mail_dir_base' parameter specified to maildrop driver."));
-        }
-        $dir = $this->_params['mail_dir_base'];
-        $usedomain = isset($this->_params['usedomain']) ? $this->_params['usedomain'] : false;
-        if ($usedomain) {
-            $dir .= '/' . $domain;
-        }
-
-        return $dir . '/' . $user;
-        */
-    }
-
-    function checkMailbox($user, $domain)
-    {
-        /*
-        static $exists;
-
-        $dir = $this->_getMailboxDir($user, $domain);
-        if (is_a($dir, 'PEAR_Error')) {
-            return $dir;
-        }
-
-        if (!isset($exists[$dir])) {
-            $exists[$dir] = is_dir($dir);
-        }
-
-        if (!$exists[$dir]) {
-            require_once 'PEAR.php';
-            throw new Vilma_Exception(sprintf(_("Maildrop directory \"%s\" does not exist."), $dir));
-        }
-        */
-
         return true;
     }
 
-    function createMailbox($user, $domain)
+    public function createMailbox($user, $domain)
     {
-        $dir = $this->_getMailboxDir($user, $domain);
-        if (is_a($dir, 'PEAR_Error')) {
-            return $dir;
-        }
-        if (empty($this->_params['system_user'])) {
-            require_once 'PEAR.php';
-            throw new Vilma_Exception(_("No 'system_user' parameter specified to maildrop driver."));
-        }
-
-        $create_function = sprintf('sudo -u %s maildirmake %s',
-                                   escapeshellarg($this->_params['system_user']),
-                                   escapeshellarg($dir));
-        exec($create_function);
         return true;
     }
 
-    /**
-     * @TODO: Implement
-     */
-    function deleteMailbox($user, $domain)
+    public function deleteMailbox($user, $domain)
     {
         return true;
     }