1
diff -cr alpine-1.00.orig/alpine/send.c alpine-1.00.new/alpine/send.c
2
*** alpine-1.00.orig/alpine/send.c 2007-12-05 17:50:54.000000000 +0000
3
--- alpine-1.00.new/alpine/send.c 2008-01-07 15:19:45.000000000 +0000
7
pbf = save_previous_pbuf;
10
+ /* Topal: Unmangle the body types. */
11
+ if ((*body)->type == TYPEMULTIPART
12
+ && (*body)->topal_hack == 1) {
13
+ /* This was a single part message which Topal mangled. */
14
+ dprint((9, "Topal: unmangling single part message\n"));
15
+ (*body)->type = TYPETEXT;
17
+ if ((*body)->type == TYPEMULTIPART
18
+ && (*body)->topal_hack != 1
19
+ && (*body)->nested.part->body.type == TYPEMULTIPART
20
+ && (*body)->nested.part->body.topal_hack == 1) {
21
+ /* Topal mangled a multipart message. So the first nested part
22
+ is really TYPETEXT. */
23
+ dprint((9, "Topal: unmangling first part of multipart message\n"));
24
+ (*body)->nested.part->body.type = TYPETEXT;
27
dprint((4, "=== send returning ===\n"));
33
rfc822_parse_content_header(nb,
34
(char *) ucase((unsigned char *) buf+8),s);
35
if(nb->type == TYPETEXT
38
|| strucmp(b->subtype, nb->subtype))){
40
! fs_give((void **) &b->subtype);
42
b->subtype = nb->subtype;
45
mail_free_body_parameter(&b->parameter);
46
b->parameter = nb->parameter;
48
mail_free_body_parameter(&nb->parameter);
56
rfc822_parse_content_header(nb,
57
(char *) ucase((unsigned char *) buf+8),s);
58
+ /* Topal: We're working on the first
59
+ text segment of the message. If
60
+ the filter returns something that
61
+ isn't TYPETEXT, then we need to
62
+ pretend (later on) that this is in
63
+ fact a TYPETEXT, because Topal has
64
+ already encoded it....
66
+ Original code path first, then an
69
if(nb->type == TYPETEXT
72
|| strucmp(b->subtype, nb->subtype))){
74
! fs_give((void **) &b->subtype);
76
! b->subtype = nb->subtype;
79
! mail_free_body_parameter(&b->parameter);
80
! b->parameter = nb->parameter;
81
! nb->parameter = NULL;
82
! mail_free_body_parameter(&nb->parameter);
84
! else if(F_ON(F_ENABLE_TOPAL_HACK, ps_global)){
85
! /* Perhaps the type isn't TYPETEXT,
86
! and the hack is requested. So,
87
! let's mess with the types. */
88
! if(nb->type != TYPETEXT){
90
b->subtype = nb->subtype;
93
! dprint((9, "Topal: mangling body!\n"));
94
mail_free_body_parameter(&b->parameter);
95
b->parameter = nb->parameter;
97
mail_free_body_parameter(&nb->parameter);
105
Only in alpine-1.00.new/imap: ip6
106
diff -cr alpine-1.00.orig/imap/src/c-client/mail.h alpine-1.00.new/imap/src/c-client/mail.h
107
*** alpine-1.00.orig/imap/src/c-client/mail.h 2007-11-19 23:32:35.000000000 +0000
108
--- alpine-1.00.new/imap/src/c-client/mail.h 2008-01-07 12:54:20.000000000 +0000
112
unsigned long bytes; /* size of text in octets */
114
char *md5; /* MD5 checksum */
115
+ unsigned short topal_hack; /* set to 1 if topal has wrecked the sending */
116
void *sparep; /* spare pointer reserved for main program */
119
diff -cr alpine-1.00.orig/pith/conf.c alpine-1.00.new/pith/conf.c
120
*** alpine-1.00.orig/pith/conf.c 2007-12-13 19:31:13.000000000 +0000
121
--- alpine-1.00.new/pith/conf.c 2008-01-07 14:00:58.000000000 +0000
125
F_SEND_WO_CONFIRM, h_config_send_wo_confirm, PREF_SEND, 0},
126
{"strip-whitespace-before-send", "Strip Whitespace Before Sending",
127
F_STRIP_WS_BEFORE_SEND, h_config_strip_ws_before_send, PREF_SEND, 0},
128
+ {"enable-topal-hack", "Enable Topal hack for OpenPGP/MIME messages",
129
+ F_ENABLE_TOPAL_HACK, h_config_enable_topal_hack, PREF_HIDDEN, 0},
130
{"warn-if-blank-subject", "Warn if Blank Subject",
131
F_WARN_ABOUT_NO_SUBJECT, h_config_warn_if_subj_blank, PREF_SEND, 0},
132
{"warn-if-blank-to-and-cc-and-newsgroups", "Warn if Blank To and CC and Newsgroups",
133
diff -cr alpine-1.00.orig/pith/conftype.h alpine-1.00.new/pith/conftype.h
134
*** alpine-1.00.orig/pith/conftype.h 2007-11-08 01:14:02.000000000 +0000
135
--- alpine-1.00.new/pith/conftype.h 2008-01-07 12:50:47.000000000 +0000
140
F_MULNEWSRC_HOSTNAMES_AS_TYPED,
141
F_STRIP_WS_BEFORE_SEND,
142
+ F_ENABLE_TOPAL_HACK,
144
F_COMPOSE_ALWAYS_DOWNGRADE,
145
F_SORT_DEFAULT_FCC_ALPHA,
146
diff -cr alpine-1.00.orig/pith/pine.hlp alpine-1.00.new/pith/pine.hlp
147
*** alpine-1.00.orig/pith/pine.hlp 2007-12-20 16:34:31.000000000 +0000
148
--- alpine-1.00.new/pith/pine.hlp 2008-01-07 12:47:42.000000000 +0000
152
<li><a href="h_config_strip_sigdashes">FEATURE: <!--#echo var="FEAT_strip-from-sigdashes-on-reply"--></a>
153
<li><a href="h_config_forward_as_attachment">FEATURE: <!--#echo var="FEAT_forward-as-attachment"--></a>
154
<li><a href="h_config_strip_ws_before_send">FEATURE: <!--#echo var="FEAT_strip-whitespace-before-send"--></a>
155
+ <li><a href="h_config_enable_topal_hack">FEATURE: <!--#echo var="FEAT_enable-topal-hack"--></a>
156
<li><a href="h_config_quell_attach_ext_warn">FEATURE: <!--#echo var="FEAT_quell-attachment-extension-warn"--></a>
157
<li><a href="h_config_quell_attach_extra_prompt">FEATURE: <!--#echo var="FEAT_quell-attachment-extra-prompt"--></a>
158
<li><a href="h_config_no_bezerk_zone">FEATURE: <!--#echo var="FEAT_quell-berkeley-format-timezone"--></a>
162
<End of help on this topic>
165
+ ====== h_config_enable_topal_hack =====
168
+ <TITLE>FEATURE: <!--#echo var="FEAT_enable-topal-hack"--></TITLE>
171
+ <H1>FEATURE: <!--#echo var="FEAT_enable-topal-hack"--></H1>
173
+ This feature allows Topal (and other sending-filters) to change the
174
+ MIME type of the email. This is potentially dangerous because it
175
+ pretends that multipart emails are plain emails.
177
+ <End of help on this topic>
180
====== h_config_del_from_dot =====
183
diff -cr alpine-1.00.orig/pith/send.c alpine-1.00.new/pith/send.c
184
*** alpine-1.00.orig/pith/send.c 2007-12-01 01:10:52.000000000 +0000
185
--- alpine-1.00.new/pith/send.c 2008-01-07 15:18:45.000000000 +0000
188
long pine_rfc822_output_body(BODY *,soutr_t,TCPSTREAM *);
189
int pine_write_body_header(BODY *, soutr_t, TCPSTREAM *);
190
int pine_write_header_line(char *, char *, STORE_S *);
191
! int pine_write_params(PARAMETER *, STORE_S *);
192
char *tidy_smtp_mess(char *, char *, char *, size_t);
193
int lmc_body_header_line(char *, int);
194
int lmc_body_header_finish(void);
196
long pine_rfc822_output_body(BODY *,soutr_t,TCPSTREAM *);
197
int pine_write_body_header(BODY *, soutr_t, TCPSTREAM *);
198
int pine_write_header_line(char *, char *, STORE_S *);
199
! int pine_write_params(PARAMETER *, STORE_S *, BODY *);
200
char *tidy_smtp_mess(char *, char *, char *, size_t);
201
int lmc_body_header_line(char *, int);
202
int lmc_body_header_finish(void);
206
/* set up counts and such to keep track sent percentage */
208
gf_filter_init(); /* zero piped byte count, 'n */
209
+ dprint((1, "Topal: HERE 1!\n"));
210
send_bytes_to_send = send_body_size(body); /* count body bytes */
211
+ dprint((1, "Topal: HERE 2!\n"));
212
ps_global->c_client_error[0] = error_buf[0] = '\0';
213
we_cancel = busy_cue(_("Sending mail"),
214
send_bytes_to_send ? sent_percent : NULL, 0);
221
+ dprint((1, "Topal: HERE 3!\n"));
225
* If the user's asked for it, and we find that the first text
226
* part (attachments all get b64'd) is non-7bit, ask for 8BITMIME.
230
if(F_ON(F_ENABLE_8BIT, ps_global) && (bp = first_text_8bit(body)))
231
smtp_opts |= SOP_8BITMIME;
233
+ dprint((1, "Topal: HERE 3.1!\n"));
236
if(debug > 5 || (flags & CM_VERBOSE))
243
+ dprint((1, "Topal: HERE 4!\n"));
246
* Install our rfc822 output routine
248
sending_hooks.rfc822_out = mail_parameters(NULL, GET_RFC822OUTPUT, NULL);
249
(void)mail_parameters(NULL, SET_RFC822OUTPUT, (void *)post_rfc822_output);
250
+ dprint((1, "Topal: HERE 5!\n"));
253
* Allow for verbose posting
255
(void) mail_parameters(NULL, SET_SMTPVERBOSE,
256
(void *) pine_smtp_verbose_out);
257
+ dprint((1, "Topal: HERE 6!\n"));
260
* We do this because we want mm_log to put the error message into
265
ps_global->noshow_error = 0;
267
+ dprint((1, "Topal: HERE 7!\n"));
268
TIME_STAMP("smtp open", 1);
270
unsigned short save_encoding, added_encoding;
274
first_text_8bit(struct mail_bodystruct *body)
276
! if(body->type == TYPEMULTIPART) /* advance to first contained part */
277
body = &body->nested.part->body;
279
return((body->type == TYPETEXT && body->encoding != ENC7BIT)
284
first_text_8bit(struct mail_bodystruct *body)
286
! /* Be careful of Topal changes... */
287
! if(body->type == TYPEMULTIPART
288
! && body->topal_hack != 1) /* advance to first contained part */
289
body = &body->nested.part->body;
291
+ /* Topal: this bit might not be correct, now. */
292
return((body->type == TYPETEXT && body->encoding != ENC7BIT)
297
dprint((4, "-- pine_encode_body: %d\n", body ? body->type : 0));
298
if (body) switch (body->type) {
299
case TYPEMULTIPART: /* multi-part */
300
! if (!body->parameter) { /* cookie not set up yet? */
301
char tmp[MAILTMPLEN]; /* make cookie not in BASE64 or QUOTEPRINT*/
303
snprintf (tmp,sizeof(tmp),"%ld-%ld-%ld=:%ld",gethostid (),random (),(long) time (0),
305
tmp[sizeof(tmp)-1] = '\0';
306
set_parameter(&body->parameter, "BOUNDARY", tmp);
308
- part = body->nested.part; /* encode body parts */
309
- do pine_encode_body (&part->body);
310
- while ((part = part->next) != NULL); /* until done */
315
* If the part is text we edited, then it is UTF-8.
317
dprint((4, "-- pine_encode_body: %d\n", body ? body->type : 0));
318
if (body) switch (body->type) {
319
case TYPEMULTIPART: /* multi-part */
320
! if (body->topal_hack != 1) { /* But only if Topal hasn't touched it! */
321
! if (!body->parameter) { /* cookie not set up yet? */
322
char tmp[MAILTMPLEN]; /* make cookie not in BASE64 or QUOTEPRINT*/
324
snprintf (tmp,sizeof(tmp),"%ld-%ld-%ld=:%ld",gethostid (),random (),(long) time (0),
326
tmp[sizeof(tmp)-1] = '\0';
327
set_parameter(&body->parameter, "BOUNDARY", tmp);
329
+ part = body->nested.part; /* encode body parts */
330
+ do pine_encode_body (&part->body);
331
+ while ((part = part->next) != NULL); /* until done */
337
* If the part is text we edited, then it is UTF-8.
341
dprint((4, "-- pine_rfc822_output_body: %d\n",
342
body ? body->type : 0));
343
! if(body->type == TYPEMULTIPART) { /* multipart gets special handling */
344
part = body->nested.part; /* first body part */
346
for (param = body->parameter; param && !cookie; param = param->next)
349
dprint((4, "-- pine_rfc822_output_body: %d\n",
350
body ? body->type : 0));
351
! if(body->type == TYPEMULTIPART
352
! && body->topal_hack != 1) { /* multipart gets special handling,
353
! unless Topal messed with it */
354
part = body->nested.part; /* first body part */
356
for (param = body->parameter; param && !cookie; param = param->next)
359
* BEFORE applying any encoding (rfc1341: appendix G)...
360
* NOTE: almost all filters expect CRLF newlines
362
! if(body->type == TYPETEXT
363
! && body->encoding != ENCBASE64
364
&& !so_attr((STORE_S *) body->contents.text.data, "rawbody", NULL)){
365
! gf_link_filter(gf_local_nvtnl, NULL);
368
switch (body->encoding) { /* all else needs filtering */
370
* BEFORE applying any encoding (rfc1341: appendix G)...
371
* NOTE: almost all filters expect CRLF newlines
373
! if(((body->type == TYPETEXT
374
! && body->encoding != ENCBASE64)
375
! /* Or if Topal mucked with it... */
376
! | (body->type == TYPEMULTIPART && body->topal_hack == 1))
377
&& !so_attr((STORE_S *) body->contents.text.data, "rawbody", NULL)){
378
! if(body->topal_hack == 1)
379
! dprint((9, "Topal: Canonical conversion, although Topal has mangled...\n"));
380
! gf_link_filter(gf_local_nvtnl, NULL);
383
switch (body->encoding) { /* all else needs filtering */
386
return(pwbh_finish(0, so));
389
! if(!pine_write_params(body->parameter, so))
390
return(pwbh_finish(0, so));
392
else if(!so_puts(so, "; CHARSET=US-ASCII"))
394
return(pwbh_finish(0, so));
397
! if(!pine_write_params(body->parameter, so, body))
398
return(pwbh_finish(0, so));
400
else if(!so_puts(so, "; CHARSET=US-ASCII"))
403
&& so_puts(so, body->disposition.type)))
404
return(pwbh_finish(0, so));
406
! if(!pine_write_params(body->disposition.parameter, so))
407
return(pwbh_finish(0, so));
409
if(!so_puts(so, "\015\012"))
411
&& so_puts(so, body->disposition.type)))
412
return(pwbh_finish(0, so));
414
! if(!pine_write_params(body->disposition.parameter, so, body))
415
return(pwbh_finish(0, so));
417
if(!so_puts(so, "\015\012"))
420
* pine_write_param - convert, encode and write MIME header-field parameters
423
! pine_write_params(PARAMETER *param, STORE_S *so)
425
for(; param; param = param->next){
428
* pine_write_param - convert, encode and write MIME header-field parameters
431
! pine_write_params(PARAMETER *param, STORE_S *so, BODY *body)
433
for(; param; param = param->next){
438
cs = posting_characterset(param->value, NULL, HdrText);
439
cv = utf8_to_charset(param->value, cs, 0);
440
! rv = (so_puts(so, "; ")
441
! && rfc2231_output(so, param->attribute, cv, (char *) tspecials, cs));
443
if(cv && cv != param->value)
444
fs_give((void **) &cv);
448
cs = posting_characterset(param->value, NULL, HdrText);
449
cv = utf8_to_charset(param->value, cs, 0);
450
! if (body->topal_hack == 1
451
! && !struncmp(param->attribute, "protocol", 9)) {
452
! /* Did Topal introduce more parameters? */
453
! dprint((9, "Topal: parameter encoding of protocol, with Topal hack\n"));
454
! rv = (so_puts(so, "; \015\012\011")
455
! && rfc2231_output(so, param->attribute, cv, (char *) tspecials, cs));
458
! rv = (so_puts(so, "; ")
459
! && rfc2231_output(so, param->attribute, cv, (char *) tspecials, cs));
461
if(cv && cv != param->value)
462
fs_give((void **) &cv);
469
! if(body->type == TYPEMULTIPART) { /* multipart gets special handling */
470
part = body->nested.part; /* first body part */
471
do /* for each part */
472
l += send_body_size(&part->body);
477
! if(body->type == TYPEMULTIPART
478
! && body->topal_hack != 1) { /* multipart gets special handling
479
! but again, be careful of Topal */
480
part = body->nested.part; /* first body part */
481
do /* for each part */
482
l += send_body_size(&part->body);
483
Only in alpine-1.00.orig/po: Makefile.in
484
Only in alpine-1.00.new/po: stamp-po
485
Only in alpine-1.00.new/regex: .deps
486
Only in alpine-1.00.new/regex: Makefile
487
diff -cr alpine-1.00.orig/web/src/alpined.d/compilation alpine-1.00.new/web/src/alpined.d/compilation
488
*** alpine-1.00.orig/web/src/alpined.d/compilation 2007-12-15 00:27:02.000000000 +0000
489
--- alpine-1.00.new/web/src/alpined.d/compilation 2008-01-07 13:57:51.000000000 +0000
495
Only in alpine-1.00.new/web/src: Makefile
496
Only in alpine-1.00.new/web/src/pubcookie: .deps
497
Only in alpine-1.00.new/web/src/pubcookie: Makefile