]> granicus.if.org Git - neomutt/commitdiff
Fix debian bug #275060 (editing on an imap server loses its flags).
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sat, 12 Feb 2005 19:54:51 +0000 (19:54 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sat, 12 Feb 2005 19:54:51 +0000 (19:54 +0000)
Remove trailing delimiter from IMAP folder names.

imap/message.c
imap/util.c

index 7af9cc0030fde853dd77cceaa98c93e7dcac9eed..7b39c06de6139f26c14ca45c6f903760cc17a0a3 100644 (file)
@@ -556,7 +556,10 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
   rewind (fp);
   
   imap_munge_mbox_name (mbox, sizeof (mbox), mailbox);
-  snprintf (buf, sizeof (buf), "APPEND %s (\\Seen) {%lu}", mbox, (unsigned long)len);
+  snprintf (buf, sizeof (buf), "APPEND %s (\\Seen%s%s) {%lu}", mbox,
+           msg->flags.replied ? " \\Answered" : "",
+           msg->flags.flagged ? " \\Flagged" : "",
+           (unsigned long) len);
 
   imap_cmd_start (idata, buf);
 
index 96c8caf8efd63947fd6d81f5d98a8efed140825b..5062786b3c51b2e25d6b9f35d1a1f09f1f35867e 100644 (file)
@@ -271,6 +271,7 @@ void imap_free_idata (IMAP_DATA** idata) {
  * in IMAP.  Additionally, the filesystem converts multiple hierarchy
  * delimiters into a single one, ie "///" is equal to "/".  IMAP servers
  * are not required to do this.
+ * Moreover, IMAP servers may dislike the path ending with the delimiter.
  */
 char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path, 
     size_t plen)
@@ -297,6 +298,8 @@ char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path,
     }
     x++;
   }
+  if (x && path[--x] != idata->delim)
+    x++;
   path[x] = '\0';
   return path;
 }