~ubuntu-branches/ubuntu/precise/topal/precise

« back to all changes in this revision

Viewing changes to pine-4.64.patch

  • Committer: Bazaar Package Importer
  • Author(s): Phil Brooke
  • Date: 2008-07-18 07:57:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080718075738-i1szqvmxz0evz32p
Tags: upstream-62
ImportĀ upstreamĀ versionĀ 62

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -cr OP/pine4.64/imap/src/c-client/mail.h NP/pine4.64/imap/src/c-client/mail.h
 
2
*** OP/pine4.64/imap/src/c-client/mail.h        2005-02-08 23:44:54.000000000 +0000
 
3
--- NP/pine4.64/imap/src/c-client/mail.h        2007-12-28 15:30:39.000000000 +0000
 
4
***************
 
5
*** 713,718 ****
 
6
--- 713,719 ----
 
7
    } size;
 
8
    char *md5;                  /* MD5 checksum */
 
9
    void *sparep;                       /* spare pointer reserved for main program */
 
10
+   unsigned short topal_hack;    /* set to 1 if topal has wrecked the sending */
 
11
  };
 
12
  
 
13
  
 
14
diff -cr OP/pine4.64/pine/pine.h NP/pine4.64/pine/pine.h
 
15
*** OP/pine4.64/pine/pine.h     2005-09-16 01:39:42.000000000 +0100
 
16
--- NP/pine4.64/pine/pine.h     2007-12-28 15:32:00.000000000 +0000
 
17
***************
 
18
*** 63,69 ****
 
19
  #ifndef _PINE_INCLUDED
 
20
  #define _PINE_INCLUDED
 
21
  
 
22
! #define PINE_VERSION          "4.64"
 
23
  #define       PHONE_HOME_VERSION      "-count"
 
24
  #define       PHONE_HOME_HOST         "docserver.cac.washington.edu"
 
25
  
 
26
--- 63,69 ----
 
27
  #ifndef _PINE_INCLUDED
 
28
  #define _PINE_INCLUDED
 
29
  
 
30
! #define PINE_VERSION          "4.64T"
 
31
  #define       PHONE_HOME_VERSION      "-count"
 
32
  #define       PHONE_HOME_HOST         "docserver.cac.washington.edu"
 
33
  
 
34
diff -cr OP/pine4.64/pine/send.c NP/pine4.64/pine/send.c
 
35
*** OP/pine4.64/pine/send.c     2005-09-12 23:04:25.000000000 +0100
 
36
--- NP/pine4.64/pine/send.c     2007-12-28 15:34:58.000000000 +0000
 
37
***************
 
38
*** 5254,5259 ****
 
39
--- 5254,5269 ----
 
40
      pbf = save_previous_pbuf;
 
41
      g_rolenick = NULL;
 
42
  
 
43
+     if ((*body)->type == TYPEMULTIPART 
 
44
+       && (*body)->topal_hack == 1)
 
45
+       /* This was a single part message which Topal mangled. */
 
46
+       (*body)->type = TYPETEXT;
 
47
+     if ((*body)->type == TYPEMULTIPART
 
48
+       && (*body)->topal_hack != 1)
 
49
+       /* Topal mangled a multipart message.  So the first nested part
 
50
+        is really TYPETEXT. */
 
51
+       (*body)->nested.part->body.type = TYPETEXT;
 
52
+     
 
53
      dprint(4, (debugfile, "=== send returning ===\n"));
 
54
  }
 
55
  
 
56
***************
 
57
*** 6752,6764 ****
 
58
  
 
59
                                rfc822_parse_content_header(nb,
 
60
                                    (char *) ucase((unsigned char *) buf+8),s);
 
61
!                               if(nb->type == TYPETEXT
 
62
!                                  && nb->subtype
 
63
                                   && (!b->subtype 
 
64
                                       || strucmp(b->subtype, nb->subtype))){
 
65
                                    if(b->subtype)
 
66
                                      fs_give((void **) &b->subtype);
 
67
  
 
68
                                    b->subtype  = nb->subtype;
 
69
                                    nb->subtype = NULL;
 
70
                                      
 
71
--- 6762,6774 ----
 
72
  
 
73
                                rfc822_parse_content_header(nb,
 
74
                                    (char *) ucase((unsigned char *) buf+8),s);
 
75
!                               if(nb->subtype
 
76
                                   && (!b->subtype 
 
77
                                       || strucmp(b->subtype, nb->subtype))){
 
78
                                    if(b->subtype)
 
79
                                      fs_give((void **) &b->subtype);
 
80
  
 
81
+                                   b->type     = nb->type;
 
82
                                    b->subtype  = nb->subtype;
 
83
                                    nb->subtype = NULL;
 
84
                                      
 
85
***************
 
86
*** 6766,6771 ****
 
87
--- 6776,6783 ----
 
88
                                    b->parameter = nb->parameter;
 
89
                                    nb->parameter = NULL;
 
90
                                    mail_free_body_parameter(&nb->parameter);
 
91
+                                   if (b->type != TYPETEXT)
 
92
+                                     b->topal_hack = 1;
 
93
                                }
 
94
  
 
95
                                mail_free_body(&nb);
 
96
***************
 
97
*** 9411,9427 ****
 
98
    dprint(4, (debugfile, "-- pine_encode_body: %d\n", body ? body->type : 0));
 
99
    if (body) switch (body->type) {
 
100
    case TYPEMULTIPART:         /* multi-part */
 
101
!     if (!body->parameter) {   /* cookie not set up yet? */
 
102
!       char tmp[MAILTMPLEN];   /* make cookie not in BASE64 or QUOTEPRINT*/
 
103
!       sprintf (tmp,"%ld-%ld-%ld=:%ld",gethostid (),random (),(long) time (0),
 
104
!              (long) getpid ());
 
105
!       body->parameter = mail_newbody_parameter ();
 
106
!       body->parameter->attribute = cpystr ("BOUNDARY");
 
107
!       body->parameter->value = cpystr (tmp);
 
108
!     }
 
109
!     part = body->nested.part; /* encode body parts */
 
110
!     do pine_encode_body (&part->body);
 
111
!     while (part = part->next);        /* until done */
 
112
      break;
 
113
  /* case MESSAGE:      */      /* here for documentation */
 
114
      /* Encapsulated messages are always treated as text objects at this point.
 
115
--- 9423,9441 ----
 
116
    dprint(4, (debugfile, "-- pine_encode_body: %d\n", body ? body->type : 0));
 
117
    if (body) switch (body->type) {
 
118
    case TYPEMULTIPART:         /* multi-part */
 
119
!     if (body->topal_hack != 1){
 
120
!       if (!body->parameter) { /* cookie not set up yet? */
 
121
!       char tmp[MAILTMPLEN];   /* make cookie not in BASE64 or QUOTEPRINT*/
 
122
!       sprintf (tmp,"%ld-%ld-%ld=:%ld",gethostid (),random (),(long) time (0),
 
123
!                (long) getpid ());
 
124
!       body->parameter = mail_newbody_parameter ();
 
125
!       body->parameter->attribute = cpystr ("BOUNDARY");
 
126
!       body->parameter->value = cpystr (tmp);
 
127
!       }
 
128
!       part = body->nested.part;       /* encode body parts */
 
129
!       do pine_encode_body (&part->body);
 
130
!       while (part = part->next);      /* until done */
 
131
!     }
 
132
      break;
 
133
  /* case MESSAGE:      */      /* here for documentation */
 
134
      /* Encapsulated messages are always treated as text objects at this point.
 
135
***************
 
136
*** 9592,9598 ****
 
137
  
 
138
      dprint(4, (debugfile, "-- pine_rfc822_output_body: %d\n",
 
139
               body ? body->type : 0));
 
140
!     if(body->type == TYPEMULTIPART) {   /* multipart gets special handling */
 
141
        part = body->nested.part;       /* first body part */
 
142
                                        /* find cookie */
 
143
        for (param = body->parameter; param && !cookie; param = param->next)
 
144
--- 9606,9613 ----
 
145
  
 
146
      dprint(4, (debugfile, "-- pine_rfc822_output_body: %d\n",
 
147
               body ? body->type : 0));
 
148
!     if(body->type == TYPEMULTIPART
 
149
!        && body->topal_hack != 1) {   /* multipart gets special handling */
 
150
        part = body->nested.part;       /* first body part */
 
151
                                        /* find cookie */
 
152
        for (param = body->parameter; param && !cookie; param = param->next)
 
153
***************
 
154
*** 9652,9658 ****
 
155
         * Convert text pieces to canonical form
 
156
         * BEFORE applying any encoding (rfc1341: appendix G)...
 
157
         */
 
158
!       if(body->type == TYPETEXT && body->encoding != ENCBASE64){
 
159
            gf_link_filter(gf_local_nvtnl, NULL);
 
160
        }
 
161
  
 
162
--- 9667,9674 ----
 
163
         * Convert text pieces to canonical form
 
164
         * BEFORE applying any encoding (rfc1341: appendix G)...
 
165
         */
 
166
!       if((body->type == TYPETEXT && body->encoding != ENCBASE64)
 
167
!          | (body->type == TYPEMULTIPART && body->topal_hack == 1)){
 
168
            gf_link_filter(gf_local_nvtnl, NULL);
 
169
        }
 
170
  
 
171
***************
 
172
*** 9752,9766 ****
 
173
                              ? body->subtype
 
174
                              : rfc822_default_subtype (body->type))))
 
175
          return(pwbh_finish(0, so));
 
176
!           
 
177
        if (param){
 
178
!           do
 
179
!             if(!(so_puts(so, "; ")
 
180
!                  && rfc2231_output(so, param->attribute, param->value,
 
181
!                                    (char *) tspecials,
 
182
!                                    ps_global->VAR_CHAR_SET)))
 
183
!               return(pwbh_finish(0, so));
 
184
!           while (param = param->next);
 
185
        }
 
186
        else if(!so_puts(so, "; CHARSET=US-ASCII"))
 
187
          return(pwbh_finish(0, so));
 
188
--- 9768,9794 ----
 
189
                              ? body->subtype
 
190
                              : rfc822_default_subtype (body->type))))
 
191
          return(pwbh_finish(0, so));
 
192
!       
 
193
        if (param){
 
194
!         do
 
195
!           if(body->topal_hack == 1 
 
196
!              && !struncmp(param->attribute, "protocol", 9))
 
197
!             {
 
198
!               if(!(so_puts(so, "; \015\012\011")
 
199
!                    && rfc2231_output(so, param->attribute, param->value,
 
200
!                                      (char *) tspecials,
 
201
!                                      ps_global->VAR_CHAR_SET)))
 
202
!                 return(pwbh_finish(0, so));
 
203
!             }
 
204
!           else
 
205
!             {
 
206
!               if(!(so_puts(so, "; ")
 
207
!                    && rfc2231_output(so, param->attribute, param->value,
 
208
!                                      (char *) tspecials,
 
209
!                                      ps_global->VAR_CHAR_SET)))
 
210
!                 return(pwbh_finish(0, so));
 
211
!             }
 
212
!         while (param = param->next);
 
213
        }
 
214
        else if(!so_puts(so, "; CHARSET=US-ASCII"))
 
215
          return(pwbh_finish(0, so));
 
216
***************
 
217
*** 9991,9997 ****
 
218
      long  l = 0L;
 
219
      PART *part;
 
220
  
 
221
!     if(body->type == TYPEMULTIPART) {   /* multipart gets special handling */
 
222
        part = body->nested.part;       /* first body part */
 
223
        do                              /* for each part */
 
224
          l += send_body_size(&part->body);
 
225
--- 10019,10026 ----
 
226
      long  l = 0L;
 
227
      PART *part;
 
228
  
 
229
!     if(body->type == TYPEMULTIPART
 
230
!        && body->topal_hack != 1) {   /* multipart gets special handling */
 
231
        part = body->nested.part;       /* first body part */
 
232
        do                              /* for each part */
 
233
          l += send_body_size(&part->body);