Index: /trunk/prototype/services/ImapServiceAdapter.php
===================================================================
--- /trunk/prototype/services/ImapServiceAdapter.php	(revision 5540)
+++ /trunk/prototype/services/ImapServiceAdapter.php	(revision 5570)
@@ -410,6 +410,11 @@
     public function update( $URI, $data, $criteria = false )
     {
-		//TODO - remove
-		//TODO - create
+		/**
+		 * Os únicos atributos que podem ser alterados no IMAP são folderName e messageId,
+		 * porém a operação de update desses atributos não faz sentido para o usuário da DataLayer,
+		 * pois na prática elas são executadas através das operações de CREATE e DELETE.
+		 * Assim, para os conceitos "labeled" e "followupflagged", só faz sentido o update de 
+		 * atributos gravados no banco de dados e nunca no IMAP.
+		 */
 	}
 
Index: /trunk/prototype/modules/mail/interceptors/Helpers.php
===================================================================
--- /trunk/prototype/modules/mail/interceptors/Helpers.php	(revision 5540)
+++ /trunk/prototype/modules/mail/interceptors/Helpers.php	(revision 5570)
@@ -112,5 +112,6 @@
 	public function clearFilterAtFind( &$uri , &$params , &$criteria , $original ) {
 
-		if ($criteria['filter'] && !self::in_arrayr('id', $criteria['filter'])) {
+		if ($criteria['filter'] && 
+				(self::in_arrayr('messageNumber', $criteria['filter']) || self::in_arrayr('folderName', $criteria['filter'])) ) {
 			unset($criteria['filter']);
 		}
@@ -124,18 +125,16 @@
 	public function doImapFind( &$uri , &$result , &$criteria , $original ){
 
-		if (!self::in_arrayr('id', $original['criteria']['filter'])) {
-			if ($result) {
-				$list = array();
-				foreach ($result as $followupflagged)
-					$list[] = $followupflagged['id'];
-					
-				$filter = array( 'IN' , 'id' , $list );
+		if ($result) {
+			$list = array();
+			foreach ($result as $followupflagged)
+				$list[] = $followupflagged['id'];
 				
-				if (isset($original['criteria']['filter']) && $original['criteria']['filter']!=NULL && count($original['criteria']['filter']) != 0)
-					$criteria['filter'] = array( 'AND', $original['criteria']['filter'], $filter );
-				else
-					$criteria['filter'] =  $filter;
-			}
-		}	
+			$filter = array( 'IN' , 'id' , $list );
+			
+			if (isset($original['criteria']['filter']) && $original['criteria']['filter']!=NULL && count($original['criteria']['filter']) != 0)
+				$criteria['filter'] = array( 'AND', $original['criteria']['filter'], $filter );
+			else
+				$criteria['filter'] =  $filter;
+		}
 		
 		$imap_uri = $uri;
@@ -180,10 +179,10 @@
 
 	//followupflagged:PostgreSQL.after.create
-	public function doImapCreate( &$uri , &$params , &$criteria , $original ) {
-	
-		$imap_uri = $uri;
-		$imap_uri['service'] = 'Imap';
-		
-		$imap_params = $params + $original['properties'];
+	public function doImapCreate( &$uri , &$result , &$criteria , $original ) {
+	
+		$imap_uri = $uri;
+		$imap_uri['service'] = 'Imap';
+		
+		$imap_params = $result + $original['properties'];
 		if ($imap_params['folderName'] && $imap_params['messageNumber'] && $imap_params['id']) {
 			$imap_uri['id'] = $imap_params['folderName'] . '/' . $imap_params['messageNumber'] . '#' . $imap_params['id']; 
@@ -196,8 +195,9 @@
 	//followupflagged:PostgreSQL.before.read
 	public function doImapRead( &$uri , &$params , &$criteria , $original ) {
-		//TODO - read
-		//$imap_uri = $uri;
-		//$imap_uri['service'] = 'Imap';
-		//$result = Controller::read($imap_uri, $params, $criteria);
+		$imap_uri = $uri;
+		$imap_uri['service'] = 'Imap';
+		$result = Controller::read($imap_uri, $params, $criteria);
+		
+		return $result;
 	}	
 	
@@ -226,5 +226,8 @@
 	//followupflagged:PostgreSQL.before.update
 	public function doImapUpdate( &$uri , &$params , &$criteria , $original ) {
-		//TODO - update
+		/**
+		 * Para os conceitos "labeled" e "followupflagged", sÃ³ faz sentido o update de 
+		 * atributos gravados no banco de dados e nunca no IMAP.
+		 */
 		//$imap_uri = $uri;
 		//$imap_uri['service'] = 'Imap';
