Hello Sam,

I had to change the name of the trash - folder to 'Deleted Items' so that my 
wonderful courier IMAP server looks more like the MS Exchange server. For this 
purpose, I added support for new variable IMAP_TRASHFOLDERNAME.

A patch for the imapd is attached.

Regards, Aki Immonen


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- courier-0.39.3.20021015.RC3/imap/imapd.c    2002-10-13 23:42:50.000000000 +0300
+++ courier-0.39.3.20021015.RC3-with-config-trash/imap/imapd.c  2002-10-23 
+14:07:06.000000000 +0300
@@ -90,6 +90,9 @@
 extern void mainloop();
 extern void capability();
 
+char *dot_trash = "." TRASH;
+char *trash = TRASH;
+
 char *current_mailbox=0;
 
 FILE *debugfile=0;
@@ -159,7 +162,7 @@
 
 int is_trash(const char *m)
 {
-       if (strcmp(m, "." TRASH))
+       if (strcmp(m, dot_trash))
        {
                /*
                 * not trying to delete .Trash but folder inside of .Trash
@@ -197,8 +200,8 @@
                if (l <= 0)
                        l=1;
 
-               maildir_getnew(".", TRASH, NULL, NULL);
-               if ((dir=maildir_folderdir(".", TRASH)))
+               maildir_getnew(".", trash, NULL, NULL);
+               if ((dir=maildir_folderdir(".", trash)))
                {
                        maildir_purge(dir, l * 24 * 60 * 60);
                        free(dir);
@@ -1232,10 +1235,10 @@
                char    *p;
                int will_count=0;
 
-                       new_name=alloc_filename("." TRASH,
+                       new_name=alloc_filename(dot_trash,
                                current_mailbox_info.msgs[j].filename);
 
-                       if (maildirquota_countfolder("." TRASH))
+                       if (maildirquota_countfolder(dot_trash))
                                will_count=1;
 
                        if (file_counted != will_count)
@@ -3165,7 +3168,15 @@
        if (!p)
                dogethostname();
 
-       mdcreate("." TRASH);
+       if ((p=getenv("IMAP_TRASHFOLDERNAME")) != 0 && *p) 
+       {
+         trash = strdup(p);
+         dot_trash = malloc(strlen(trash) + 2);
+         dot_trash[0] = '.';
+         strcpy(&dot_trash[1], trash); 
+       }
+       
+       mdcreate(dot_trash);
 #if 0
        mdcreate("." DRAFTS);
 #endif

Reply via email to