~ubuntu-branches/ubuntu/hardy/fetchmail/hardy-security

« back to all changes in this revision

Viewing changes to debian/patches/03_imap_experimental.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2006-12-21 00:34:15 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061221003415-gc0wnuaykisbajav
Tags: 6.3.6~rc3-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control:
    + exim4 -> postfix dependency.
    + Add sysv-rc (>= 2.86.ds1-14.1ubuntu2) dependency for the 'multiuser'
      update-rc.d feature.
  - debian/fetchmail.postinst:
    + Install 'multiuser' rc.d symlinks.
    + Remove unnecessary rc.d symlinks on upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 03_imap_experimental.dpatch by  <Hector Garcia <hector@debian.org>>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad trunk~/transact.c trunk/transact.c
9
 
--- trunk~/transact.c   2006-04-17 11:35:47.000000000 +0200
10
 
+++ trunk/transact.c    2006-05-15 12:57:34.000000000 +0200
11
 
@@ -1335,6 +1335,9 @@
12
 
     while (protocol->delimited || len > 0)
13
 
     {
14
 
        set_timeout(mytimeout);
15
 
+       /* XXX FIXME: for undelimited protocols that ship the size, such
16
 
+        * as IMAP, we might want to use the count of remaining characters
17
 
+        * instead of the buffer size -- not for fetchmail 6.3.X though */
18
 
        if ((linelen = SockRead(sock, inbufp, sizeof(buf)-4-(inbufp-buf)))==-1)
19
 
        {
20
 
            set_timeout(0);
21
 
@@ -1357,6 +1360,20 @@
22
 
                sizeticker -= SIZETICKER;
23
 
            }
24
 
        }
25
 
+
26
 
+       /* Mike Jones, Manchester University, 2006:
27
 
+        * "To fix IMAP MIME Messages in which fetchmail adds the remainder of
28
 
+        * the IMAP packet including the ')' character (part of the IMAP)
29
 
+        * Protocol causing the addition of an extra MIME boundary locally."
30
 
+        *
31
 
+        * However, we shouldn't do this for delimited protocols:
32
 
+        * many POP3 servers (Microsoft, qmail) goof up message sizes
33
 
+        * so we might end truncating messages prematurely.
34
 
+        */
35
 
+       if (!protocol->delimited && linelen > len) {
36
 
+           inbufp[len] = '\0';
37
 
+       }
38
 
+
39
 
        len -= linelen;
40
 
 
41
 
        /* check for end of message */