Index: /trunk/zpush/backend/expresso/providers/imapProvider.php
===================================================================
--- /trunk/zpush/backend/expresso/providers/imapProvider.php	(revision 7698)
+++ /trunk/zpush/backend/expresso/providers/imapProvider.php	(revision 7706)
@@ -557,5 +557,5 @@
         if ($this->wasteID == false) {
             //try to get the waste basket without doing complete hierarchy sync
-            $wastebaskt = @imap_getmailboxes($this->mbox, $this->server, "Trash");
+            $wastebaskt = @imap_getmailboxes($this->mbox, $this->server, IMAP_TRASHFOLDER);
             if (isset($wastebaskt[0])) {
                 $this->wasteID = $this->convertImapId(substr($wastebaskt[0]->name, strlen($this->server)));
@@ -802,29 +802,30 @@
             $folder->type = SYNC_FOLDER_TYPE_INBOX;
         }
-        // Zarafa IMAP-Gateway outputs
-        else if($lid == "drafts") {
-            $folder->parentid = "0";
-            $folder->displayname = "Drafts";
-            $folder->type = SYNC_FOLDER_TYPE_DRAFTS;
-        }
-        else if($lid == "trash") {
-            $folder->parentid = "0";
-            $folder->displayname = "Trash";
-            $folder->type = SYNC_FOLDER_TYPE_WASTEBASKET;
-            $this->wasteID = $id;
-        }
-        else if($lid == "sent" || $lid == "sent items" || $lid == IMAP_SENTFOLDER) {
-            $folder->parentid = "0";
-            $folder->displayname = "Sent";
-            $folder->type = SYNC_FOLDER_TYPE_SENTMAIL;
-            //$this->sentID = $id;
-        }
+//        // Zarafa IMAP-Gateway outputs
+//        else if($lid == "drafts") {
+//            $folder->parentid = "0";
+//            $folder->displayname = "Drafts";
+//            $folder->type = SYNC_FOLDER_TYPE_DRAFTS;
+//        }
+//        else if($lid == "trash") {
+//            $folder->parentid = "0";
+//            $folder->displayname = "Trash";
+//            $folder->type = SYNC_FOLDER_TYPE_WASTEBASKET;
+//            $this->wasteID = $id;
+//        }
+//        else if($lid == "sent" || $lid == "sent items" || $lid == IMAP_SENTFOLDER) {
+//            $folder->parentid = "0";
+//            $folder->displayname = "Sent";
+//            $folder->type = SYNC_FOLDER_TYPE_SENTMAIL;
+//            //$this->sentID = $id;
+//        }
         // courier-imap outputs and cyrus-imapd outputs
-        else if($lid == "inbox.drafts" || $lid == "inbox/drafts") {
+        //else if(  $lid == "inbox.drafts" || $lid == "inbox/drafts") {
+        else if(  $lid == IMAP_DRAFTFOLDER ) {
             $folder->parentid = $this->convertImapId($fhir[0]);
             $folder->displayname = "Drafts";
             $folder->type = SYNC_FOLDER_TYPE_DRAFTS;
         }
-        else if($lid == "inbox.trash" || $lid == "inbox/trash") {
+        else if($lid == IMAP_TRASHFOLDER) {
             $folder->parentid = $this->convertImapId($fhir[0]);
             $folder->displayname = "Trash";
@@ -832,5 +833,5 @@
             $this->wasteID = $id;
         }
-        else if($lid == "inbox.sent" || $lid == "inbox/sent") {
+        else if($lid == IMAP_SENTFOLDER ) {
             $folder->parentid = $this->convertImapId($fhir[0]);
             $folder->displayname = "Sent";
Index: /trunk/zpush/config.php
===================================================================
--- /trunk/zpush/config.php	(revision 7670)
+++ /trunk/zpush/config.php	(revision 7706)
@@ -302,4 +302,8 @@
     // copy outgoing mail to this folder. If not set z-push will try the default folders
     define('IMAP_SENTFOLDER', 'INBOX' . $row['imapdelimiter'] . $row['imapdefaultsentfolder']);
+    define('IMAP_TRASHFOLDER', 'INBOX' . $row['imapdelimiter'] . $row['imapdefaulttrashfolder']);
+    define('IMAP_DRAFTFOLDER', 'INBOX' . $row['imapdelimiter'] . $row['imapdefaultdraftsfolder']);
+    define('IMAP_SPANFOLDER', 'INBOX' . $row['imapdelimiter'] . $row['imapdefaultspamfolder']);
+
     // forward messages inline (default false - as attachment)
     define('IMAP_INLINE_FORWARD', false);
