[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mutt and courier-imapd



>>>>> "Brian" == Brian May <bam@debian.org> writes:

    Brian> I did see one listed in
    Brian> http://www.debian.org/Bugs/db/63/63376.html, but doesn't it
    Brian> doesn't apply cleanly to courier-imap-0.31 (probably
    Brian> cutting and pasting from the web page messes it up).

I can't get this patch to apply cleanly, not matter what I do.

I have sent a CC of this message to Miquel, the original submitter of
the bug. Miquel, I think it is important that the patch applies
cleanly, if it is going to be included in potato (which I agree would
be a good idea).

[659] [snoopy:bam] ~ >rm -rf courier-imap-0.31                        
[660] [snoopy:bam] ~ >tar -xzf courier-imap-0.31.tar.gz                 
[661] [snoopy:bam] ~ >patch -p0 < ~/diff                                 
patching file `courier-imap-0.31/imap/fetch.c'
Hunk #1 succeeded at 26 with fuzz 2.
Hunk #2 FAILED at 835.
Hunk #3 FAILED at 882.
Hunk #4 FAILED at 900.
Hunk #5 FAILED at 917.
Hunk #6 FAILED at 957.
Hunk #7 FAILED at 1040.
6 out of 7 hunks FAILED -- saving rejects to courier-imap-0.31/imap/fetch.c.rej
patching file `courier-imap-0.31/imap/imapd.c'
Hunk #1 succeeded at 69 with fuzz 2.
Hunk #2 FAILED at 1879.
1 out of 2 hunks FAILED -- saving rejects to courier-imap-0.31/imap/imapd.c.rej
patching file `courier-imap-0.31/imap/search.c'
Hunk #1 succeeded at 24 with fuzz 2.
Hunk #2 FAILED at 284.
1 out of 2 hunks FAILED -- saving rejects to courier-imap-0.31/imap/search.c.rejpatching file `courier-imap-0.31/maildir/deliverquota.c'
Hunk #1 succeeded at 25 with fuzz 1.
Hunk #2 FAILED at 103.
1 out of 2 hunks FAILED -- saving rejects to courier-imap-0.31/maildir/deliverquota.c.rej
patching file `courier-imap-0.31/maildir/maildirpurgetmp.c'
Hunk #1 FAILED at 55.
1 out of 1 hunk FAILED -- saving rejects to courier-imap-0.31/maildir/maildirpurgetmp.c.rej

Attached is the list of rejects, produced by:

find courier-imap-0.31 -name  "*.rej" -ls -exec cat \{\} \; > rejects 

229282    1 -rw-------   1 bam      users         812 May  2 13:55 courier-imap-0.31/maildir/deliverquota.c.rej
***************
*** 103,109 ****
                                 && errno != EAGAIN)
                         {
                                 if (quotafd >= 0)       close(quotafd);
-                                exit(75);
                         }
                         maildir_addquota(dir, quotafd, q, ss-s, 1);
                         if (quotafd >= 0)       close(quotafd);
--- 103,110 ----
                                 && errno != EAGAIN)
                         {
                                 if (quotafd >= 0)       close(quotafd);
+                                unlink(tname);
+                                exit(77);
                         }
                         maildir_addquota(dir, quotafd, q, ss-s, 1);
                         if (quotafd >= 0)       close(quotafd);
229284    1 -rw-------   1 bam      users         554 May  2 13:55 courier-imap-0.31/maildir/maildirpurgetmp.c.rej
***************
*** 55,61 ****
                 strcat(strcat(strcpy(z, m), "/"), de->d_name);
  
                 if (stat(z, &stat_buf) == 0
-                        && stat_buf.st_mtime < current_time - nage)
                         unlink(z);
                 free(z);
         }
--- 55,61 ----
                 strcat(strcat(strcpy(z, m), "/"), de->d_name);
  
                 if (stat(z, &stat_buf) == 0
+                        && stat_buf.st_ctime < current_time - nage)
                         unlink(z);
                 free(z);
         }
229276    3 -rw-------   1 bam      users        2597 May  2 13:55 courier-imap-0.31/imap/fetch.c.rej
***************
*** 835,841 ****
  off_t nlines, nbodylines;
  size_t i,j,k,l;
  int    c;
- char   buf[BUFSIZ];
  int    goodheader;
  unsigned long skipping;
  unsigned long cnt;
--- 835,841 ----
  off_t nlines, nbodylines;
  size_t i,j,k,l;
  int    c;
+ char   buf[BUFSIZ+2];
  int    goodheader;
  unsigned long skipping;
  unsigned long cnt;
***************
*** 882,887 ****
                                 buf[k]=':';
                         }
                 }
  
                 for (k=j; k<i; k++)
                         if (buf[k] == '\n')
--- 882,889 ----
                                 buf[k]=':';
                         }
                 }
+                else if (buf[j] == '\n')
+                        goodheader=0;
  
                 for (k=j; k<i; k++)
                         if (buf[k] == '\n')
***************
*** 898,903 ****
                 j=k;
         }
  
         cnt=l;
         for (i=0; i<l; i++)
                 if (buf[i] == '\n')     ++cnt;
--- 900,907 ----
                 j=k;
         }
  
+        buf[l++]='\n';  /* Always append a blank line */
+ 
         cnt=l;
         for (i=0; i<l; i++)
                 if (buf[i] == '\n')     ++cnt;
***************
*** 913,919 ****
         }
  
         writes("{");
-        writen(cnt+2);  /* BUG */
         writes("}\r\n");
         p=buf;
         while (skipping)
--- 917,923 ----
         }
  
         writes("{");
+        writen(cnt);
         writes("}\r\n");
         p=buf;
         while (skipping)
***************
*** 953,959 ****
                 p += i;
                 cnt -= i;
         }
-        writes("\r\n"); /* BUG */
  }
  
  struct fetchheaderinfo {
--- 957,962 ----
                 p += i;
                 cnt -= i;
         }
  }
  
  struct fetchheaderinfo {
***************
*** 1037,1042 ****
                         if (buf1[0] != '\n' && buf1[0] != '\r' &&
                                 !isspace((int)(unsigned char)buf1[0]))
                                 goodheader= (*headerfunc)(fi, buf1);
                         if (!goodheader)
                         {
                                 while (left)
--- 1040,1048 ----
                         if (buf1[0] != '\n' && buf1[0] != '\r' &&
                                 !isspace((int)(unsigned char)buf1[0]))
                                 goodheader= (*headerfunc)(fi, buf1);
+                        else if (buf1[0] == '\n')
+                                goodheader=0;
+ 
                         if (!goodheader)
                         {
                                 while (left)
229278    2 -rw-------   1 bam      users        1615 May  2 13:55 courier-imap-0.31/imap/imapd.c.rej
***************
*** 1879,1894 ****
                 }
  
                 mailbox=decode_valid_mailbox(curtoken->tokenbuf, 1);
-                if (mailbox && *mailbox == 0)
-                {
-                        free(mailbox);
-                        mailbox=0;
-                }
                 if (!mailbox)
                 {
                         free(msgset);
                         return (-1);
                 }
                 if (nexttoken()->tokentype != IT_EOL)
                 {
                         free(msgset);
--- 1879,1906 ----
                 }
  
                 mailbox=decode_valid_mailbox(curtoken->tokenbuf, 1);
+ 
                 if (!mailbox)
                 {
                         free(msgset);
+ 
+                        mailbox=valid_mailbox_name(curtoken->tokenbuf, 1);
+                        if (mailbox && *mailbox == 0)
+                        {
+                                free(mailbox);
+                                mailbox=0;
+                        }
+                        if (mailbox && nexttoken()->tokentype == IT_EOL)
+                        {
+                                free(mailbox);
+                                writes(tag);
+                                writes(" NO [TRYCREATE] Mailbox does not exist. \r\n");
+                                return (0);
+                        }
+                        if (mailbox)    free(mailbox);
                         return (-1);
                 }
+ 
                 if (nexttoken()->tokentype != IT_EOL)
                 {
                         free(msgset);
229280    1 -rw-------   1 bam      users         490 May  2 13:55 courier-imap-0.31/imap/search.c.rej
***************
*** 284,290 ****
                 }
                 break;
         case search_uid:
-                break;
                 if (is_in_set(p->as, current_mailbox_info.msgs[msgnum].uid))
                         p->value=1;
                 break;
--- 284,289 ----
                 }
                 break;
         case search_uid:
                 if (is_in_set(p->as, current_mailbox_info.msgs[msgnum].uid))
                         p->value=1;
                 break;
-- 
Brian May <bam@debian.org>

Reply to: