27 #require_once 'Zend/Mail/Storage/Folder.php'; 32 #require_once 'Zend/Mail/Storage/Folder/Interface.php'; 37 #require_once 'Zend/Mail/Storage/Maildir.php'; 93 #require_once 'Zend/Mail/Storage/Exception.php'; 97 $this->_rootdir = rtrim(
$params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
103 $this->_has[
'top'] =
true;
104 $this->_has[
'flags'] =
true;
121 $dh = @opendir($this->_rootdir);
126 #require_once 'Zend/Mail/Storage/Exception.php'; 130 while (($entry = readdir($dh)) !==
false) {
132 if ($entry[0] !=
'.' || $entry ==
'.' || $entry ==
'..') {
135 if ($this->
_isMaildir($this->_rootdir . $entry)) {
142 $stack = array(
null);
143 $folderStack = array(
null);
147 foreach ($dirs as $dir) {
149 if (strpos($dir, $parent) === 0) {
150 $local = substr($dir, strlen($parent));
151 if (strpos($local, $this->_delim) !==
false) {
155 #require_once 'Zend/Mail/Storage/Exception.php'; 158 array_push($stack, $parent);
161 $parentFolder->$local = $folder;
162 array_push($folderStack, $parentFolder);
163 $parentFolder = $folder;
166 $parent = array_pop($stack);
167 $parentFolder = array_pop($folderStack);
174 #require_once 'Zend/Mail/Storage/Exception.php'; 189 if (!$rootFolder || $rootFolder ==
'INBOX') {
194 if (strpos($rootFolder,
'INBOX' . $this->_delim) === 0) {
195 $rootFolder = substr($rootFolder, 6);
198 $subname = trim($rootFolder, $this->_delim);
199 while ($currentFolder) {
200 @list($entry, $subname) = @explode($this->_delim, $subname, 2);
201 $currentFolder = $currentFolder->$entry;
207 if ($currentFolder->getGlobalName() != rtrim($rootFolder, $this->_delim)) {
211 #require_once 'Zend/Mail/Storage/Exception.php'; 214 return $currentFolder;
228 $this->_currentFolder = (string)$globalName;
231 $folder = $this->
getFolders($this->_currentFolder);
234 $this->
_openMaildir($this->_rootdir .
'.' . $folder->getGlobalName());
237 if (!$folder->isSelectable()) {
241 #require_once 'Zend/Mail/Storage/Exception.php'; 249 #require_once 'Zend/Mail/Storage/Exception.php'; 251 'folder tree, search for an other folder and try again', 0, $e);
getFolders($rootFolder=null)
selectFolder($globalName)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]