Index: /branches/2.4/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /branches/2.4/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7086)
+++ /branches/2.4/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7087)
@@ -2149,17 +2149,21 @@
 	            $acl = $this->getacltouser($folder, isset($params['decoded'])); 
 	            /* 
-	             * l - lookup - Mailbox is visible in mailbox list. Mailbox can be subscribed to. 
-	             * r - read - Mailbox can be opened for reading. 
-	             * w - write - Message flags and keywords can be changed, except \Seen and \Deleted 
-	             * s - write-seen - \Seen flag can be changed 
-	             * t - write-deleted - \Deleted flag can be changed 
-	             * i - insert - Messages can be written or copied to the mailbox 
-	             * p - post - Messages can be posted to the mailbox by LDA, e.g. from Sieve scripts 
-	             * e - expunge - Messages can be expunged 
-	             * k - create - Mailboxes can be created (or renamed) directly under this mailbox (but not necessarily under its children, see ACL Inheritance section above) (renaming also requires delete rights) 
-	             * x - delete - Mailbox can be deleted 
-	             * a - admin - Administration rights to the mailbox (currently: ability to change ACLs for mailbox)  
+	             * l - lookup (mailbox is visible to LIST/LSUB commands, SUBSCRIBE mailbox) 
+                 * r - read (SELECT the mailbox, perform STATUS) 
+                 * s - keep seen/unseen information across sessions (set or clear \SEEN flag via STORE, also set \SEEN during APPEND/COPY/        FETCH BODY[...]) 
+                 * w - write (set or clear flags other than \SEEN and \DELETED via STORE, also set them during APPEND/COPY) 
+                 * i - insert (perform APPEND, COPY into mailbox) 
+                 * p - post (send mail to submission address for mailbox, not enforced by IMAP4 itself) 
+                 * k - create mailboxes (CREATE new sub-mailboxes in any implementation-defined hierarchy, parent mailbox for the new mailbox name in RENAME) 
+                 * x - delete mailbox (DELETE mailbox, old mailbox name in RENAME) 
+                 * t - delete messages (set or clear \DELETED flag via STORE, set \DELETED flag during APPEND/COPY) 
+                 * e - perform EXPUNGE and expunge as a part of CLOSE 
+                 * a - administer (perform SETACL/DELETEACL/GETACL/LISTRIGHTS) 
+                 * Os Atributos da ACL para pastas compartilhadas são definidos no arquivo sharemailbox.js, na função setaclfromuser 
+                 * Os Atributos da ACL para contas compartilhadas são definidos no arquivo shared_accounts.js, na função setaclfromuser  
                  */ 
-	                    if (strpos($acl, "x") === false || strpos($acl, "t") === false || strpos($acl, "e") === false){ 
+	                    $acl_share_delete = (stripos($acl,'t') !== false && stripos($acl,'e') !== false); 
+ 		 
+ 		                if (!$acl_share_delete) {  
 	                            $return['status'] = false; 
 	                    } 
@@ -3410,20 +3414,25 @@
 
 		//Este bloco tem a finalidade de averiguar as permissoes para pastas compartilhadas
-        if (substr($folder,0,4) == 'user'){
-        	$acl = $this->getacltouser($folder, isset($params['decoded']));
-        	/*
-        	 * l - lookup - Mailbox is visible in mailbox list. Mailbox can be subscribed to. 
-             * r - read - Mailbox can be opened for reading. 
-             * w - write - Message flags and keywords can be changed, except \Seen and \Deleted 
-             * s - write-seen - \Seen flag can be changed 
-             * t - write-deleted - \Deleted flag can be changed 
-             * i - insert - Messages can be written or copied to the mailbox 
-             * p - post - Messages can be posted to the mailbox by LDA, e.g. from Sieve scripts 
-             * e - expunge - Messages can be expunged 
-             * k - create - Mailboxes can be created (or renamed) directly under this mailbox (but not necessarily under its children, see ACL Inheritance section above) (renaming also requires delete rights) 
-             * x - delete - Mailbox can be deleted 
-             * a - admin - Administration rights to the mailbox (currently: ability to change ACLs for mailbox)  
+		if (substr($folder,0,4) == 'user'){
+			$acl = $this->getacltouser($folder, isset($params['decoded']));
+
+			/*
+		   	 * l - lookup (mailbox is visible to LIST/LSUB commands, SUBSCRIBE mailbox) 
+             * r - read (SELECT the mailbox, perform STATUS) 
+             * s - keep seen/unseen information across sessions (set or clear \SEEN flag via STORE, also set \SEEN during APPEND/COPY/        FETCH BODY[...]) 
+             * w - write (set or clear flags other than \SEEN and \DELETED via STORE, also set them during APPEND/COPY) 
+             * i - insert (perform APPEND, COPY into mailbox) 
+             * p - post (send mail to submission address for mailbox, not enforced by IMAP4 itself) 
+             * k - create mailboxes (CREATE new sub-mailboxes in any implementation-defined hierarchy, parent mailbox for the new mailbox name in RENAME) 
+             * x - delete mailbox (DELETE mailbox, old mailbox name in RENAME) 
+             * t - delete messages (set or clear \DELETED flag via STORE, set \DELETED flag during APPEND/COPY) 
+             * e - perform EXPUNGE and expunge as a part of CLOSE 
+             * a - administer (perform SETACL/DELETEACL/GETACL/LISTRIGHTS) 
+             * Os Atributos da ACL para pastas compartilhadas são definidos no arquivo sharemailbox.js, na função setaclfromuser 
+             * Os Atributos da ACL para contas compartilhadas são definidos no arquivo shared_accounts.js, na função setaclfromuser 
 			 */
-			if (strpos($acl, "x") === false || strpos($acl, "t") === false || strpos($acl, "e") === false){ 
+			$acl_share_delete = (stripos($acl,'t') !== false && stripos($acl,'e') !== false); 
+ 		 
+ 	        if (!$acl_share_delete) {  
 				$return['status'] = false;
 				return $return;
