1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
|
--- mailx-12.4/ChangeLog
+++ nail/ChangeLog
@@ -1,3 +1,38 @@
+[12.5] as of 7/5/10
+* The undocumented contenttype-cntrl option works again (patch by
+ Laurent Parenteau).
+
+[12.5] as of 6/20/10
+* Fixed a message corruption that occurred when the "inc" command was used
+ with a mbox format mailbox after encrypted messages had been viewed
+ (reported by Martin Neitzel).
+* Fixed a condition that caused mailx to hang when looking at a message,
+ copying that message, and issuing a "z" command evaluating an uncached
+ portion of an IMAP folder.
+* Make it compile with OpenSSL 1.0.0-beta2 (patch by Bernhard Rosenkränzer).
+* When executing an "account" command, ensure that the values of the "hold",
+ "keepsave", "append", and "emptybox" variables remain those of the previous
+ account for all outstanding operations on that account (bug reported by
+ Jeff Woodall).
+* Support Gmail IMAP semantics of "delete" turning into "archive". Previously,
+ when mailx was setting the "\Deleted" flag on a message, it did not set any
+ other flags. This caused mails that had been read and then deleted to appear
+ as unread in Gmail's "All Mail". Now, flags besides "\Deleted" are also set,
+ so that they are kept in the archived copy (reported by Jeremy O'Brien).
+* For RFC 2047 MIME "encoded-word" parts in headers, assume that the end of
+ each word resets the conversion state (Yedidyah Bar-David).
+* When the ORGANIZATION variable has an empty value, do not generate an
+ "Organization:" header field. Previously, this condition resulted in
+ mailx refusing to send mail (Thomas E. Kammeyer).
+* When classifying messages with the junk filter, when selecting the most
+ representative tokens, prefer non-junk tokens over junk tokens if both
+ have the same (reversed) probability, in order to avoid false positives.
+* When calculating the probabilities of tokens that have occurred only in
+ good messages or only in junk messages so far, and these tokens occurred
+ less than ten times, give them slightly less than the minimum/maximum.
+* Fixed "unignore" and similar commands; they did not work at all so far
+ (http://www.freebsd.org/cgi/query-pr.cgi?pr=146280).
+
[12.4] released 7/29/08
* With the "-E" command line option or if the "skipemptybody" variable is
set, outgoing messages that contain no text in their first or only part
--- mailx-12.4/cmd2.c
+++ nail/cmd2.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)cmd2.c 2.46 (gritter) 3/4/06";
+static char sccsid[] = "@(#)cmd2.c 2.47 (gritter) 5/9/10";
#endif
#endif /* not lint */
@@ -803,16 +803,17 @@
int h = hash(name);
for (ip = tab->i_head[h]; ip; ip = ip->i_link) {
- if (asccasecmp(ip->i_field, name)) {
+ if (asccasecmp(ip->i_field, name) == 0) {
free(ip->i_field);
if (iq != NULL)
iq->i_link = ip->i_link;
else
- tab->i_head[h] = NULL;
+ tab->i_head[h] = ip->i_link;
free(ip);
tab->i_count--;
break;
}
+ iq = ip;
}
}
--- mailx-12.4/cmd3.c
+++ nail/cmd3.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)cmd3.c 2.86 (gritter) 10/1/07";
+static char sccsid[] = "@(#)cmd3.c 2.87 (gritter) 10/1/08";
#endif
#endif /* not lint */
@@ -1311,7 +1311,7 @@
char **args = (char **)v;
struct oldaccount *a;
char *cp;
- int i, mc;
+ int i, mc, oqf, nqf;
FILE *fp = stdout;
if (args[0] == NULL) {
@@ -1345,6 +1345,7 @@
return define1(args[0], 1);
}
strncpy(mboxname, expand("&"), sizeof mboxname)[sizeof mboxname-1]='\0';
+ oqf = savequitflags();
if ((a = get_oldaccount(args[0])) == NULL) {
if (args[1]) {
a = scalloc(1, sizeof *a);
@@ -1368,8 +1369,13 @@
unset_allow_undefined = 1;
set(a->ac_vars);
unset_allow_undefined = 0;
- setf: if (!starting)
- return file1("%");
+ setf: if (!starting) {
+ nqf = savequitflags();
+ restorequitflags(oqf);
+ i = file1("%");
+ restorequitflags(nqf);
+ return i;
+ }
}
return 0;
}
--- mailx-12.4/extern.h
+++ nail/extern.h
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * Sccsid @(#)extern.h 2.161 (gritter) 10/1/07
+ * Sccsid @(#)extern.h 2.162 (gritter) 10/1/08
*/
/* aux.c */
@@ -446,6 +446,8 @@
void quit(void);
int holdbits(void);
enum okay makembox(void);
+int savequitflags(void);
+void restorequitflags(int);
/* send.c */
char *foldergets(char **s, size_t *size, size_t *count, size_t *llen,
FILE *stream);
@@ -513,12 +515,12 @@
void demail(void);
char *username(void);
/* vars.c */
-void assign(char *name, char *value);
+void assign(const char *name, const char *value);
char *vcopy(const char *str);
char *value(const char *name);
struct grouphead *findgroup(char *name);
void printgroup(char *name);
int hash(const char *name);
-int unset_internal(char *name);
+int unset_internal(const char *name);
void remove_group(const char *name);
/* version.c */
--- mailx-12.4/fio.c
+++ nail/fio.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)fio.c 2.73 (gritter) 1/7/08";
+static char sccsid[] = "@(#)fio.c 2.76 (gritter) 9/16/09";
#endif
#endif /* not lint */
@@ -108,6 +108,7 @@
memset(&this, 0, sizeof this);
this.m_flag = MUSED|MNEW|MNEWEST;
filesize = mailsize - offset;
+ offset = ftell(mb.mb_otf);
for (;;) {
if (fgetline(&linebuf, &linesize, &filesize, &count, ibuf, 0)
== NULL) {
@@ -1050,7 +1051,8 @@
NI_NUMERICHOST) != 0)
strcpy(hbuf, "unknown host");
fprintf(stderr, catgets(catd, CATSET, 192,
- "Connecting to %s . . ."), hbuf);
+ "Connecting to %s:%s . . ."),
+ hbuf, portstr);
}
if ((sockfd = socket(res->ai_family, res->ai_socktype,
res->ai_protocol)) >= 0) {
@@ -1068,26 +1070,25 @@
freeaddrinfo(res0);
#else /* !HAVE_IPv6_FUNCS */
if (port == 0) {
- if ((ep = getservbyname((char *)portstr, "tcp")) == NULL) {
- if (equal(portstr, "smtp"))
- port = htons(25);
- else if (equal(portstr, "smtps"))
- port = htons(465);
- else if (equal(portstr, "imap"))
- port = htons(143);
- else if (equal(portstr, "imaps"))
- port = htons(993);
- else if (equal(portstr, "pop3"))
- port = htons(110);
- else if (equal(portstr, "pop3s"))
- port = htons(995);
- else {
- fprintf(stderr, catgets(catd, CATSET, 251,
- "Unknown service: %s\n"), portstr);
- return STOP;
- }
- } else
+ if (equal(portstr, "smtp"))
+ port = htons(25);
+ else if (equal(portstr, "smtps"))
+ port = htons(465);
+ else if (equal(portstr, "imap"))
+ port = htons(143);
+ else if (equal(portstr, "imaps"))
+ port = htons(993);
+ else if (equal(portstr, "pop3"))
+ port = htons(110);
+ else if (equal(portstr, "pop3s"))
+ port = htons(995);
+ else if ((ep = getservbyname((char *)portstr, "tcp")) != NULL)
port = ep->s_port;
+ else {
+ fprintf(stderr, catgets(catd, CATSET, 251,
+ "Unknown service: %s\n"), portstr);
+ return STOP;
+ }
} else
port = htons(port);
if (verbose)
@@ -1109,7 +1110,8 @@
memcpy(&servaddr.sin_addr, *pptr, sizeof(struct in_addr));
if (verbose)
fprintf(stderr, catgets(catd, CATSET, 192,
- "Connecting to %s . . ."), inet_ntoa(**pptr));
+ "Connecting to %s:%d . . ."),
+ inet_ntoa(**pptr), ntohs(port));
if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof servaddr)
!= 0) {
perror(catgets(catd, CATSET, 254, "could not connect"));
--- mailx-12.4/imap.c
+++ nail/imap.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)imap.c 1.219 (gritter) 1/6/08";
+static char sccsid[] = "@(#)imap.c 1.222 (gritter) 3/13/09";
#endif
#endif /* not lint */
@@ -1821,57 +1821,62 @@
* reading their results.
*/
needstat = stored > 0 && stored % 800 == 0;
+ /*
+ * Even if this message has been deleted, continue
+ * to set further flags. This is necessary to support
+ * Gmail semantics, where "delete" actually means
+ * "archive", and the flags are applied to the copy
+ * in "All Mail".
+ */
+ if ((m->m_flag&(MREAD|MSTATUS)) == (MREAD|MSTATUS)) {
+ imap_store(mp, m, m-message+1,
+ '+', "\\Seen", needstat);
+ stored++;
+ }
+ if (m->m_flag & MFLAG) {
+ imap_store(mp, m, m-message+1,
+ '+', "\\Flagged", needstat);
+ stored++;
+ }
+ if (m->m_flag & MUNFLAG) {
+ imap_store(mp, m, m-message+1,
+ '-', "\\Flagged", needstat);
+ stored++;
+ }
+ if (m->m_flag & MANSWER) {
+ imap_store(mp, m, m-message+1,
+ '+', "\\Answered", needstat);
+ stored++;
+ }
+ if (m->m_flag & MUNANSWER) {
+ imap_store(mp, m, m-message+1,
+ '-', "\\Answered", needstat);
+ stored++;
+ }
+ if (m->m_flag & MDRAFT) {
+ imap_store(mp, m, m-message+1,
+ '+', "\\Draft", needstat);
+ stored++;
+ }
+ if (m->m_flag & MUNDRAFT) {
+ imap_store(mp, m, m-message+1,
+ '-', "\\Draft", needstat);
+ stored++;
+ }
if (dodel) {
imap_delete(mp, m-message+1, m, needstat);
stored++;
gotcha++;
- } else {
- if ((m->m_flag&(MREAD|MSTATUS)) == (MREAD|MSTATUS)) {
- imap_store(mp, m, m-message+1,
- '+', "\\Seen", needstat);
- stored++;
- }
- if (m->m_flag & MFLAG) {
- imap_store(mp, m, m-message+1,
- '+', "\\Flagged", needstat);
- stored++;
- }
- if (m->m_flag & MUNFLAG) {
- imap_store(mp, m, m-message+1,
- '-', "\\Flagged", needstat);
- stored++;
- }
- if (m->m_flag & MANSWER) {
- imap_store(mp, m, m-message+1,
- '+', "\\Answered", needstat);
- stored++;
- }
- if (m->m_flag & MUNANSWER) {
- imap_store(mp, m, m-message+1,
- '-', "\\Answered", needstat);
- stored++;
- }
- if (m->m_flag & MDRAFT) {
- imap_store(mp, m, m-message+1,
- '+', "\\Draft", needstat);
- stored++;
- }
- if (m->m_flag & MUNDRAFT) {
- imap_store(mp, m, m-message+1,
- '-', "\\Draft", needstat);
- stored++;
- }
- if (mp->mb_type != MB_CACHE ||
- !edit && (!(m->m_flag&(MBOXED|MSAVED|MDELETED))
- || (m->m_flag &
- (MBOXED|MPRESERVE|MTOUCH)) ==
- (MPRESERVE|MTOUCH)) ||
- edit && !(m->m_flag & MDELETED))
- held++;
- if (m->m_flag & MNEW) {
- m->m_flag &= ~MNEW;
- m->m_flag |= MSTATUS;
- }
+ } else if (mp->mb_type != MB_CACHE ||
+ !edit && (!(m->m_flag&(MBOXED|MSAVED|MDELETED))
+ || (m->m_flag &
+ (MBOXED|MPRESERVE|MTOUCH)) ==
+ (MPRESERVE|MTOUCH)) ||
+ edit && !(m->m_flag & MDELETED))
+ held++;
+ if (m->m_flag & MNEW) {
+ m->m_flag &= ~MNEW;
+ m->m_flag |= MSTATUS;
}
}
bypass: if (readstat != NULL)
@@ -2571,6 +2576,7 @@
const char *qname;
enum okay ok = STOP;
int twice = 0;
+ int stored = 0;
FILE *queuefp = NULL;
if (mp->mb_type == MB_CACHE) {
@@ -2629,20 +2635,38 @@
* ... and reset the flag to its initial value so that
* the 'exit' command still leaves the message unread.
*/
-out: if ((m->m_flag&(MREAD|MSTATUS)) == (MREAD|MSTATUS))
+out: if ((m->m_flag&(MREAD|MSTATUS)) == (MREAD|MSTATUS)) {
imap_store(mp, m, n, '-', "\\Seen", 0);
- if (m->m_flag&MFLAG)
+ stored++;
+ }
+ if (m->m_flag&MFLAG) {
imap_store(mp, m, n, '-', "\\Flagged", 0);
- if (m->m_flag&MUNFLAG)
+ stored++;
+ }
+ if (m->m_flag&MUNFLAG) {
imap_store(mp, m, n, '+', "\\Flagged", 0);
- if (m->m_flag&MANSWER)
+ stored++;
+ }
+ if (m->m_flag&MANSWER) {
imap_store(mp, m, n, '-', "\\Answered", 0);
- if (m->m_flag&MUNANSWER)
+ stored++;
+ }
+ if (m->m_flag&MUNANSWER) {
imap_store(mp, m, n, '+', "\\Answered", 0);
- if (m->m_flag&MDRAFT)
+ stored++;
+ }
+ if (m->m_flag&MDRAFT) {
imap_store(mp, m, n, '-', "\\Draft", 0);
- if (m->m_flag&MUNDRAFT)
+ stored++;
+ }
+ if (m->m_flag&MUNDRAFT) {
imap_store(mp, m, n, '+', "\\Draft", 0);
+ stored++;
+ }
+ if (stored) {
+ mp->mb_active |= MB_COMD;
+ imap_finish(mp);
+ }
return ok;
}
--- mailx-12.4/junk.c
+++ nail/junk.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)junk.c 1.73 (gritter) 3/4/06";
+static char sccsid[] = "@(#)junk.c 1.75 (gritter) 9/14/08";
#endif
#endif /* not lint */
@@ -920,6 +920,10 @@
smin(1.0, nbad ? (float)b/nbad : 0.0));
p = smin(TOP, p);
p = smax(BOT, p);
+ if (p == TOP && b <= 10 && g == 0)
+ p -= BOT;
+ else if (p == BOT && g <= 10 && b == 0)
+ p += BOT;
} else if (g == 0 && b == 0)
p = DFL;
else
@@ -1095,13 +1099,20 @@
if (h1 == best[i].hash1 && h2 == best[i].hash2)
break;
/*
- * This selection prefers words from the end of the
- * header and from the start of the body. It does
- * probably not matter much at all, but gives at
- * least the most interesting verbose output.
+ * For equal distance, this selection prefers
+ * words with a low probability, since a false
+ * negative is better than a false positive,
+ * and since experience has shown that false
+ * positives are more likely otherwise. Then,
+ * words from the end of the header and from
+ * the start of the body are preferred. This
+ * gives the most interesting verbose output.
*/
- if (d > best[i].dist || best[i].loc == HEADER &&
- d >= best[i].dist) {
+ if (d > best[i].dist ||
+ d == best[i].dist &&
+ p < best[i].prob ||
+ best[i].loc == HEADER &&
+ d == best[i].dist) {
for (j = BEST-2; j >= i; j--)
best[j+1] = best[j];
best[i].dist = d;
--- mailx-12.4/list.c
+++ nail/list.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)list.c 2.61 (gritter) 01/07/07";
+static char sccsid[] = "@(#)list.c 2.62 (gritter) 12/11/08";
#endif
#endif /* not lint */
@@ -438,7 +438,7 @@
if (!inhook)
printf(tback ?
"No previously marked messages.\n" :
- "No messages satify (criteria).\n");
+ "No messages satisfy (criteria).\n");
markall_ret(-1)
}
}
--- mailx-12.4/mailx.1
+++ nail/mailx.1
@@ -34,9 +34,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" Sccsid: @(#)mailx.1 2.326 (gritter) 10/1/07
+.\" Sccsid: @(#)mailx.1 2.329 (gritter) 10/9/10
.\"
-.TH MAILX 1 "10/1/07" "Heirloom mailx 12.4" "User Commands"
+.TH MAILX 1 "10/9/10" "Heirloom mailx 12.5" "User Commands"
.SH NAME
mailx \- send and receive Internet mail
.SH SYNOPSIS
@@ -418,6 +418,21 @@
.I address
All messages from
.IR address .
+By default, this is a case-sensitive search
+for the complete email address.
+If the
+.I allnet
+variable is set,
+only the local part of the addresses is evaluated for the comparison.
+Otherwise if the
+.I showname
+variable is set,
+a case-sensitive search for the complete real name
+of a sender is performed.
+The IMAP-style
+.BI (from\ address)
+expression can be used instead
+if substring matches are desired.
.TP
.BI ( criterion )
All messages that satisfy the given IMAP-style SEARCH
@@ -3766,7 +3781,7 @@
.sp
.fi
which might cause
-.N mailx
+.B mailx
to respond with, for example:
.nf
.sp
--- mailx-12.4/makeconfig
+++ nail/makeconfig
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Sccsid @(#)makeconfig 1.43 (gritter) 4/14/07
+# Sccsid @(#)makeconfig 1.44 (gritter) 5/26/09
#
tmp=___build$$
@@ -393,6 +393,25 @@
!
fi
+if test x$have_openssl = xyes
+then
+ compile_check stack_of 'for STACK_OF()' '#define HAVE_STACK_OF' <<\!
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/x509v3.h>
+#include <openssl/x509.h>
+#include <openssl/rand.h>
+
+int main(void)
+{
+ STACK_OF(GENERAL_NAME) *gens = NULL;
+ printf("%p", gens); /* to make it used */
+ SSLv23_client_method();
+ PEM_read_PrivateKey(0, 0, 0, 0);
+ return 0;
+}
+!
+fi
cat >$tmp2.c <<\!
#include <gssapi/gssapi.h>
--- mailx-12.4/mime.c
+++ nail/mime.c
@@ -40,7 +40,7 @@
#ifdef DOSCCS
static char copyright[]
= "@(#) Copyright (c) 2000, 2002 Gunnar Ritter. All rights reserved.\n";
-static char sccsid[] = "@(#)mime.c 2.69 (gritter) 6/29/08";
+static char sccsid[] = "@(#)mime.c 2.71 (gritter) 7/5/10";
#endif /* DOSCCS */
#endif /* not lint */
@@ -788,8 +788,7 @@
*isclean = mime_isclean(fp);
if (*isclean & MIME_HASNUL ||
- *contenttype && ascncasecmp(*contenttype, "text/", 5) ||
- *contenttype == NULL && *isclean & MIME_CTRLCHAR) {
+ *contenttype && ascncasecmp(*contenttype, "text/", 5)) {
convert = CONV_TOB64;
if (*contenttype == NULL ||
ascncasecmp(*contenttype, "text/", 5) == 0)
@@ -809,6 +808,7 @@
*contenttype = "application/octet-stream";
*charset = NULL;
} if (*isclean & MIME_CTRLCHAR) {
+ convert = CONV_TOB64;
/*
* RFC 2046 forbids control characters other than
* ^I or ^L in text/plain bodies. However, some
@@ -1048,12 +1048,22 @@
uptr = nptr + outleft;
iptr = cout.s;
if (iconv_ft(fhicd, &iptr, &inleft,
- &nptr, &outleft) != 0 &&
+ &nptr, &outleft) == (size_t)-1 &&
errno == E2BIG) {
iconv(fhicd, NULL, NULL, NULL, NULL);
mime_fromhdr_inc(inleft);
goto again;
}
+ /*
+ * For state-dependent encodings,
+ * reset the state here, assuming
+ * that states are restricted to
+ * single encoded-word parts.
+ */
+ while (iconv(fhicd, NULL, NULL,
+ &nptr, &outleft) == (size_t)-1 &&
+ errno == E2BIG)
+ mime_fromhdr_inc(16);
out->l += uptr - mptr - outleft;
q += uptr - mptr - outleft;
} else {
@@ -1295,7 +1305,7 @@
isz = len;
op = cbuf;
osz = cbufsz;
- if (iconv(iconvd, &ip, &isz, &op, &osz) != 0) {
+ if (iconv(iconvd, &ip, &isz, &op, &osz) == (size_t)-1) {
if (errno != E2BIG) {
ac_free(cbuf);
return 0;
@@ -1489,7 +1499,8 @@
outleft = mptrsz;
nptr = mptr;
iptr = ptr;
- if (iconv_ft(iconvd, &iptr, &inleft, &nptr, &outleft) != 0 &&
+ if (iconv_ft(iconvd, &iptr, &inleft, &nptr, &outleft) ==
+ (size_t)-1 &&
errno == E2BIG) {
iconv(iconvd, NULL, NULL, NULL, NULL);
ac_free(mptr);
--- mailx-12.4/nail.rc
+++ nail/nail.rc
@@ -4,7 +4,7 @@
# This file is not overwritten when 'make install' is run in
# the mailx build process again.
-# Sccsid @(#)nail.rc 2.10 (gritter) 3/4/06
+# Sccsid @(#)nail.rc 2.11 (gritter) 8/2/08
# Do not forward to mbox by default since this is likely to be
# irritating for most users today.
@@ -54,6 +54,9 @@
# If threaded mode is activated, automatically collapse thread.
set autocollapse
+
+# Mark messages that have been answered.
+set markanswered
# Hide some header fields which are uninteresting for most human readers.
ignore received in-reply-to message-id references
--- mailx-12.4/openssl.c
+++ nail/openssl.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)openssl.c 1.25 (gritter) 8/4/07";
+static char sccsid[] = "@(#)openssl.c 1.26 (gritter) 5/26/09";
#endif
#endif /* not lint */
@@ -101,12 +101,17 @@
static int ssl_rand_init(void);
static void ssl_init(void);
static int ssl_verify_cb(int success, X509_STORE_CTX *store);
-static SSL_METHOD *ssl_select_method(const char *uhp);
+static const SSL_METHOD *ssl_select_method(const char *uhp);
static void ssl_load_verifications(struct sock *sp);
static void ssl_certificate(struct sock *sp, const char *uhp);
static enum okay ssl_check_host(const char *server, struct sock *sp);
+#ifdef HAVE_STACK_OF
+static int smime_verify(struct message *m, int n, STACK_OF(X509) *chain,
+ X509_STORE *store);
+#else
static int smime_verify(struct message *m, int n, STACK *chain,
X509_STORE *store);
+#endif
static EVP_CIPHER *smime_cipher(const char *name);
static int ssl_password_cb(char *buf, int size, int rwflag, void *userdata);
static FILE *smime_sign_cert(const char *xname, const char *xname2, int warn);
@@ -203,10 +208,10 @@
return 1;
}
-static SSL_METHOD *
+static const SSL_METHOD *
ssl_select_method(const char *uhp)
{
- SSL_METHOD *method;
+ const SSL_METHOD *method;
char *cp;
cp = ssl_method_string(uhp);
@@ -308,7 +313,11 @@
X509 *cert;
X509_NAME *subj;
char data[256];
+#ifdef HAVE_STACK_OF
+ STACK_OF(GENERAL_NAME) *gens;
+#else
/*GENERAL_NAMES*/STACK *gens;
+#endif
GENERAL_NAME *gen;
int i;
@@ -357,7 +366,8 @@
ssl_init();
ssl_set_vrfy_level(uhp);
- if ((sp->s_ctx = SSL_CTX_new(ssl_select_method(uhp))) == NULL) {
+ if ((sp->s_ctx =
+ SSL_CTX_new((SSL_METHOD *)ssl_select_method(uhp))) == NULL) {
ssl_gen_err(catgets(catd, CATSET, 261, "SSL_CTX_new() failed"));
return STOP;
}
@@ -496,7 +506,11 @@
}
static int
+#ifdef HAVE_STACK_OF
+smime_verify(struct message *m, int n, STACK_OF(X509) *chain, X509_STORE *store)
+#else
smime_verify(struct message *m, int n, STACK *chain, X509_STORE *store)
+#endif
{
struct message *x;
char *cp, *sender, *to, *cc, *cnttype;
@@ -505,7 +519,12 @@
off_t size;
BIO *fb, *pb;
PKCS7 *pkcs7;
+#ifdef HAVE_STACK_OF
+ STACK_OF(X509) *certs;
+ STACK_OF(GENERAL_NAME) *gens;
+#else
STACK *certs, *gens;
+#endif
X509 *cert;
X509_NAME *subj;
char data[LINESIZE];
@@ -614,7 +633,11 @@
{
int *msgvec = vp, *ip;
int ec = 0;
+#ifdef HAVE_STACK_OF
+ STACK_OF(X509) *chain = NULL;
+#else
STACK *chain = NULL;
+#endif
X509_STORE *store;
char *ca_dir, *ca_file;
@@ -687,7 +710,11 @@
X509 *cert;
PKCS7 *pkcs7;
BIO *bb, *yb;
+#ifdef HAVE_STACK_OF
+ STACK_OF(X509) *certs;
+#else
STACK *certs;
+#endif
EVP_CIPHER *cipher;
certfile = expand((char *)certfile);
@@ -950,9 +977,14 @@
off_t size;
BIO *fb, *pb;
PKCS7 *pkcs7;
+#ifdef HAVE_STACK_OF
+ STACK_OF(X509) *certs;
+ STACK_OF(X509) *chain = NULL;
+#else
STACK *certs;
- X509 *cert;
STACK *chain = NULL;
+#endif
+ X509 *cert;
enum okay ok = OKAY;
message_number = n;
--- mailx-12.4/quit.c
+++ nail/quit.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)quit.c 2.28 (gritter) 3/4/06";
+static char sccsid[] = "@(#)quit.c 2.30 (gritter) 11/11/08";
#endif
#endif /* not lint */
@@ -584,4 +584,47 @@
done:
relsesigs();
+}
+
+enum quitflags {
+ QUITFLAG_HOLD = 001,
+ QUITFLAG_KEEPSAVE = 002,
+ QUITFLAG_APPEND = 004,
+ QUITFLAG_EMPTYBOX = 010
+};
+
+static const struct quitnames {
+ enum quitflags flag;
+ const char *name;
+} quitnames[] = {
+ { QUITFLAG_HOLD, "hold" },
+ { QUITFLAG_KEEPSAVE, "keepsave" },
+ { QUITFLAG_APPEND, "append" },
+ { QUITFLAG_EMPTYBOX, "emptybox" },
+ { 0, NULL }
+};
+
+int
+savequitflags(void)
+{
+ enum quitflags qf = 0;
+ int i;
+
+ for (i = 0; quitnames[i].name; i++)
+ if (value(quitnames[i].name))
+ qf |= quitnames[i].flag;
+ return qf;
+}
+
+void
+restorequitflags(int qf)
+{
+ int i;
+
+ for (i = 0; quitnames[i].name; i++)
+ if (qf & quitnames[i].flag) {
+ if (value(quitnames[i].name) == NULL)
+ assign(quitnames[i].name, "");
+ } else if (value(quitnames[i].name))
+ unset_internal(quitnames[i].name);
}
--- mailx-12.4/sendout.c
+++ nail/sendout.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)sendout.c 2.99 (gritter) 7/4/08";
+static char sccsid[] = "@(#)sendout.c 2.100 (gritter) 3/1/09";
#endif
#endif /* not lint */
@@ -1219,8 +1219,9 @@
if (putname(addr, w, action, &gotcha, "From:", fo,
&fromfield))
return 1;
- if ((addr = hp->h_organization) != NULL ||
- (addr = value("ORGANIZATION")) != NULL) {
+ if (((addr = hp->h_organization) != NULL ||
+ (addr = value("ORGANIZATION")) != NULL)
+ && strlen(addr) > 0) {
fwrite("Organization: ", sizeof (char), 14, fo);
if (mime_write(addr, strlen(addr), fo,
action == SEND_TODISP ?
@@ -1269,7 +1270,8 @@
fwrite("Subject: ", sizeof (char), 9, fo);
if (ascncasecmp(hp->h_subject, "re: ", 4) == 0) {
fwrite("Re: ", sizeof (char), 4, fo);
- if (mime_write(hp->h_subject + 4,
+ if (strlen(hp->h_subject + 4) > 0 &&
+ mime_write(hp->h_subject + 4,
strlen(hp->h_subject + 4),
fo, action == SEND_TODISP ?
CONV_NONE:CONV_TOHDR,
--- mailx-12.4/vars.c
+++ nail/vars.c
@@ -38,7 +38,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)vars.c 2.11 (gritter) 3/4/06";
+static char sccsid[] = "@(#)vars.c 2.12 (gritter) 10/1/08";
#endif
#endif /* not lint */
@@ -81,7 +81,7 @@
* Assign a value to a variable.
*/
void
-assign(char *name, char *value)
+assign(const char *name, const char *value)
{
struct var *vp;
int h;
@@ -221,7 +221,7 @@
}
int
-unset_internal(char *name)
+unset_internal(const char *name)
{
struct var *vp, *vp2;
int h;
--- mailx-12.4/version.c
+++ nail/version.c
@@ -1,4 +1,4 @@
-#define V "12.4"
+#define V "12.5"
/*
* Heirloom mailx - a mail user agent derived from Berkeley Mail.
*
@@ -39,7 +39,7 @@
#ifndef lint
#ifdef DOSCCS
-static char sccsid[] = "@(#)version.c 2.386 (gritter) 7/29/08";
+static char sccsid[] = "@(#)version.c 2.404 (gritter) 7/5/10";
#endif
#endif /* not lint */
@@ -48,7 +48,7 @@
* Load this file first to get a "total" Mail version.
*/
/*char *version = "8.1 6/6/93";*/
-const char *version = V " 7/29/08";
+const char *version = V " 7/5/10";
#ifndef lint
#if __GNUC__ >= 3 && __GNUC_MINOR__ >= 4 || __GNUC__ >= 4
#define USED __attribute__ ((used))
@@ -57,7 +57,7 @@
#else
#define USED
#endif
-static const char *versionid USED = "@(#)mailx " V " (gritter) 7/29/08";
+static const char *versionid USED = "@(#)mailx " V " (gritter) 7/5/10";
#endif /* !lint */
/* SLIST */
/*
@@ -65,42 +65,42 @@
base64.c:static char sccsid[] = "@(#)base64.c 2.14 (gritter) 4/21/06";
cache.c:static char sccsid[] = "@(#)cache.c 1.61 (gritter) 3/4/06";
cmd1.c:static char sccsid[] = "@(#)cmd1.c 2.97 (gritter) 6/16/07";
-cmd2.c:static char sccsid[] = "@(#)cmd2.c 2.46 (gritter) 3/4/06";
-cmd3.c:static char sccsid[] = "@(#)cmd3.c 2.86 (gritter) 10/1/07";
+cmd2.c:static char sccsid[] = "@(#)cmd2.c 2.47 (gritter) 5/9/10";
+cmd3.c:static char sccsid[] = "@(#)cmd3.c 2.87 (gritter) 10/1/08";
cmdtab.c:static char sccsid[] = "@(#)cmdtab.c 2.51 (gritter) 3/4/06";
collect.c:static char sccsid[] = "@(#)collect.c 2.54 (gritter) 6/16/07";
def.h: * Sccsid @(#)def.h 2.104 (gritter) 3/4/06
dotlock.c:static char sccsid[] = "@(#)dotlock.c 2.9 (gritter) 3/20/06";
edit.c:static char sccsid[] = "@(#)edit.c 2.24 (gritter) 3/4/06";
-extern.h: * Sccsid @(#)extern.h 2.161 (gritter) 10/1/07
-fio.c:static char sccsid[] = "@(#)fio.c 2.73 (gritter) 1/7/08";
+extern.h: * Sccsid @(#)extern.h 2.162 (gritter) 10/1/08
+fio.c:static char sccsid[] = "@(#)fio.c 2.76 (gritter) 9/16/09";
getname.c:static char sccsid[] = "@(#)getname.c 2.5 (gritter) 3/4/06";
getopt.c: Sccsid @(#)getopt.c 1.7 (gritter) 12/16/07
glob.h: * Sccsid @(#)glob.h 2.27 (gritter) 6/16/07
head.c:static char sccsid[] = "@(#)head.c 2.17 (gritter) 3/4/06";
hmac.c: Sccsid @(#)hmac.c 1.8 (gritter) 3/4/06
-imap.c:static char sccsid[] = "@(#)imap.c 1.219 (gritter) 1/6/08";
+imap.c:static char sccsid[] = "@(#)imap.c 1.222 (gritter) 3/13/09";
imap_gssapi.c:static char sccsid[] = "@(#)imap_gssapi.c 1.10 (gritter) 3/4/06";
imap_search.c:static char sccsid[] = "@(#)imap_search.c 1.29 (gritter) 3/4/06";
-junk.c:static char sccsid[] = "@(#)junk.c 1.73 (gritter) 3/4/06";
+junk.c:static char sccsid[] = "@(#)junk.c 1.75 (gritter) 9/14/08";
lex.c:static char sccsid[] = "@(#)lex.c 2.86 (gritter) 12/25/06";
-list.c:static char sccsid[] = "@(#)list.c 2.61 (gritter) 01/07/07";
+list.c:static char sccsid[] = "@(#)list.c 2.62 (gritter) 12/11/08";
lzw.c: * Sccsid @(#)lzw.c 1.11 (gritter) 3/4/06
macro.c:static char sccsid[] = "@(#)macro.c 1.13 (gritter) 3/4/06";
maildir.c:static char sccsid[] = "@(#)maildir.c 1.20 (gritter) 12/28/06";
main.c:static char sccsid[] = "@(#)main.c 2.51 (gritter) 10/1/07";
md5.c: Sccsid @(#)md5.c 1.8 (gritter) 3/4/06
md5.h: Sccsid @(#)md5.h 1.8 (gritter) 3/4/06
-mime.c:static char sccsid[] = "@(#)mime.c 2.69 (gritter) 6/29/08";
+mime.c:static char sccsid[] = "@(#)mime.c 2.71 (gritter) 7/5/10";
names.c:static char sccsid[] = "@(#)names.c 2.22 (gritter) 3/4/06";
nss.c:static char sccsid[] = "@(#)nss.c 1.48 (gritter) 8/4/07";
-openssl.c:static char sccsid[] = "@(#)openssl.c 1.25 (gritter) 8/4/07";
+openssl.c:static char sccsid[] = "@(#)openssl.c 1.26 (gritter) 5/26/09";
pop3.c:static char sccsid[] = "@(#)pop3.c 2.43 (gritter) 3/4/06";
popen.c:static char sccsid[] = "@(#)popen.c 2.20 (gritter) 3/4/06";
-quit.c:static char sccsid[] = "@(#)quit.c 2.28 (gritter) 3/4/06";
+quit.c:static char sccsid[] = "@(#)quit.c 2.30 (gritter) 11/11/08";
rcv.h: * Sccsid @(#)rcv.h 2.7 (gritter) 3/4/06
send.c:static char sccsid[] = "@(#)send.c 2.86 (gritter) 2/4/08";
-sendout.c:static char sccsid[] = "@(#)sendout.c 2.99 (gritter) 7/4/08";
+sendout.c:static char sccsid[] = "@(#)sendout.c 2.100 (gritter) 3/1/09";
smtp.c:static char sccsid[] = "@(#)smtp.c 2.43 (gritter) 8/4/07";
ssl.c:static char sccsid[] = "@(#)ssl.c 1.39 (gritter) 6/12/06";
strings.c:static char sccsid[] = "@(#)strings.c 2.6 (gritter) 3/4/06";
@@ -108,5 +108,5 @@
thread.c:static char sccsid[] = "@(#)thread.c 1.57 (gritter) 3/4/06";
tty.c:static char sccsid[] = "@(#)tty.c 2.29 (gritter) 3/9/07";
v7.local.c:static char sccsid[] = "@(#)v7.local.c 2.10 (gritter) 3/4/06";
-vars.c:static char sccsid[] = "@(#)vars.c 2.11 (gritter) 3/4/06";
+vars.c:static char sccsid[] = "@(#)vars.c 2.12 (gritter) 10/1/08";
*/
|