]> diplodocus.org Git - mdeliver/commitdiff
Use an actual maildir called spam, not simply a subdir beside 'new'.
authorepg <>
Thu, 13 Apr 2006 01:44:31 +0000 (01:44 +0000)
committerepg <>
Thu, 13 Apr 2006 01:44:31 +0000 (01:44 +0000)
processor.c

index f9bf73f843ab71400c32356f48fd837da1228ff7..2c015c68e69a465219c6435e5a99bce9bd85a7dd 100644 (file)
@@ -161,13 +161,17 @@ process(char *tmp)
 {
     size_t len = strlen(tmp);
     errfn = malloc(len + 1);
 {
     size_t len = strlen(tmp);
     errfn = malloc(len + 1);
-    /* +2 because this one has an extra char ("mdp" vs. "spam"). */
-    char *new = malloc(len + 2);
+    /* 5 for spam/ and 1 for terminating null */
+    char *new = malloc(len + 5 + 1);
 
     strcpy(errfn, "err");
     strcat(errfn, tmp + 3);
 
 
     strcpy(errfn, "err");
     strcat(errfn, tmp + 3);
 
-    strcpy(new, is_spam(tmp) ? "spam" : "new");
+    new[0] = '\0';
+    if (is_spam(tmp)) {
+        strcpy(new, "spam/");
+    }
+    strcat(new, "new");
     strcat(new, tmp + 3);
 
     if (rename(tmp, new) == -1) {
     strcat(new, tmp + 3);
 
     if (rename(tmp, new) == -1) {