summaryrefslogtreecommitdiffstats
path: root/src/vmime-1-fastforward.patch
blob: d6a3ef1589e6d2fcea2037f49e05410df151f4f5 (plain)
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
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
This file is part of mingw-cross-env.
See doc/index.html for further information.

Fast-forward to latest vmime 0.9.1 from svn
http://sourceforge.net/projects/vmime/develop

Produced with this script:
#--------------------------------------------------------------------#
#!/bin/bash

(
  echo "This file is part of mingw-cross-env."
  echo "See doc/index.html for further information."
  echo
  echo "Fast-forward to latest vmime 0.9.1 from svn"
  echo "http://sourceforge.net/projects/vmime/develop"
  echo
  echo "Produced with this script:"
  echo "#--------------------------------------------------------------------#"
  cat "$0"
  echo "#--------------------------------------------------------------------#"
) > src/vmime-1-fastforward.patch

# setup git svn clone
#cd ~/projects/vmime/git
#git svn clone -s https://vmime.svn.sourceforge.net/svnroot/vmime
#git reset --hard
#git tag -f v0.9.1-start `git svn log --show-commit | grep r482 | cut -d "|" -f 2`
# get updates
#git svn fetch
#git svn rebase

GITDIR=~/projects/vmime/git/vmime/vmime
PKGDIR=libvmime-0.9.0

rm -rf $PKGDIR
tar xf pkg/$PKGDIR.tar.bz2

(
  cd $GITDIR
  git reset --hard
  git checkout master
)

# Create patch to reset the tarball tree to the 
# starting state in svn. This is actually one commit
# before 0.9.1 started. This compensates for left out 
# and touched files. Only for files known to need it.
lst="bootstrap \
     doc/book/intro.tex \
     doc/book/net.tex \
     examples/viewer/viewer.cpp \
     m4/acx_pthread.m4 \
     m4/ost_posix.m4 \
     m4/ost_prog.m4 \
     m4/ost_pthread.m4 \
     m4/ost_systime.m4"

for a in $lst; do
   if [ -f $PKGDIR/$a ]; then
       cp $PKGDIR/$a $GITDIR/$a
   else
       rm $GITDIR/$a
   fi
done

# write reset patch
(
  cd $GITDIR
  echo
  git diff --relative -R v0.9.1-start^ -- $lst
) >> src/vmime-1-fastforward.patch

(
  cd $GITDIR
  git reset --hard
)

# write fast forward commits
(
  cd $GITDIR
  echo
  git log --relative --reverse -p ^v0.9.1-start^ HEAD
) >> src/vmime-1-fastforward.patch

# check the results
patch -d $PKGDIR -p1 -s < src/vmime-1-fastforward.patch
diff -rq $GITDIR $PKGDIR
#--------------------------------------------------------------------#

diff --git b/bootstrap a/bootstrap
index cef3171..457eaa8 100755
--- b/bootstrap
+++ a/bootstrap
@@ -40,6 +40,7 @@ if test $DIE = 0 ; then
 		|| (echo "[NO]" ; cat bootstrap.tmpout ; rm -f bootstrap.tmpout ; not_a_command >& /dev/null) || DIE=1
 fi
 
+# Bug with automake 1.10?
 touch autotools/config.rpath
 
 if test $DIE = 0 ; then
diff --git b/doc/book/intro.tex a/doc/book/intro.tex
new file mode 100644
index 0000000..93a3675
--- /dev/null
+++ a/doc/book/intro.tex
@@ -0,0 +1,90 @@
+\chapter{Introduction}
+
+% ============================================================================
+\section{Overview}
+
+VMime is a powerful C++ class library for working with MIME messages and
+Internet messaging services like IMAP, POP or SMTP.
+
+With VMime you can parse, generate and modify messages, and also connect to
+store and transport services to receive or send messages over the Internet.
+The library offers all the features to build a complete mail client.
+
+The main objectives of this library are:
+
+\begin{itemize}
+\item fully RFC-compliant implementation;
+\item object-oriented and modular design;
+\item very easy-to-use (intuitive design);
+\item well documented code;
+\item very high reliability;
+\item maximum portability.
+\end{itemize}
+
+
+% ============================================================================
+\section{Features}
+
+\noindent MIME features:
+
+\begin{itemize}
+\item Full support for RFC-2822 and multipart messages (RFC-1521)
+\item Aggregate documents (MHTML) and embedded objects (RFC-2557)
+\item Message Disposition Notification (RFC-3798)
+\item 8-bit MIME (RFC-2047)
+\item Encoded word extensions (RFC-2231)
+\item Attachments
+\end{itemize}
+
+\noindent Network features:
+
+\begin{itemize}
+\item Support for IMAP, POP3 and maildir stores
+\item Support for SMTP and sendmail transport methods
+\item Extraction of whole message or specific parts
+\item TLS/SSL security layer
+\item SASL authentication
+\end{itemize}
+
+
+% ============================================================================
+\section{Copyright and license}
+
+VMime library is Free Software and is licensed under the terms of the GNU
+General Public License\footnote{See Appendix \ref{appendix_license} and
+\url{http://www.gnu.org/copyleft/gpl.html}} (GPL):
+
+\begin{verbatim}
+   Copyright (C) 2002-2008 Vincent Richard
+
+   VMime library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   VMime is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+   GNU General Public License for more details.
+
+   Linking this library statically or dynamically with other
+   modules is making a combined work based on this library.
+   Thus, the terms and conditions of the GNU General Public
+   License cover the whole combination.
+\end{verbatim}
+
+\newpage
+\noindent This document is released under the terms of the
+GNU Free Documentation
+License\footnote{See \url{http://www.gnu.org/copyleft/fdl.html}} (FDL):
+
+\begin{verbatim}
+   Copyright (C) 2004-2007 Vincent Richard
+
+   Permission is granted to copy, distribute and/or modify
+   this document under the terms of the GNU Free Documentation
+   License, Version 1.2 or any later version published by the
+   Free Software Foundation; with no Invariant Sections, no
+   Front-Cover Texts, and no Back-Cover Texts.
+\end{verbatim}
+
diff --git b/doc/book/net.tex a/doc/book/net.tex
new file mode 100644
index 0000000..08b7df5
--- /dev/null
+++ a/doc/book/net.tex
@@ -0,0 +1,976 @@
+\chapter{Working with Messaging Services}
+
+% ============================================================================
+\section{Introduction}
+
+In addition to parsing and building MIME messages, VMime also offers a lot of
+features to work with messaging services. This includes connecting to remote
+messaging stores (like IMAP or POP3), local stores (maildir) and transport
+services (send messages over SMTP or local sendmail), through an unified
+interface (see Figure \ref{uml_messaging_module}). That means that you can
+use independently IMAP of POP3 without having to change any line of code.
+
+Source code of {\vexample Example6} covers all features presented in this
+chapter, so it is important you take some time to read it.
+
+\begin{figure}
+	\center\includegraphics[width=0.9\textwidth]
+		{images/messaging-services.png}
+	\caption{Overall structure of the messaging module}
+	\label{uml_messaging_module}
+\end{figure}
+
+The interface is composed of five classes:
+
+\begin{itemize}
+\item {\vcode vmime::net::service}: this is the base interface for a
+messaging service. It can be either a store service or a transport
+service.
+
+\item {\vcode vmime::net::serviceFactory}: create instances of a service.
+This is used internally by the session object (see below).
+
+\item {\vcode vmime::net::store}: interface for a store service. A store
+service offers access to a set of folders containing messages. This is
+used for IMAP, POP3 and maildir.
+
+\item {\vcode vmime::net::transport}: interface for a transport service.
+A transport service is capable of sending messages. This is used for
+SMTP and sendmail.
+
+\item {\vcode vmime::net::session}: a session oject is used to store the
+parameters used by a service (eg. connection parameters). Each service
+instance is associated with only one session. The session object is capable
+of creating instances of services.
+\end{itemize}
+
+The following classes are specific to store services:
+
+\begin{itemize}
+\item {\vcode vmime::net::folder}: a folder can either contain other folders
+or messages, or both.
+
+\item {\vcode vmime::net::message}: this is the interface for dealing with
+messages. For a given message, you can have access to its flags, its MIME
+structure and you can also extract the whole message data or given parts (if
+supported by the underlying protocol).
+\end{itemize}
+
+
+% ============================================================================
+\section{Working with sessions}
+
+\subsection{Setting properties} % --------------------------------------------
+
+Sessions are used to store configuration parameters for services. They
+contains a set of typed properties that can modify the behaviour of the
+services. Before using a messaging service, you must create and
+initialize a session object:
+
+\begin{lstlisting}
+vmime::ref <net::session> theSession = vmime::create <net::session>();
+\end{lstlisting}
+
+Session properties include:
+
+\begin{itemize}
+\item connection parameters: host and port to connect to;
+\item authentication parameters: user credentials required to use the
+service (if any);
+\item protocol-specific parameters: enable or disable extensions (eg. APOP
+support in POP3).
+\end{itemize}
+
+Properties are stored using a dotted notation, to specify the service type,
+the protocol name, the category and the name of the property:
+
+\begin{verbatim}
+   {service_type}.{protocol}.category.name
+\end{verbatim}
+
+An example of property is \emph{store.pop3.options.apop} (used to enable or
+disable the use of APOP authentication). The \emph{store.pop3} part is called
+the \emph{prefix}. This allow specifying different values for the same
+property depending on the protocol used.
+
+The session properties are stored in a {\vcode vmime::propertySet} object.
+To set the value of a property, you can use either:
+
+\begin{lstlisting}
+theSession->getProperties().setProperty("property-name", value);
+\end{lstlisting}
+
+or:
+
+\begin{lstlisting}
+theSession->getProperties()["property-name"] = value;
+\end{lstlisting}
+
+
+\subsection{Available properties} % ------------------------------------------
+
+Following is a list of available properties and the protocols they apply to,
+as the time of writing this documentation\footnote{You can get an up-to-date
+list of the properties by running \vexample{Example7}}. For better clarity,
+the prefixes do not appear in this table.
+
+\begin{table}[!ht]
+\noindent\begin{tabularx}{1.0\textwidth}{|l|c|X|c|c|c|c|c|c|c|c|}
+\hline
+	{\bf Property name} &
+	{\bf Type} &
+	{\bf Description} &
+	\verti{\bf POP3} &
+	\verti{\bf POP3S} &
+	\verti{\bf IMAP} &
+	\verti{\bf IMAPS} &
+	\verti{\bf SMTP} &
+	\verti{\bf SMTPS} &
+	\verti{\bf maildir} &
+	\verti{\bf sendmail} \\
+\hline
+\hline
+options.sasl & bool & Set to {\vcode true} to use SASL authentication, if
+available. & \vdot & \vdot & \vdot & \vdot & \vdot & \vdot & & \\
+\hline
+options.sasl.fallback & bool & Fail if SASL authentication failed (do not
+try other authentication mechanisms). & \vdot & \vdot & \vdot & \vdot &
+\vdot & \vdot & & \\
+\hline
+auth.username\footnote{You should use authenticators
+instead.\label{fn_auth_username}} & string & Set the username of the account
+to connect to. & \vdot & \vdot & \vdot & \vdot & \vdot & \vdot & & \\
+\hline
+auth.password\footref{fn_auth_username} & string & Set the password of the
+account. & \vdot & \vdot & \vdot & \vdot & \vdot & \vdot & & \\
+\hline
+connection.tls & bool & Set to {\vcode true} to start a secured connection
+using STARTTLS extension, if available. & \vdot & & \vdot & & \vdot & & & \\
+\hline
+connection.tls.required & bool & Fail if a secured connection cannot be
+started. & \vdot & & \vdot & & \vdot & & & \\
+\hline
+server.address & string & Server host name or IP address. &\vdot & \vdot &
+\vdot & \vdot & \vdot & \vdot & & \\
+\hline
+server.port & int & Server port. & \vdot & \vdot & \vdot & \vdot &
+\vdot & \vdot & & \\
+\hline
+server.rootpath & string & Root directory for mail repository (eg.
+\emph{/home/vincent/Mail}). & & & & & & & \vdot & \\
+\hline
+\end{tabularx}
+\caption{Properties common to all protocols}
+\end{table}
+
+\newpage
+These are the protocol-specific options:
+
+\begin{table}[!ht]
+\noindent\begin{tabularx}{1.0\textwidth}{|l|c|X|}
+\hline
+	{\bf Property name} &
+	{\bf Type} &
+	{\bf Description} \\
+% POP3/POP3S
+\hline
+\multicolumn{3}{|c|}{POP3, POP3S} \\
+\hline
+store.pop3.options.apop & bool & Enable or disable authentication with
+APOP (if SASL is enabled, this occurs after all SASL mechanisms have been
+tried). \\
+\hline
+store.pop3.options.apop.fallback & bool & If set to {\vcode true} and
+APOP fails, the authentication process fails (ie. unsecure plain text
+authentication is not used). \\
+\hline
+% SMTP
+\multicolumn{3}{|c|}{SMTP, SMTPS} \\
+\hline
+transport.smtp.options.need-authentication & bool & Set to \emph{true} if
+the server requires to authenticate before sending messages. \\
+\hline
+% sendmail
+\multicolumn{3}{|c|}{sendmail} \\
+\hline
+transport.sendmail.binpath & string & The path to the \emph{sendmail}
+executable on your system. The default is the one found by the configuration
+script when VMime was built. \\
+\hline
+\end{tabularx}
+\caption{Protocol-specific options}
+\end{table}
+
+
+\subsection{Instanciating services} % ----------------------------------------
+
+You can create a service either by specifying its protocol name, or by
+specifying the URL of the service. Creation by name is deprecated so
+this chapter only presents the latter option.
+
+The URL scheme for connecting to services is:
+
+\begin{verbatim}
+   protocol://[username[:password]@]host[:port]/[root-path]
+\end{verbatim}
+
+\vnote{For local services (ie. \emph{sendmail} and \emph{maildir}), the host
+part is not used, but it must not be empty (you can use "localhost").}
+
+The following table shows an example URL for each service:
+
+\noindent\begin{tabularx}{1.0\textwidth}{|c|X|}
+\hline
+	{\bf Service} &
+	{\bf Connection URL} \\
+\hline
+imap, imaps & {\tt imap://imap.example.com},
+{\tt imaps://vincent:pass@example.com} \\
+\hline
+pop3, pop3s & {\tt pop3://pop3.example.com} \\
+\hline
+smtp, smtps & {\tt smtp://smtp.example.com} \\
+\hline
+maildir & {\tt maildir://localhost/home/vincent/Mail} (host not used) \\
+\hline
+sendmail & {\tt sendmail://localhost} (host not used, always localhost) \\
+\hline
+\end{tabularx}
+
+\newpage
+
+When you have the connection URL, instanciating the service is quite simple.
+Depending on the type of service, you will use either {\vcode getStore()} or
+{\vcode getTransport()}. For example, for store services, use:
+
+\begin{lstlisting}
+vmime::utility:url url("imap://user:pass@imap.example.com");
+vmime::ref <vmime::net::store> st = sess->getStore(url);
+\end{lstlisting}
+
+and for transport services:
+
+\begin{lstlisting}
+vmime::utility:url url("smtp://smtp.example.com");
+vmime::ref <vmime::net::transport> tr = sess->getTransport(url);
+\end{lstlisting}
+
+
+% ============================================================================
+\section{User credentials and authenticators}
+
+Some services need some user credentials (eg. username and password) to open
+a session. In VMime, user credentials can be specified in the session
+properties or by using a custom authenticator (callback).
+
+\begin{lstlisting}[caption={Setting user credentials using session
+properties}]
+vmime::ref <vmime::net::session> sess;  // Suppose we have a session
+
+sess->getProperties()["store.imap.auth.username"] = "vincent";
+sess->getProperties()["store.imap.auth.password"] = "my-password";
+\end{lstlisting}
+
+Although not recommended, you can also specify username and password
+directly in the connection URL,
+ie: \emph{imap://username:password@imap.example.com/}. This works only for
+services requiring an username and a password as user credentials, and no
+other information.
+
+Sometimes, it may not be very convenient to set username/password in the
+session properties, or not possible (eg. extended SASL mechanisms) . That's
+why VMime offers an alternate way of getting user credentials: the
+{\vcode authenticator} object. Basically, an authenticator is an object that
+can return user credentials on-demand (like a callback).
+
+Currently, there are two types of authenticator in VMime: a basic
+authenticator (class {\vcode vmime::security::authenticator}) and, if SASL
+support is enabled, a SASL authenticator
+(class {\vcode vmime::security::sasl::SASLAuthenticator}). Usually, you
+should use the default implementations, or at least make your own
+implementation inherit from them.
+
+The following example shows how to use a custom authenticator to request
+the user to enter her/his credentials:
+
+\begin{lstlisting}[caption={A simple interactive authenticator}]
+class myAuthenticator : public vmime::security::defaultAuthenticator
+{
+   const string getUsername() const
+   {
+      std::cout << "Enter your username: " << std::endl;
+
+      vmime::string res;
+      std::getline(std::cin, res);
+
+      return res;
+   }
+
+   const string getPassword() const
+   {
+      std::cout << "Enter your password: " << std::endl;
+
+      vmime::string res;
+      std::getline(std::cin, res);
+
+      return res;
+   }
+};
+\end{lstlisting}
+
+This is how to use it:
+
+\begin{lstlisting}
+// First, create a session
+vmime::ref <vmime::net::session> sess =
+   vmime::create <vmime::net::session>();
+
+// Next, initialize a service which will use our authenticator
+vmime::ref <vmime::net::store> st =
+   sess->getStore(vmime::utility::url("imap://imap.example.com"),
+      /* use our authenticator */ vmime::create <myAuthenticator>());
+\end{lstlisting}
+
+\vnote{An authenticator object should be used with one and only one service
+at a time. This is required because the authentication process may need to
+retrieve the service name (SASL).}
+
+Of course, this example is quite simplified. For example, if several
+authentication mechanisms are tried, the user may be requested to enter the
+same information multiple times. See  {\vexample Example6} for a more complex
+implementation of an authenticator, with caching support.
+
+If you want to use SASL (ie. if \emph{options.sasl} is set to \emph{true}),
+your authenticator must inherit from
+{\vcode vmime::security::sasl::SASLAuthenticator} or
+{\vcode vmime::security::sasl::defaultSASLAuthenticator}, even if you do not
+use the SASL-specific methods {\vcode getAcceptableMechanisms()} and
+{\vcode setSASLMechanism()}. Have a look at {\vexample Example6} to see an
+implementation of an SASL authenticator.
+
+\begin{lstlisting}[caption={A simple SASL authenticator}]
+class mySASLAuthenticator : public vmime::security::sasl::defaultSASLAuthenticator
+{
+   typedef vmime::security::sasl::SASLMechanism mechanism;  // save us typing
+
+   const std::vector <vmime::ref <mechanism > getAcceptableMechanisms
+         (const std::vector <vmime::ref <mechanism> >& available,
+          vmime::ref <mechanism> suggested) const
+   {
+      // Here, you can sort the SASL mechanisms in the order they will be
+      // tried. If no SASL mechanism is acceptable (ie. for example, not
+      // enough secure), you can return an empty list.
+      //
+      // If you do not want to bother with this, you can simply return
+      // the default list, which is ordered by security strength.
+      return defaultSASLAuthenticator::
+         getAcceptableMechanisms(available, suggested);
+   }
+
+   void setSASLMechanism(vmime::ref <mechanism> mech)
+   {
+      // This is called when the authentication process is going to
+      // try the specified mechanism.
+      //
+      // The mechanism name is in mech->getName()
+
+      defaultSASLAuthenticator::setSASLMechanism(mech);
+   }
+
+   // ...implement getUsername() and getPassword()...
+};
+\end{lstlisting}
+
+
+% ============================================================================
+\section{Using transport service}
+
+You have two possibilities for giving message data to the service when you
+want to send a message:
+
+\begin{itemize}
+\item either you have a reference to a message (type {\vcode vmime::message})
+and you can simply call {\vcode send(msg)};
+\item or you only have raw message data (as a string, for example), and you
+have to call the second overload of {\vcode send()}, which takes additional
+parameters (corresponding to message envelope);
+\end{itemize}
+
+The following example illustrates the use of a transport service to send a
+message using the second method:
+
+\begin{lstlisting}[caption={Using a transport service}]
+const vmime::string msgData =
+   "From: me@example.org \r\n"
+   "To: you@example.org \r\n"
+   "Date: Sun, Oct 30 2005 17:06:42 +0200 \r\n"
+   "Subject: Test \r\n"
+   "\r\n"
+   "Message body";
+
+// Create a new session
+vmime::utility::url url("smtp://example.com");
+
+vmime::ref <vmime::net::session> sess =
+   vmime::create <vmime::net::session>();
+
+// Create an instance of the transport service
+vmime::ref <vmime::net::transport> tr = sess->getTransport(url);
+
+// Connect it
+tr->connect();
+
+// Send the message
+vmime::utility::inputStreamStringAdapter is(msgData);
+
+vmime::mailbox from("me@example.org");
+vmime::mailboxList to;
+to.appendMailbox(vmime::create <vmime::mailbox>("you@example.org"));
+
+tr->send(
+   /* expeditor */    from,
+   /* recipient(s) */ to,
+   /* data */         is,
+   /* total length */ msgData.length());
+
+// We have finished using the service
+tr->disconnect();
+\end{lstlisting}
+
+\vnote{Exceptions can be thrown at any time when using a service. For better
+clarity, exceptions are not caught here, but be sure to catch them in your own
+application to provide error feedback to the user.}
+
+If you use SMTP, you can enable authentication by setting some properties
+on the session object ({\vcode service::setProperty()} is a shortcut for
+setting properties on the session with the correct prefix):
+
+\begin{lstlisting}
+tr->setProperty("options.need-authentication", true);
+tr->setProperty("auth.username", "user");
+tr->setProperty("auth.password", "password");
+\end{lstlisting}
+
+
+% ============================================================================
+\section{Using store service}
+
+\subsection{Connecting to a store} % -----------------------------------------
+
+The first basic step for using a store service is to connect to it. The
+following example shows how to initialize a session and instanciate the
+store service:
+
+\begin{lstlisting}[caption={Connecting to a store service}]
+// Create a new session
+vmime::utility::url url("imap://vincent:password@imap:example.org");
+
+vmime::ref <vmime::net::session> sess =
+   vmime::create <vmime::net::session>();
+
+// Create an instance of the transport service
+vmime::ref <vmime::net::store> store = sess->getStore(url);
+
+// Connect it
+store->connect();
+\end{lstlisting}
+
+\vnote{{\vexample Example6} contains a more complete example for connecting
+to a store service, with support for a custom authenticator.}
+
+\subsection{Opening a folder} % ----------------------------------------------
+
+You can open a folder using two different access modes: either in
+\emph{read-only} mode (where you can only read message flags and contents), or
+in \emph{read-write} mode (where you can read messages, but also delete them
+or add new ones). When you have a reference to a folder, simply call the
+{\vcode open()} method with the desired access mode:
+
+\begin{lstlisting}
+folder->open(vmime::net::folder::MODE_READ_WRITE);
+\end{lstlisting}
+
+\vnote{Not all stores support the \emph{read-write} mode. By default, if the
+\emph{read-write} mode is not available, the folder silently fall backs on
+the \emph{read-only} mode, unless the \emph{failIfModeIsNotAvailable} argument
+to {\vcode open()} is set to true.}
+
+Call {\vcode getDefaultFolder()} on the store to obtain a reference to the
+default folder, which is usually the INBOX folder (where messages arrive when
+they are received).
+
+You can also open a specific folder by specifying its path. The following
+example will open a folder named \emph{bar}, which is a child of \emph{foo}
+in the root folder:
+
+\begin{lstlisting}[caption={Opening a folder from its path}]
+vmime::net::folder::path path;
+path /= vmime::net::folder::path::component("foo");
+path /= vmime::net::folder::path::component("bar");
+
+vmime::ref <vmime::net::folder> fld = store->getFolder(path);
+fld->open(vmime::net::folder::MODE_READ_WRITE);
+\end{lstlisting}
+
+\vnote{You can specify a path as a string as there is no way to get the
+separator used to delimitate path components. Always use {\vcode operator/=}
+or {\vcode appendComponent}.}
+
+\vnote{Path components are of type {\vcode vmime::word}, which means that
+VMime supports folder names with extended characters, not only 7-bit
+US-ASCII. However, be careful that this may not be supported by the
+underlying store protocol (IMAP supports it, because it uses internally a
+modified UTF-7 encoding).}
+
+\subsection{Fetching messages} % ---------------------------------------------
+
+You can fetch some information about a message without having to download the
+whole message. Moreover, folders support fetching for multiple messages in
+a single request, for better performance. The following items are currently
+available for fetching:
+
+\begin{itemize}
+\item {\bf envelope}: sender, recipients, date and subject;
+\item {\bf structure}: MIME structure of the message;
+\item {\bf content-info}: content-type of the root part;
+\item {\bf flags}: message flags;
+\item {\bf size}: message size;
+\item {\bf header}: retrieve all the header fields of a message;
+\item {\bf uid}: unique identifier of a message;
+\item {\bf importance}: fetch header fields suitable for use with
+{\vcode misc::importanceHelper}.
+\end{itemize}
+
+\vnote{Not all services support all fetchable items. Call
+{\vcode getFetchCapabilities()} on a folder to know which information can be
+fetched by a service.}
+
+The following code shows how to list all the messages in a folder, and
+retrieve basic information to show them to the user:
+
+\begin{lstlisting}[caption={Fetching information about multiple messages}]
+std::vector <ref <vmime::net::message> > allMessages = folder->getMessages();
+
+folder->fetchMessages(allMessages,
+   vmime::net::folder::FETCH_FLAGS |
+   vmime::net::folder::FETCH_ENVELOPE);
+
+for (unsigned int i = 0 ; i < allMessages.size() ; ++i)
+{
+   vmime::ref <vmime::net::message> msg = allMessages[i];
+
+   const int flags = msg->getFlags();
+
+   std::cout << "Message " << i << ":" << std::endl;
+
+   if (flags & vmime::net::message::FLAG_SEEN)
+      std::cout << " - is read" << std::endl;
+   if (flags & vmime::net::message::FLAG_DELETED)
+      std::cout << " - is deleted" << std::endl;
+
+   vmime::ref <const vmime::header> hdr = msg->getHeader();
+
+   std::cout << " - sent on " << hdr->Date()->generate() << std::endl;
+   std::cout << " - sent by " << hdr->From()->generate() << std::endl;
+}
+\end{lstlisting}
+
+\subsection{Extracting messages and parts}
+
+To extract the whole contents of a message (including headers), use the
+{\vcode extract()} method on a {\vcode vmime::net::message} object. The
+following example extracts the first message in the default folder:
+
+\begin{lstlisting}[caption={Extracting messages}]
+// Get a reference to the folder and to its first message
+vmime::ref <vmime::net::folder> folder = store->getDefaultFolder();
+vmime::ref <vmime::net::message> msg = folder->getMessage(1);
+
+// Write the message contents to the standard output
+vmime::utility::outputStreamAdapter out(std::cout);
+msg->extract(out);
+\end{lstlisting}
+
+Some protocols (like IMAP) also support the extraction of specific MIME parts
+of a message without downloading the whole message. This can save bandwidth
+and time. The method {\vcode extractPart()} is used in this case:
+
+\begin{lstlisting}[caption={Extracting a specific MIME part of a message}]
+// Fetching structure is required before extracting a part
+folder->fetchMessage(msg, vmime::net::folder::FETCH_STRUCTURE);
+
+// Now, we can extract the part
+msg->extractPart(msg->getStructure()->getPartAt(0)->getPartAt(1));
+\end{lstlisting}
+
+Suppose we have a message with the following structure:
+
+\begin{verbatim}
+   multipart/mixed
+      text/html
+      image/jpeg [*]
+\end{verbatim}
+
+The previous example will extract the header and body of the \emph{image/jpeg}
+part.
+
+\subsection{Events} % --------------------------------------------------------
+
+As a result of executing some operation (or from time to time, even if no
+operation has been performed), a store service can send events to notify you
+that something has changed (eg. the number of messages in a folder). These
+events may allow you to update the user interface associated to a message
+store.
+
+Currently, there are three types of event:
+
+\begin{itemize}
+\item {\bf message change}: sent when the number of messages in a folder
+has changed (ie. some messages have been added or removed);
+\item {\bf message count change}: sent when one or more message(s) have
+changed (eg. flags or deleted status);
+\item {\bf folder change}: sent when a folder has been created, renamed or
+deleted.
+\end{itemize}
+
+You can register a listener for each event type by using the corresponding
+methods on a {\vcode folder} object: {\vcode addMessageChangedListener()},
+{\vcode addMessageCountListener()} or {\vcode addFolderListener()}. For more
+information, please read the class documentation for
+{\vcode vmime::net::events} namespace.
+
+
+% ============================================================================
+\section{Handling time-outs}
+
+Unexpected errors can occur while messaging services are performing
+operations and waiting a response from the server (eg. server stops
+responding, network link falls down). As all operations as synchronous,
+they can be ``blocked'' a long time before returning (in fact, they loop
+until they either receive a response from the server, or the underlying
+socket system returns an error).
+
+VMime provides a mechanism to control the duration of operations. This
+mechanism allows the program to cancel an operation that is currently
+running.
+
+An interface called {\vcode timeoutHandler} is provided:
+
+\begin{lstlisting}
+class timeoutHandler : public object
+{
+   /** Called to test if the time limit has been reached.
+     *
+     * @return true if the time-out delay is elapsed
+     */
+   virtual const bool isTimeOut() = 0;
+
+   /** Called to reset the time-out counter.
+     */
+   virtual void resetTimeOut() = 0;
+
+   /** Called when the time limit has been reached (when
+     * isTimeOut() returned true).
+     *
+     * @return true to continue (and reset the time-out)
+     * or false to cancel the current operation
+     */
+   virtual const bool handleTimeOut() = 0;
+};
+\end{lstlisting}
+
+While the operation runs, the service calls {\vcode isTimeout()} at variable
+intervals. If the function returns {\vcode true}, then
+{\vcode handleTimeout()} is called. If it also returns {\vcode true}, the
+operation is cancelled and an {\vcode operation\_timed\_out} exception is
+thrown. The function {\vcode resetTimeout()} is called each time data has
+been received from the server to reset time-out delay.
+
+The following example shows how to implement a simple time-out handler:
+
+\begin{lstlisting}[caption={Implementing a simple time-out handler}]
+class myTimeoutHandler : public vmime::net::timeoutHandler
+{
+public:
+
+   const bool isTimeOut()
+   {
+      return (getTime() >= m_last + 30);  // 30 seconds time-out
+   }
+
+   void resetTimeOut()
+   {
+      m_last = getTime();
+   }
+
+   const bool handleTimeOut()
+   {
+      std::cout << "Operation timed out." << std::endl;
+                << "Press [Y] to continue, or [N] to "
+                << "cancel the operation." << std::endl;
+
+      std::string response;
+      std::cin >> response;
+
+      return (response == "y" || response == "Y");
+   }
+
+private:
+
+   const unsigned int getTime() const
+   {
+      return vmime::platform::getHandler()->getUnixTime();
+   }
+
+   unsigned int m_last;
+};
+\end{lstlisting}
+
+To make the service use your time-out handler, you need to write a factory
+class, to allow the service to create instances of the handler class. This
+is required because the service can use several connections to the server
+simultaneously, and each connection needs its own time-out handler.
+
+\begin{lstlisting}
+class myTimeoutHandlerFactory : public vmime::net::timeoutHandlerFactory
+{
+public:
+
+   ref <timeoutHandler> create()
+   {
+      return vmime::create <myTimeoutHandler>();
+   }
+};
+\end{lstlisting}
+
+Then, call the {\vcode setTimeoutHandlerFactory()} method on the service object
+to set the time-out handler factory to use during the session:
+
+\begin{lstlisting}
+theService->setTimeoutHandlerFactory(vmime::create <myTimeoutHandlerFactory>());
+\end{lstlisting}
+
+
+% ============================================================================
+\newpage
+\section{Secured connection using TLS/SSL}
+
+\subsection{Introduction} % --------------------------------------------------
+
+If you have enabled TLS support in VMime, you can configure messaging services
+so that they use a secured connection.
+
+Quoting from RFC-2246 - the TLS 1.0 protocol specification: \emph{`` The TLS
+protocol provides communications privacy over the Internet. The protocol
+allows client/server applications to communicate in a way that is designed
+to prevent eavesdropping, tampering, or message forgery.''}
+
+TLS has the following advantages:
+
+\begin{itemize}
+\item authentication: server identity can be verified;
+\item privacy: transmission of data between client and server cannot be read
+by someone in the middle of the connection;
+\item integrity: original data which is transferred between a client and a
+server can not be modified by an attacker without being detected.
+\end{itemize}
+
+\vnote{What is the difference between SSL and TLS? SSL is a protocol designed
+by Netscape. TLS is a standard protocol, and is partly based on version 3 of
+the SSL protocol. The two protocols are not interoperable, but TLS does
+support a mechanism to back down to SSL 3.}
+
+VMime offers two possibilities for using a secured connection:
+
+\begin{itemize}
+\item you can connect to a server listening on a special port (eg. IMAPS
+instead of IMAP): this is the classical use of SSL, but is now deprecated;
+\item connect to a server listening on the default port, and then begin a
+secured connection: this is STARTTLS.
+\end{itemize}
+
+
+\subsection{Setting up a secured connection} % -------------------------------
+
+\subsubsection{Connecting to a ``secured'' port} % ...........................
+
+To use the classical SSL/TLS way, simply use the ``S'' version of the protocol
+to connect to the server (eg. \emph{imaps} instead of \emph{imap}). This is
+currently available for SMTP, POP3 and IMAP.
+
+\begin{lstlisting}
+vmime::ref <vmime::net::store> store =
+   theSession->getStore(vmime::utility::url("imaps://example.org"));
+\end{lstlisting}
+
+\subsubsection{Using STARTTLS} % .............................................
+
+To make the service start a secured session using the STARTTLS method, simply
+set the \emph{connection.tls} property:
+
+\begin{lstlisting}
+theService->setProperty("connection.tls", true);
+\end{lstlisting}
+
+\vnote{If, for some reason, a secured connection cannot be started, the
+default behaviour is to fallback on a normal connection. To make
+{\vcode connect()} fail if STARTTLS fails, set the
+\emph{connection.tls.required} to \emph{true}.}
+
+\subsection{Certificate verification} % --------------------------------------
+
+\subsubsection{How it works} % ...............................................
+
+If you tried the previous examples, a
+{\vcode certificate\_verification\_exception} might have been thrown.
+This is because the default certificate verifier in VMime did not manage to
+verify the certificate, and so could not trust it.
+
+Basically, when you connect to a server using TLS, the server responds with
+a list of certificates, called a certificate chain (usually, certificates are
+of type X.509\footnote{And VMime currently supports only X.509 certificates}).
+The certificate chain is ordered so that the first certificate is the subject
+certificate, the second is the subject's issuer one, the third is the issuer's
+issuer, and so on.
+
+To decide whether the server can be trusted or not, you have to verify that
+\emph{each} certificate is valid (ie. is trusted). For more information
+about X.509 and certificate verification, see related articles on Wikipedia
+\footnote{See \url{http://wikipedia.org/wiki/Public\_key\_certificate}}.
+
+\subsubsection{Using the default certificate verifier} % .....................
+
+The default certificate verifier maintains a list of root (CAs) and user
+certificates that are trusted. By default, the list is empty. So, you have
+to initialize it before using the verifier.
+
+The algorithm\footnote{See
+\url{http://wikipedia.org/wiki/Certification\_path\_validation\_algorithm}}
+used is quite simple:
+
+\begin{enumerate}
+\item for every certificate in the chain, verify that the certificate has been
+issued by the next certificate in the chain;
+\item for every certificate in the chain, verify that the certificate is valid
+at the current time;
+\item decide whether the subject's certificate can be trusted:
+	\begin{itemize}
+	\item first, verify that the the last certificate in the chain was
+	issued by a third-party that we trust (root CAs);
+	\item if the issuer certificate cannot be verified against root CAs,
+	compare the subject's certificate against the trusted certificates
+	(the certificates the user has decided to trust).
+	\end{itemize}
+\end{enumerate}
+
+First, we need some code to load existing X.509 certificates:
+
+\begin{lstlisting}[caption={Reading a X.509 certificate from a file}]
+vmime::ref <vmime::security::cert::X509Certificate>
+   loadX509CertificateFromFile(const std::string& path)
+{
+   std::ifstream certFile;
+   certFile.open(path.c_str(), std::ios::in | std::ios::binary);
+
+   if (!certFile)
+   {
+      // ...handle error...
+   }
+
+   vmime::utility::inputStreamAdapter is(certFile);
+   vmime::ref <vmime::security::cert::X509Certificate> cert;
+
+   // Try DER format
+   cert = vmime::security::cert::X509Certificate::import
+      (is, vmime::security::cert::X509Certificate::FORMAT_DER);
+
+   if (cert != NULL)
+      return cert;
+
+   // Try PEM format
+   is.reset();
+   cert = vmime::security::cert::X509Certificate::import
+      (is, vmime::security::cert::X509Certificate::FORMAT_PEM);
+
+   return cert;
+}
+\end{lstlisting}
+
+Then, we can use the {\vcode loadX509CertificateFromFile} function to load
+certificates and initialize the certificate verifier:
+
+\begin{lstlisting}[caption={Using the default certificate verifier}]
+vmime::ref <vmime::security::cert::defaultCertificateVerifier> vrf =
+   vmime::create <vmime::security::cert::defaultCertificateVerifier>();
+
+// Load root CAs (such as Verisign or Thawte)
+std::vector <vmime::ref <vmime::security::cert::X509Certificate> > rootCAs;
+
+rootCAs.push_back(loadX509CertificateFromFile("/path/to/root-ca1.cer");
+rootCAs.push_back(loadX509CertificateFromFile("/path/to/root-ca2.cer");
+rootCAs.push_back(loadX509CertificateFromFile("/path/to/root-ca3.cer");
+
+vrf->setX509RootCAs(rootCAs);
+
+// Then, load certificates that the user explicitely chose to trust
+std::vector <vmime::ref <vmime::security::cert::X509Certificate> > trusted;
+
+trusted.push_back(loadX509CertificateFromFile("/path/to/trusted-site1.cer");
+trusted.push_back(loadX509CertificateFromFile("/path/to/trusted-site2.cer");
+
+vrf->setX509TrustedCerts(trusted);
+\end{lstlisting}
+
+
+\subsubsection{Writing your own certificate verifier} % ......................
+
+If you need to do more complex verifications on certificates, you will have to
+write your own verifier. Your verifier should inherit from the
+{\vcode vmime::security::cert::certificateVerifier} class and implement the
+method {\vcode verify()}. Then, if the specified certificate chain is trusted,
+simply return from the function, or else throw a
+{\vcode certificate\_verification\_exception}.
+
+The following example shows how to implement an interactive certificate
+verifier which relies on the user's decision, and nothing else (you SHOULD NOT
+use this in a production application as this is obviously a serious security
+issue):
+
+\begin{lstlisting}[caption={A custom certificate verifier}]
+class myCertVerifier : public vmime::security::cert::certificateVerifier
+{
+public:
+
+   void verify(vmime::ref <certificateChain> certs)
+   {
+      // Obtain the subject's certificate
+      vmime::ref <vmime::security::cert::certificate> cert = chain->getAt(0);
+
+      std::cout << std::endl;
+      std::cout << "Server sent a '" << cert->getType() << "'"
+         << " certificate." << std::endl;
+      std::cout << "Do you want to accept this certificate? (Y/n) ";
+      std::cout.flush();
+
+      std::string answer;
+      std::getline(std::cin, answer);
+
+      if (answer.length() != 0 && (answer[0] == 'Y' || answer[0] == 'y'))
+         return;  // OK, we trust the certificate
+
+      // Don't trust this certificate
+      throw exceptions::certificate_verification_exception();
+   }
+};
+\end{lstlisting}
+
+\vnote{In production code, it may be a good idea to remember user's decisions
+about which certificates to trust and which not. See {\vexample Example6} for
+a basic cache implementation.}
+
+Finally, to make the service use your own certificate verifier, simply write:
+
+\begin{lstlisting}
+theService->setCertificateVerifier(vmime::create <myCertVerifier>());
+\end{lstlisting}
+
diff --git b/examples/viewer/viewer.cpp a/examples/viewer/viewer.cpp
new file mode 100644
index 0000000..50862b3
--- /dev/null
+++ a/examples/viewer/viewer.cpp
@@ -0,0 +1,293 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+//
+// EXAMPLE DESCRIPTION:
+// ====================
+// A simple MIME viewer to show all the components of a message.
+// The user interface is written using GTK+ 2.6.
+//
+// For more information, please visit:
+// http://www.vmime.org/
+//
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#include <gtk/gtk.h>
+
+#include "vmime/vmime.hpp"
+#include "vmime/platforms/posix/posixHandler.hpp"
+
+
+
+GtkWidget* window = NULL;
+GtkWidget* treeView = NULL;
+GtkWidget* textArea = NULL;
+
+GtkTreeStore* treeModel = NULL;
+
+vmime::ref <vmime::message> currentMessage = NULL;
+
+
+
+void insertRowInModel(GtkTreeStore* model, vmime::ref <const vmime::component> comp, GtkTreeIter* parent = NULL)
+{
+	GtkTreeIter iter;
+
+	gtk_tree_store_append(model, &iter, parent);
+	gtk_tree_store_set(model, &iter, 0, typeid(*comp).name(), 1, comp.get(), -1);
+
+	const std::vector <vmime::ref <const vmime::component> > children = comp->getChildComponents();
+
+	for (int i = 0 ; i < children.size() ; ++i)
+	{
+		insertRowInModel(model, children[i], &iter);
+	}
+}
+
+
+void updateTreeView()
+{
+	GtkTreeStore* model = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(treeView)));
+
+	g_object_ref(model);
+	gtk_tree_view_set_model(GTK_TREE_VIEW(treeView), NULL);
+
+	gtk_tree_store_clear(model);
+
+	insertRowInModel(model, currentMessage);
+
+	gtk_tree_view_set_model(GTK_TREE_VIEW(treeView), GTK_TREE_MODEL(model));
+	g_object_unref(model);
+}
+
+
+static void treeViewSelChanged(GtkTreeView* treeView, gpointer userData)
+{
+	GtkTreePath* path = NULL;
+	GtkTreeViewColumn* col = NULL;
+
+	gtk_tree_view_get_cursor(treeView, &path, &col);
+
+	GtkTreeIter iter;
+	gtk_tree_model_get_iter(GTK_TREE_MODEL(treeModel), &iter, path);
+
+	vmime::component* comp = NULL;
+	gtk_tree_model_get(GTK_TREE_MODEL(treeModel), &iter, 1, &comp, -1);
+
+	GtkTextBuffer* textBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textArea));
+	GtkTextIter start, end;
+
+	gtk_text_buffer_get_iter_at_offset(textBuffer, &start, comp->getParsedOffset());
+	gtk_text_buffer_get_iter_at_offset(textBuffer, &end, comp->getParsedOffset() + comp->getParsedLength());
+
+	gtk_text_buffer_select_range(textBuffer, &start, &end);
+
+	gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textArea), &start, 0.0, FALSE, 0.0, 0.0);
+
+	gtk_tree_path_free(path);
+}
+
+
+static void destroy(GtkWidget* widget, gpointer data)
+{
+	gtk_main_quit();
+}
+
+
+void openFile(const std::string& filename)
+{
+	std::ifstream file;
+	file.open(filename.c_str(), std::ios::in | std::ios::binary);
+
+	if (!file)
+	{
+		std::cerr << "Can't open file '" << filename << "'." << std::endl;
+		return;
+	}
+
+	vmime::string data;
+	char buffer[16384];
+
+	do
+	{
+		file.read(buffer, sizeof(buffer));
+		data += vmime::string(buffer, file.gcount());
+	}
+	while (file.gcount());
+
+	vmime::ref <vmime::message> msg = vmime::create <vmime::message>();
+	msg->parse(data);
+
+	currentMessage = msg;
+
+	char* convData = g_convert_with_fallback(data.c_str(), data.length(),
+		"UTF-8", "ISO-8859-1", "?", NULL, NULL, NULL);
+
+	if (convData == NULL)
+	{
+		gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textArea)),
+			"GLib UTF-8 conversion error.", -1);
+	}
+	else
+	{
+		gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textArea)),
+			convData, strlen(convData));
+
+		g_free(convData);
+	}
+
+	updateTreeView();
+}
+
+
+static void onFileOpen()
+{
+	GtkWidget* dlg = gtk_file_chooser_dialog_new
+		("Open Message File", GTK_WINDOW(window), GTK_FILE_CHOOSER_ACTION_OPEN,
+		 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+		 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+		 NULL);
+
+	if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
+	{
+		char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+
+		openFile(filename);
+
+		g_free(filename);
+	}
+
+	gtk_widget_destroy(dlg);
+}
+
+
+
+// UI definitions
+static const GtkActionEntry uiActions[] =
+{
+	{ "FileMenu", NULL, "_File" },
+	{ "FileOpen", GTK_STOCK_OPEN, "_Open...", "<control>O", NULL, G_CALLBACK(onFileOpen) },
+	{ "FileExit", GTK_STOCK_QUIT, "_Exit", "<control>Q", NULL, G_CALLBACK(gtk_main_quit) }
+};
+
+static const char* uiDefinition =
+	"<ui>" \
+	"	<menubar name=\"MainMenuBar\">" \
+	"		<menu action=\"FileMenu\">" \
+	"			<menuitem action=\"FileOpen\"/>" \
+	"			<menuitem action=\"FileExit\"/>" \
+	"		</menu>" \
+	"	</menubar>" \
+	"</ui>";
+
+
+int main(int argc, char* argv[])
+{
+	// VMime initialization
+	vmime::platform::setHandler<vmime::platforms::posix::posixHandler>();
+
+	// GTK+ initialization
+	gtk_init(&argc, &argv);
+
+	// Create a new window
+	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+	gtk_window_set_default_size(GTK_WINDOW(window), 800, 550);
+	gtk_window_set_title(GTK_WINDOW(window), "VMime Viewer Example");
+
+	g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL);
+
+	GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(window), vbox);
+
+	// Menubar
+	GtkActionGroup* actionGroup = gtk_action_group_new ("Actions");
+	gtk_action_group_add_actions(actionGroup, uiActions, G_N_ELEMENTS(uiActions), NULL);
+
+	GtkUIManager* uiManager = gtk_ui_manager_new();
+	gtk_ui_manager_insert_action_group(uiManager, actionGroup, 1);
+	gtk_ui_manager_add_ui_from_string(uiManager, uiDefinition, -1, NULL);
+
+	GtkWidget* menuBar = gtk_ui_manager_get_widget(uiManager, "/MainMenuBar");
+
+	gtk_box_pack_start(GTK_BOX(vbox), menuBar, FALSE, FALSE, 0);
+
+	// Horizontal Pane
+	GtkWidget* hpane = gtk_hpaned_new();
+	gtk_box_pack_start(GTK_BOX(vbox), hpane, TRUE, TRUE, 0);
+
+	// Tree View
+	treeModel = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+
+	treeView = gtk_tree_view_new();
+
+	g_signal_connect(G_OBJECT(treeView), "cursor-changed", G_CALLBACK(treeViewSelChanged), NULL);
+
+	GtkWidget* scroll = gtk_scrolled_window_new(NULL, NULL);
+
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN);
+	gtk_container_add(GTK_CONTAINER(scroll), treeView);
+
+	gtk_paned_add1(GTK_PANED(hpane), scroll);
+
+	GtkTreeViewColumn* col = gtk_tree_view_column_new();
+	gtk_tree_view_column_set_title(col, "Component Name");
+	gtk_tree_view_append_column(GTK_TREE_VIEW(treeView), col);
+
+	GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+
+	gtk_tree_view_column_pack_start(col, renderer, TRUE);
+	gtk_tree_view_column_add_attribute(col, renderer, "text", 0);
+
+	gtk_tree_view_set_model(GTK_TREE_VIEW(treeView), GTK_TREE_MODEL(treeModel));
+	g_object_unref(treeModel);
+
+	gtk_widget_set_size_request(treeView, 200, 100);
+
+	// Text Area
+	textArea = gtk_text_view_new();
+
+	gtk_text_view_set_editable(GTK_TEXT_VIEW(textArea), FALSE);
+
+	scroll = gtk_scrolled_window_new(NULL, NULL);
+
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN);
+	gtk_container_add(GTK_CONTAINER(scroll), textArea);
+
+	gtk_paned_add2(GTK_PANED(hpane), scroll);
+
+	// Show main window
+	gtk_widget_show_all(window);
+
+	// GTK main loop
+	gtk_main();
+
+	return 0;
+}
+
+
diff --git b/m4/acx_pthread.m4 a/m4/acx_pthread.m4
new file mode 100644
index 0000000..b7f692a
--- /dev/null
+++ a/m4/acx_pthread.m4
@@ -0,0 +1,235 @@
+dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro figures out how to build C programs using POSIX threads.
+dnl It sets the PTHREAD_LIBS output variable to the threads library and
+dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
+dnl C compiler flags that are needed. (The user can also force certain
+dnl compiler flags/libs to be tested by setting these environment
+dnl variables.)
+dnl
+dnl Also sets PTHREAD_CC to any special C compiler that is needed for
+dnl multi-threaded programs (defaults to the value of CC otherwise).
+dnl (This is necessary on AIX to use the special cc_r compiler alias.)
+dnl
+dnl NOTE: You are assumed to not only compile your program with these
+dnl flags, but also link it with them as well. e.g. you should link
+dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
+dnl $LIBS
+dnl
+dnl If you are only building threads programs, you may wish to use
+dnl these variables in your default LIBS, CFLAGS, and CC:
+dnl
+dnl        LIBS="$PTHREAD_LIBS $LIBS"
+dnl        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+dnl        CC="$PTHREAD_CC"
+dnl
+dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
+dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
+dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
+dnl default action will define HAVE_PTHREAD.
+dnl
+dnl Please let the authors know if this macro fails on any platform, or
+dnl if you have any other suggestions or comments. This macro was based
+dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
+dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
+dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
+dnl We are also grateful for the helpful feedback of numerous users.
+dnl
+dnl @category InstalledPackages
+dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
+dnl @version 2005-01-14
+dnl @license GPLWithACException
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthread or
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+		if test x"$acx_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_TRY_LINK([#include <pthread.h>],
+                    [pthread_t th; pthread_join(th, 0);
+                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+                    [acx_pthread_ok=yes])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr;],
+                        [attr_name=$attr; break])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with cc_r
+        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        acx_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
diff --git b/m4/ost_posix.m4 a/m4/ost_posix.m4
new file mode 100644
index 0000000..6572b1e
--- /dev/null
+++ a/m4/ost_posix.m4
@@ -0,0 +1,87 @@
+dnl Copyright (C) 1999-2001 Open Source Telecom Corporation.
+dnl  
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software 
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl 
+dnl As a special exception to the GNU General Public License, if you 
+dnl distribute this file as part of a program that contains a configuration 
+dnl script generated by Autoconf, you may include it under the same 
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN(OST_SYS_POSIX,[
+ AC_REQUIRE([OST_PROG_CC_POSIX])
+ AC_CACHE_CHECK(whether system meets Posix.1,
+	ost_cv_sys_posix1,
+	AC_TRY_COMPILE([
+		#include <sys/types.h>
+		#include <unistd.h>
+		],[
+		#ifndef	_POSIX_VERSION
+		fatal
+		#endif
+		],		
+             ost_cv_sys_posix1=yes,
+	     ost_cv_sys_posix1=no
+        )
+  )
+  if test $ost_cv_sys_posix1 = no ; then
+	AC_CHECK_HEADERS(unistd.h)
+  else
+	AC_DEFINE(HAVE_UNISTD_H, [1], [have unix header])
+  fi
+  AC_CHECK_HEADERS(features.h)
+  AH_TOP([
+/* hack for BROKEN autoheader, since it will not predicitably order
+   macros by any obvious means. */
+
+#undef HAVE_UNISTD_H
+#undef HAVE_FEATURES_H
+#undef HAVE_SYS_TYPES_H
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifndef	WIN32
+#ifdef	HAVE_FEATURES_H
+#include <features.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+	])
+])
+
+AC_DEFUN(OST_CC_FCNTL,[
+	AC_REQUIRE([OST_SYS_POSIX])
+	AC_CHECK_HEADERS(fcntl.h sys/fcntl.h)
+AH_BOTTOM([
+
+#ifndef HAVE_FCNTL_H
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#endif
+#else
+#include <fcntl.h>
+#ifndef O_NDELAY
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#endif
+#endif
+#endif
+	])
+])
+
diff --git b/m4/ost_prog.m4 a/m4/ost_prog.m4
new file mode 100644
index 0000000..c9e66f5
--- /dev/null
+++ a/m4/ost_prog.m4
@@ -0,0 +1,61 @@
+dnl Copyright (C) 1999-2001 Open Source Telecom Corporation.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN(OST_PROG_CC_POSIX,[
+	AC_PROG_CC
+	AC_PROG_CPP
+	AC_ISC_POSIX]
+)
+
+AC_DEFUN(OST_PROG_COMMON,[
+	AC_REQUIRE([AC_PROG_INSTALL])
+	AC_REQUIRE([AC_PROG_MAKE_SET])
+])
+
+AC_DEFUN(OST_PROJ_LIBRARY,[
+	AC_REQUIRE([AM_PROG_LIBTOOL])
+	AC_REQUIRE([AC_PROG_RANLIB])
+	if test ! -z "[$2]" ; then
+		if test ! -z "[$3]" ; then
+			LT_[$1]_VERSION="-version-info [$3] -release [$2]"
+		else
+			LT_[$1]_VERSION="-release [$2]"
+		fi
+		AC_SUBST(LT_[$1]_VERSION)
+	fi
+])
+
+AC_DEFUN(OST_PROG_LIBVER,[
+	LT_MAJOR="`echo $LT_VERSION | sed s/:.*$//`"
+	AC_SUBST(LT_RELEASE)
+	AC_SUBST(LT_MAJOR)
+])
+
+
+AC_DEFUN(OST_PROG_LIBRARY,[
+	AC_REQUIRE([AM_PROG_LIBTOOL])
+	AC_REQUIRE([AC_PROG_RANLIB])
+	if test ! -z "[$2]" ; then
+		LT_[$1]_VERSION="-version-info [$2]"
+		AC_SUBST(LT_[$1]_VERSION)
+	fi
+])
+
diff --git b/m4/ost_pthread.m4 a/m4/ost_pthread.m4
new file mode 100644
index 0000000..d427c73
--- /dev/null
+++ a/m4/ost_pthread.m4
@@ -0,0 +1,582 @@
+dnl Copyright (C) 1999-2001 Open Source Telecom Corporation.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software 
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl 
+dnl As a special exception to the GNU General Public License, if you 
+dnl distribute this file as part of a program that contains a configuration 
+dnl script generated by Autoconf, you may include it under the same 
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN([OST_LIB_PTHREAD],
+[
+  AC_REQUIRE([OST_SYS_POSIX])
+  AC_REQUIRE([OST_CC_SYSTIME])
+  THREAD_FLAGS=""
+  THREAD_LIBS=""
+  ost_cv_thread_library="none"
+  ost_cv_rt_library="none"
+  ost_cv_cxx_mode=false
+
+  AC_ARG_WITH(pthread, [  --with-pthread[=lib]    using specified pthread library],
+	[if test "$withval" != "" ; then ost_cv_thread_library=$withval ; fi]
+  )
+
+  AC_ARG_WITH(linuxthreads, [  --with-linuxthreads     use linux kernel mode library],
+	[ost_cv_thread_library=lthread
+	AC_DEFINE(WITH_LINUXTHREADS, [1], [bsd system using linuxthreads])
+	if test "$withval" != "yes" ; then
+		THREAD_FLAGS="-D__USE_GNU -D__USE_UNIX98 -I$withval $THREAD_FLAGS"
+		CFLAGS="-D__USE_GNU -D__USE_UNIX98 -I$withval $CFLAGS"
+	else
+		THREAD_FLAGS="-D__USE_GNU -D__USE_UNIX98 -I/usr/local/include/pthread/linuxthreads $THREAD_FLAGS"
+		CFLAGS="-D__USE_GNU -D__USE_UNIX98 -I/usr/local/include/pthread/linuxthreads $CFLAGS"
+	fi
+	])
+
+  AC_CHECK_HEADERS(pthread.h, [
+	AC_DEFINE(HAVE_PTHREAD_H, [1], [posix thread header])
+	ost_cv_posix_threads=yes],
+	ost_cv_posix_threads=no)
+
+  if test $ost_cv_posix_threads = no ; then
+	AC_LANG_SAVE
+	AC_LANG_CPLUSPLUS
+	SAVE_CXXFLAGS="$CXXFLAGS"
+	CXXFLAGS="$CXXFLAGS -pthread"
+	AC_TRY_COMPILE([#include <pthread.h>],[],
+		AC_DEFINE(HAVE_PTHREAD_H, [1])
+		ost_cv_cxx_mode=true
+		ost_cv_posix_threads=yes)
+	CXXFLAGS="$SAVE_CXXFLAGS"
+	AC_LANG_RESTORE
+  fi
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+  ost_cv_posix_atomic=no
+  AC_CHECK_HEADERS(sys/atomic_op.h,[
+	AC_DEFINE(HAVE_ATOMIC_AIX, [1], [atomic aix operations])
+  ])
+  AC_CHECK_HEADERS([sys/atomic.h],
+	ost_cv_posix_sys_atomic=yes,
+	ost_cv_posix_sys_atomic=no)
+  if test $ost_cv_posix_sys_atomic = yes ; then
+	AC_MSG_CHECKING([for atomic_t])
+	AC_TRY_COMPILE([#include <sys/atomic.h>],
+		[
+		atomic_t at; at.counter = 1;
+		atomic_dec_and_test(&at);
+		atomic_sub(4, &at);
+		atomic_inc(&at);
+		atomic_add(3, &at);
+		],
+		[ost_cv_posix_atomic=yes
+		AC_DEFINE(HAVE_WORKING_SYS_ATOMIC_H, [1], [has usable atomic functions])],
+		[ost_cv_posix_atomic=no])
+	AC_MSG_RESULT($ost_cv_posix_atomic)
+  fi
+
+  dnl check for gcc's bits/atomicity and the atomic functions therein
+  AC_CHECK_HEADERS([bits/atomicity.h],
+	ost_cv_bits_atomicity=yes,
+	ost_cv_bits_atomicity=no)
+  if test $ost_cv_bits_atomicity = yes ; then
+      AC_MSG_CHECKING([for _Atomic_word])
+      AC_TRY_COMPILE([#include <bits/atomicity.h>],
+	    [
+	    _Atomic_word i = 0;
+	    __atomic_add(&i, 1);
+	    __exchange_and_add(&i, 1);
+	    ],
+	    [ost_cv_gcc_atomic=yes
+	     AC_DEFINE(HAVE_GCC_BITS_ATOMIC, [1], [has gcc atomic functions])],
+	    [ost_cv_gcc_atomic=no])
+      AC_MSG_RESULT($ost_cv_gcc_atomic)
+
+      AC_MSG_CHECKING([for __gnu_cxx::_Atomic_word])
+      AC_TRY_COMPILE([#include <bits/atomicity.h>],
+	    [
+	    using namespace __gnu_cxx;
+	    _Atomic_word i = 0;
+	    __atomic_add(&i, 1);
+	    __exchange_and_add(&i, 1);
+	    ],
+	    [ost_cv_gcc_cxx_atomic=yes
+	     AC_DEFINE(HAVE_GCC_CXX_BITS_ATOMIC, [1], 
+		[has __gnu_cxx atomic functions])],
+	    [ost_cv_gcc_cxx_atomic=no])
+      AC_MSG_RESULT($ost_cv_gcc_cxx_atomic)
+  fi
+
+AC_LANG_RESTORE
+
+  if test "$target" = NONE ; then
+	targetdir=""
+  else
+	targetdir="$target"
+  fi
+
+  AC_CHECK_HEADERS(thread.h)
+  if test "$prefix" = NONE ; then
+	thrprefix="/usr/$targetdir/include"
+	if test -d /usr/$targetdir/sys-include ; then
+		thrprefix="$prefix/$targetdir/sys-include" ; fi
+  else
+	thrprefix="$prefix/$targetdir/include"
+	if test -d "$prefix/$targetdir/sys-include" ; then
+		thrprefix="$prefix/$targetdir/sys-include" ; fi
+  fi
+
+  if test ! -f $thrprefix/thread.h ; then
+	thrprefix=/usr/include
+  fi
+
+  AC_SUBST(thrprefix)
+
+  if test $ost_cv_posix_threads = yes ; then
+    if test "$ost_cv_thread_library" = "none" ; then
+
+	ost_cv_thread_flags=""
+	for flags in -kthread -pthread -mthreads -pthreads -Kthread --threadsafe -mt ; do
+
+		AC_MSG_CHECKING(whether ${CC-cc} accepts $flags)
+		echo 'void f(){}' >conftest.c
+		if test -z "`${CC-cc} $flags -c conftest.c 2>&1`"; then
+			ost_cv_thread_flags=$flags
+			AC_MSG_RESULT(yes)
+		else
+			AC_MSG_RESULT(no)
+		fi
+		rm -f conftest*
+		if test ! -z "$ost_cv_thread_flags" ; then break ; fi
+	done
+#	if test "$ost_cv_prog_cc_pthread" = "no" ; then
+#  	   AC_CACHE_CHECK(whether ${CC-cc} accepts -mthreads,
+#		ost_cv_prog_cc_mthreads,
+#		[echo 'void f(){}' >conftest.c
+#		if test -z "`${CC-cc} -mthreads -c conftest.c 2>&1`"; then
+#			ost_cv_prog_cc_mthreads=yes
+# else
+#			ost_cv_prog_cc_mthreads=no
+#		fi
+#		rm -f conftest*
+#		])
+#	fi
+	ost_cv_thread_library=none
+	AC_CHECK_LIB(pthread, pthread_self,
+		ost_cv_thread_library=pthread,
+		AC_CHECK_LIB(c_r, pthread_self,
+			ost_cv_thread_library=c_r,
+			AC_CHECK_LIB(pthread, pthread_kill,
+				ost_cv_thread_library=pthread,
+				AC_CHECK_LIB(pthreads, pthread_self,
+					ost_cv_thread_library=pthreads,
+					AC_CHECK_LIB(thread, pthread_self,
+						ost_cv_thread_library=thread)))))
+
+	if test $ost_cv_thread_library = none ; then
+		AC_CHECK_LIB(gthreads, pthread_self,[
+			AC_CHECK_LIB(malloc, malloc)
+			ost_cv_thread_library=gthreads])
+	fi
+	if test $ost_cv_thread_library = none ; then
+		AC_CHECK_LIB(cma, pthread_self,
+			ost_cv_thread_library=cma)
+	fi
+
+	if test $ost_cv_thread_library = none ; then
+		AC_CHECK_LIB(c, pthread_self,
+			ost_cv_thread_library=c)
+	fi
+	
+	if test $ost_cv_thread_library = none ; then
+		AC_MSG_ERROR(no library for posix threads found!)
+	fi
+    else
+#	ost_cv_prog_cc_pthread=no
+#	ost_cv_prog_cc_mthreads=no
+	ost_cv_thread_flags=""
+    fi
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mach_thread_np,
+		AC_DEFINE(HAVE_PTHREAD_MACH_THREAD_NP, [1], [has mach link])
+		)
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, nanosleep,
+		AC_DEFINE(HAVE_PTHREAD_NANOSLEEP, [1], [has nanosleep]),[
+		AC_CHECK_LIB(posix4, nanosleep,[
+			AC_DEFINE(HAVE_PTHREAD_NANOSLEEP, [1])
+			THREAD_LIBS="$THREAD_LIBS -lposix4"
+			],[
+			AC_CHECK_LIB(rt, nanosleep,[
+				AC_DEFINE(HAVE_PTHREAD_NANOSLEEP, [1])
+				ost_cv_rt_library="-lrt"])
+			])
+
+		])
+
+	AC_CHECK_LIB(rt, clock_gettime,[
+		ost_cv_rt_library="-lrt"
+		AC_DEFINE(HAVE_HIRES_TIMER, [1], [have hires])
+	],[
+		AC_CHECK_FUNCS(clock_gettime,[
+			AC_DEFINE(HAVE_HIRES_TIMER, [1], [have hires])
+		])
+	])
+
+	AC_CHECK_LIB(rt, mlockall,[
+			AC_DEFINE(HAVE_MLOCK, [1], [have mlock])
+			AC_DEFINE(HAVE_MLOCKALL, [1], [have memlockall])
+			ost_cv_rt_library="-lrt"],
+			[
+			AC_CHECK_FUNCS(mlock)
+			AC_CHECK_FUNCS(mlockall)
+			])
+
+	if test "$ost_cv_rt_library" != "none" ; then
+		THREAD_LIBS="$THREAD_LIBS $ost_cv_rt_library" ; fi
+
+	if test ! -z "$ost_cv_thread_flags" ; then
+		THREAD_LIBS="$THREAD_LIBS $ost_cv_thread_flags"
+	else
+		THREAD_LIBS="$THREAD_LIBS -l$ost_cv_thread_library"
+	fi
+
+	AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
+                *solaris* | alpha*-osf*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+               THREAD_FLAGS="$flag"
+        fi
+
+	AC_SUBST(THREAD_FLAGS)
+	AC_SUBST(THREAD_LIBS)
+#	LIBS="$THREAD_LIBS $LIBS"
+	if test "$ost_cv_thread_library" != "lthread" ; then
+		AC_CHECK_HEADERS(pthread_np.h)
+	fi
+	AC_CHECK_HEADERS(semaphore.h)
+	AC_CHECK_HEADERS(sched.h)
+	AC_CHECK_HEADERS(sys/sched.h)
+        AC_CHECK_FUNCS(sched_getscheduler)
+	AC_CACHE_CHECK([for recursive mutex type support], ost_cv_mutex_recursive,
+	[
+	ost_cv_mutex_recursive="none"
+
+	if test "$ost_cv_cxx_mode" = true ; then
+		AC_LANG_SAVE
+		AC_LANG_CPLUSPLUS
+       		SAVE_CXXFLAGS="$CXXFLAGS"
+        	CXXFLAGS="$CXXFLAGS -pthread"
+	fi
+
+	AC_TRY_COMPILE(
+		[#include <pthread.h>],
+		[
+		#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
+		#ifdef PTHREAD_MUTEX_RECURSIVE
+		#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE
+		#endif
+		#endif
+		return (int)PTHREAD_MUTEXTYPE_RECURSIVE;
+		],
+		ost_cv_mutex_recursive="portable",
+		[	
+		AC_EGREP_HEADER(PTHREAD_MUTEXTYPE_RECURSIVE_NP,pthread.h,
+			ost_cv_mutex_recursive=non-portable)
+		AC_EGREP_HEADER(PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP, pthread.h,
+			ost_cv_mutex_recursive=lthread)
+		AC_EGREP_HEADER(PTHREAD_MUTEX_RECURSIVE_NP,pthread.h,
+			ost_cv_mutex_recursive=linux) 
+		AC_EGREP_HEADER(MUTEX_TYPE_COUNTING_FAST,pthread.h,
+			ost_cv_mutex_recursive=counting)	
+		])
+		if test $ost_cv_mutex_recursive = "none" ; then
+			if test $ost_cv_thread_library = "lthread" ; then
+				ost_cv_mutex_recursive=linux
+			fi
+		fi
+	rm -f conftest*
+	])
+
+	if test $ost_cv_mutex_recursive = "none" ; then
+		AC_TRY_COMPILE(
+			[#include <pthread.h>],
+		 	[return MUTEX_TYPE_COUNTING_FAST;],
+			ost_cv_mutex_recursive=counting)
+	fi
+
+	if test "$ost_cv_cxx_mode" = true ; then
+		CXXFLAGS="$SAVE_CXXFLAGS"
+		AC_LANG_RESTORE
+	fi
+
+
+	case $ost_cv_mutex_recursive in
+	non-portable)
+		AC_DEFINE(PTHREAD_MUTEXTYPE_RECURSIVE,
+			PTHREAD_MUTEXTYPE_RECURSIVE_NP, [mutex type])
+		;;
+	linux)
+		AC_DEFINE(PTHREAD_MUTEXTYPE_RECURSIVE,
+			PTHREAD_MUTEX_RECURSIVE_NP)
+		;;
+	counting)
+		AC_DEFINE(PTHREAD_MUTEXTYPE_RECURSIVE,
+			MUTEX_TYPE_COUNTING_FAST)
+		;;
+	esac
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_settype,
+		AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE, [1], [has setttype]),
+		[
+		AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_settype_np,
+			AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP, 
+				[1], [has non portable settype]))
+		AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_setkind_np,
+			AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETKIND_NP,
+				[1], [has non portable setkind]))
+		]
+	)
+
+	ost_cv_thread_rwlock=false
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_rwlock_init,[
+		ost_cv_thread_rwlock=true
+		AC_DEFINE(HAVE_PTHREAD_RWLOCK, [1], [has rwlock support])])
+
+	AC_CHECK_LIB(c, pread,[
+		AC_DEFINE(HAVE_PREAD_PWRITE, [1], [has pwrite])],[
+		AC_CHECK_LIB(${ost_cv_thread_library}, pread,[
+			AC_DEFINE(HAVE_PREAD_PWRITE, [1])],[
+			AC_CHECK_LIB(c_r, pread,[AC_DEFINE(HAVE_PREAD_PWRITE)])
+		])
+	])
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_suspend,
+		AC_DEFINE(HAVE_PTHREAD_SUSPEND, [1], [has suspend]))
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_attr_setstacksize,
+		AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE, [1], [has stack size]))
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_yield_np,
+		AC_DEFINE(HAVE_PTHREAD_YIELD_NP, [1], [has np yield]),[
+		AC_CHECK_LIB(${ost_cv_thread_library}, pthread_yield,
+			AC_DEFINE(HAVE_PTHREAD_YIELD, [1], [has yield]),[
+			AC_CHECK_LIB(${ost_cv_thread_library}, sched_yield,
+				AC_DEFINE(HAVE_PTHREAD_SCHED_YIELD, [1], [has sched yield]))
+			])
+		])
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_cancel,[
+		AC_DEFINE(HAVE_PTHREAD_CANCEL, [1], [has cancel])
+	  	AC_CHECK_LIB(${ost_cv_thread_library},
+			pthread_setcanceltype,
+			AC_DEFINE(HAVE_PTHREAD_SETCANCELTYPE, [1], [has setcanceltype]),
+			AC_CHECK_LIB($ost_cv_thread_library, pthread_setcanel,
+				AC_DEFINE(HAVE_PTHREAD_SETCANCEL, [1], [has setcancel])))
+		],[
+		AC_CHECK_LIB(${ost_cv_thread_library},
+			pthread_setcanceltype,[
+			AC_DEFINE(HAVE_PTHREAD_CANCEL)
+			AC_DEFINE(HAVE_PTHREAD_SETCANCELTYPE)])
+
+		])
+
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_delay_np,
+		AC_DEFINE(HAVE_PTHREAD_DELAY_NP, [1], [has non portable delay]))
+
+  fi
+
+  UNAME=`uname`
+  if test "$UNAME" = "AIX" ; then
+	AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+	CC=$PTHREAD_CC
+	AC_DEFINE(COMMON_AIX_FIXES, [1], [aix fixes needed])
+  fi
+
+AH_BOTTOM([
+#ifdef HAVE_THREAD_H
+#include "@thrprefix@/thread.h"
+#if defined(i386) && defined(__svr4__) && !defined(__sun)
+#define _THR_UNIXWARE
+#endif
+#if defined(__SVR4) && defined(__sun)
+#define _THR_SUNOS5
+#else
+#if defined(__SVR4__) && defined(__SUN__)
+#define _THR_SUNOS5
+#endif
+#endif
+#endif
+
+#ifdef HAVE_WORKING_SYS_ATOMIC_H
+#include <sys/atomic.h>
+#define HAVE_ATOMIC
+#elif defined(HAVE_ATOMIC_AIX)
+#include <sys/atomic_op.h>
+#ifndef	HAVE_ATOMIC
+#define	HAVE_ATOMIC
+#endif
+#endif
+
+#if defined(__cplusplus)
+#if defined(HAVE_GCC_BITS_ATOMIC) || defined(HAVE_GCC_CXX_BITS_ATOMIC)
+#include <bits/atomicity.h>
+#define HAVE_ATOMIC
+#endif
+#endif
+
+#if defined(HAVE_PTHREAD_H) && ( defined(_THREAD_SAFE) || defined(_REENTRANT) )
+
+#ifdef	__QNX__
+#define	__EXT_QNX
+#endif
+
+#include <pthread.h>
+
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
+
+#ifdef HAVE_SEMAPHORE_H
+#include <semaphore.h>
+#endif
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#else
+#ifdef HAVE_SYS_SCHED_H
+#include <sys/sched.h>
+#endif
+#endif
+#endif
+
+#define __PTHREAD_H__
+#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
+#ifdef  MUTEX_TYPE_COUNTING_FAST
+#define PTHREAD_MUTEXTYPE_RECURSIVE MUTEX_TYPE_COUNTING_FAST
+#endif
+#endif
+#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
+#ifdef  PTHREAD_MUTEX_RECURSIVE
+#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE
+#endif
+#endif
+#ifndef HAVE_PTHREAD_MUTEXATTR_SETTYPE
+#if     HAVE_PTHREAD_MUTEXATTR_SETKIND_NP
+#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
+#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
+#endif
+#define pthread_mutexattr_gettype(x, y) pthread_mutexattr_getkind_np(x, y)
+#define pthread_mutexattr_settype(x, y) pthread_mutexattr_setkind_np(x, y)
+#endif
+#if     HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP
+#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
+#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEXTYPE_RECURSIVE_NP
+#endif
+#define pthread_mutexattr_settype(x, y) pthread_mutexattr_settype_np(x, y)
+#define pthread_mutexattr_gettype(x, y) pthread_mutexattr_gettype_np(x, y)
+#endif
+#endif
+
+#ifdef	HAVE_PTHREAD_MACH_THREAD_NP
+#define	_THR_MACH
+#endif
+
+#ifndef HAVE_PTHREAD_YIELD
+#ifdef	HAVE_PTHREAD_YIELD_NP
+#define	pthread_yield() pthread_yield_np()
+#define	HAVE_PTHREAD_YIELD
+#endif
+#endif
+
+#ifndef HAVE_PTHREAD_YIELD
+#ifdef HAVE_PTHREAD_SCHED_YIELD
+#define pthread_yield() sched_yield()
+#define HAVE_PTHREAD_YIELD
+#endif
+#endif
+
+#ifndef HAVE_PTHREAD_DELAY
+#ifdef HAVE_PTHREAD_DELAY_NP
+#define HAVE_PTHREAD_DELAY
+#define pthread_delay(x) pthread_delay_np(x)
+#endif
+#if defined(HAVE_PTHREAD_NANOSLEEP)
+#ifndef HAVE_PTHREAD_DELAY
+#define HAVE_PTHREAD_DELAY
+#ifdef __FreeBSD__
+#ifdef __cplusplus
+extern "C" int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
+#endif
+#endif
+#define pthread_delay(x) nanosleep(x, NULL)
+#endif
+#endif
+#endif
+
+#ifdef HAVE_PTHREAD_ATTR_SETSTACK
+#ifndef PTHREAD_STACK_MIN
+#define PTHREAD_STACK_MIN 32768
+#endif
+#endif
+
+#ifndef HAVE_PTHREAD_CANCEL
+#ifdef SIGCANCEL
+#define CCXX_SIG_THREAD_CANCEL SIGCANCEL
+#else
+#define CCXX_SIG_THREAD_CANCEL SIGQUIT
+#endif
+#define pthread_cancel(x) pthread_kill(x, CCXX_SIG_THREAD_CANCEL)
+#define	pthread_setcanceltype(x, y)
+#define	pthread_setcancelstate(x, y)
+#endif
+
+#ifndef HAVE_PTHREAD_SETCANCELTYPE
+#ifdef HAVE_PTHREAD_SETCANCEL
+enum
+{ PTHREAD_CANCEL_ASYNCHRONOUS = CANCEL_ON,
+  PTHREAD_CANCEL_DEFERRED = CANCEL_OFF};
+enum
+{ PTHREAD_CANCEL_ENABLE = CANCEL_ON,
+  PTHREAD_CANCEL_DISABLE = CANCEL_OFF};
+#define pthread_setcancelstate(x, y) \
+        (y == NULL) ? pthread_setcancel(x) : *y = pthread_setcancel
+#define pthread_setcanceltype(x, y) \
+        (y == NULL) ? pthread_setasynccancel(x) | *y = pthread_setasynccancel(x)
+#else
+#define pthread_setcanceltype(x, y)
+#define pthread_setcancelstate(x, y)
+#endif
+#endif
+
+#ifdef  _AIX
+#ifdef  HAVE_PTHREAD_SUSPEND
+#undef  HAVE_PTHREAD_SUSPEND
+#endif
+#endif
+
+#endif
+
+
+	])
+
+])
+
diff --git b/m4/ost_systime.m4 a/m4/ost_systime.m4
new file mode 100644
index 0000000..f48f207
--- /dev/null
+++ a/m4/ost_systime.m4
@@ -0,0 +1,40 @@
+dnl Copyright (C) 1999-2001 Open Source Telecom Corporation.
+dnl  
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software 
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl 
+dnl As a special exception to the GNU General Public License, if you 
+dnl distribute this file as part of a program that contains a configuration 
+dnl script generated by Autoconf, you may include it under the same 
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN(OST_CC_SYSTIME,[
+	AC_HEADER_TIME
+	AC_CHECK_HEADERS(sys/time.h)
+AH_TOP([
+#undef HAVE_SYS_TIME_H
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+	])
+
+])
+

commit 7b304172a261034b049b0bf4b41208eac54ebd90
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Oct 19 14:39:02 2008 +0000

    Started version 0.9.1.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@482 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/ChangeLog b/ChangeLog
index 5162192..b9a510f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
 
+VERSION 0.9.1svn
+================
+
+2008-10-19  Vincent Richard  <vincent@vincent-richard.net>
+
+ * Started version 0.9.1.
+
+
 VERSION 0.9.0
 =============
 
diff --git a/SConstruct b/SConstruct
index 6014385..7f62876 100644
--- a/SConstruct
+++ b/SConstruct
@@ -29,7 +29,7 @@ import string
 # Package version number
 packageVersionMajor = 0
 packageVersionMinor = 9
-packageVersionMicro = 0
+packageVersionMicro = 1
 
 # API version number (libtool)
 #

commit d0960f6bbb000849505e4fd47de1ab10c3a17627
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Nov 9 13:48:04 2008 +0000

    Missing #include for GCC 4.4 (thanks to Martin Michlmayr).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@483 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 4d063d4..e89b9ab 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -32,6 +32,7 @@
 
 #include <dirent.h>
 
+#include <stdio.h>
 #include <string.h>
 
 #include "vmime/exception.hpp"

commit 9b74d48f383169f9269dbd6612e0b180f9f7119b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 16 21:44:42 2008 +0000

    Send CRLF in the same packet as command to avoid problems with some servers.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@484 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 3ce8d21..5ad8d70 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -617,8 +617,10 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
 
 void SMTPTransport::sendRequest(const string& buffer, const bool end)
 {
-	m_socket->send(buffer);
-	if (end) m_socket->send("\r\n");
+	if (end)
+		m_socket->send(buffer + "\r\n");
+	else
+		m_socket->send(buffer);
 }
 
 

commit 72c169401644272043bbb4e536e13fbf9df494b2
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Dec 29 21:46:08 2008 +0000

    Fixed week of year for 53th week (non ISO-compliant).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@485 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/datetimeUtils.cpp b/src/utility/datetimeUtils.cpp
index ed9fb4b..cc06f50 100644
--- a/src/utility/datetimeUtils.cpp
+++ b/src/utility/datetimeUtils.cpp
@@ -322,6 +322,9 @@ int datetimeUtils::getWeekOfYear(const int year, const int month, const int day)
 			WeekNumber -= 1;
 	}
 
+	if (WeekNumber == 1 && month == 12)
+		WeekNumber = 53;
+
 	return WeekNumber;
 }
 

commit bf516d786e3af88e2663cb96ba7026f8fb9b09cb
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri Jan 9 21:07:42 2009 +0000

    Fixed non-numeric timezone parsing (thanks to John van der Kamp, Zarafa).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@486 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/dateTime.cpp b/src/dateTime.cpp
index 3af6da7..66cd992 100644
--- a/src/dateTime.cpp
+++ b/src/dateTime.cpp
@@ -427,7 +427,7 @@ void datetime::parse(const string& buffer, const string::size_type position,
 				zone[zoneLength++] = *p;
 				++p;
 			}
-			while (zoneLength < 3 && p < pend && parserHelpers::isDigit(*p));
+			while (zoneLength < 3 && p < pend);
 
 			switch (zone[0])
 			{
@@ -491,6 +491,8 @@ void datetime::parse(const string& buffer, const string::size_type position,
 
 				break;
 			}
+			case 'g':
+			case 'G':
 			case 'u':
 			case 'U':
 			{

commit 248d19bf70b8b71e9cdb9f92a09f338289ff5b2a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Mar 1 21:23:40 2009 +0000

    Use Decider() method instead of deprecated SourceSignatures/TargetSignatures().
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@487 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 7f62876..4bfddd8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -439,9 +439,7 @@ EnsureSConsVersion(0, 94)
 
 SetOption('implicit_cache', 1)
 
-#SourceSignatures('timestamp')
-SourceSignatures('MD5')
-TargetSignatures('build')
+Decider('MD5-timestamp')
 
 
 #############

commit 0131dcb8198dc1253bf2b5e86709ff009f4fa448
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Apr 9 18:15:50 2009 +0000

    Fixed block size through filtered streams.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@488 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/filteredStream.cpp b/src/utility/filteredStream.cpp
index eda0c64..5db0104 100644
--- a/src/utility/filteredStream.cpp
+++ b/src/utility/filteredStream.cpp
@@ -30,6 +30,22 @@ namespace vmime {
 namespace utility {
 
 
+// filteredInputStream
+
+stream::size_type filteredInputStream::getBlockSize()
+{
+	return std::min(inputStream::getBlockSize(), getPreviousInputStream().getBlockSize());
+}
+
+
+// filteredOutputStream
+
+stream::size_type filteredOutputStream::getBlockSize()
+{
+	return std::min(outputStream::getBlockSize(), getNextOutputStream().getBlockSize());
+}
+
+
 // dotFilteredInputStream
 
 dotFilteredInputStream::dotFilteredInputStream(inputStream& is)
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp
index bb5300e..8fbf337 100644
--- a/src/utility/stream.cpp
+++ b/src/utility/stream.cpp
@@ -38,7 +38,7 @@ namespace utility {
 
 // stream
 
-stream::size_type stream::getBlockSize() const
+stream::size_type stream::getBlockSize()
 {
 	return 32768;  // 32 KB
 }
@@ -468,7 +468,7 @@ void outputStreamSocketAdapter::flush()
 }
 
 
-stream::size_type outputStreamSocketAdapter::getBlockSize() const
+stream::size_type outputStreamSocketAdapter::getBlockSize()
 {
 	return 16384;  // 16 KB
 }
@@ -511,7 +511,7 @@ stream::size_type inputStreamSocketAdapter::skip
 }
 
 
-stream::size_type inputStreamSocketAdapter::getBlockSize() const
+stream::size_type inputStreamSocketAdapter::getBlockSize()
 {
 	return 16384;  // 16 KB
 }
diff --git a/vmime/utility/filteredStream.hpp b/vmime/utility/filteredStream.hpp
index 9f64ba9..1e03697 100644
--- a/vmime/utility/filteredStream.hpp
+++ b/vmime/utility/filteredStream.hpp
@@ -41,6 +41,8 @@ class filteredInputStream : public inputStream
 {
 public:
 
+	virtual size_type getBlockSize();
+
 	/** Return a reference to the stream being filtered.
 	  *
 	  * @return stream being filtered
@@ -56,6 +58,8 @@ class filteredOutputStream : public outputStream
 {
 public:
 
+	virtual size_type getBlockSize();
+
 	/** Return a reference to the stream being filtered.
 	  *
 	  * @return destination stream for filtered data
diff --git a/vmime/utility/stream.hpp b/vmime/utility/stream.hpp
index a9c079b..5f7bfa2 100644
--- a/vmime/utility/stream.hpp
+++ b/vmime/utility/stream.hpp
@@ -77,7 +77,7 @@ public:
 	  *
 	  * @return block size, in bytes
 	  */
-	virtual size_type getBlockSize() const;
+	virtual size_type getBlockSize();
 };
 
 
@@ -239,6 +239,7 @@ public:
 	void write(const value_type* const data, const size_type count);
 	void flush();
 
+size_type getBlockSize(){return 8192;}
 private:
 
 	string& m_buffer;
@@ -402,7 +403,7 @@ public:
 	void write(const value_type* const data, const size_type count);
 	void flush();
 
-	size_type getBlockSize() const;
+	size_type getBlockSize();
 
 private:
 
@@ -426,7 +427,7 @@ public:
 	size_type read(value_type* const data, const size_type count);
 	size_type skip(const size_type count);
 
-	size_type getBlockSize() const;
+	size_type getBlockSize();
 
 private:
 

commit 11e0721c996957696f41f7450d4161fefad2f450
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Apr 9 20:24:08 2009 +0000

    Fixed duplicate switch case on AIX (thanks to Robin Rawson-Tetley).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@489 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index e89b9ab..b371fe7 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -488,7 +488,9 @@ void posixFileSystemFactory::reportError(const vmime::utility::path& path, const
 	case ENOMEM: desc = "ENOMEM: insufficient kernel memory."; break;
 	case EMFILE: desc = "ENFILE: limit on number of files open by the process has been reached."; break;
 	case ENFILE: desc = "ENFILE: limit on number of files open on the system has been reached."; break;
+#ifndef AIX
 	case ENOTEMPTY: desc = "ENOTEMPTY: directory is not empty."; break;
+#endif
 
 	default:
 

commit d5783e1bfc66a3632820379f4d3f45957469a260
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Apr 9 20:31:16 2009 +0000

    Removed '-pipe' compiler flags, as it is not available on all platforms.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@490 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 4bfddd8..7ba1b27 100644
--- a/SConstruct
+++ b/SConstruct
@@ -590,7 +590,6 @@ env.Append(CPPPATH = [ '.' ])
 
 env.Append(CPPDEFINES = ['_REENTRANT=1'])
 
-env.Append(CXXFLAGS = ['-pipe'])
 env.Append(CXXFLAGS = ['-W'])
 env.Append(CXXFLAGS = ['-Wall'])
 env.Append(CXXFLAGS = ['-ansi'])
@@ -1831,7 +1830,7 @@ EXTRA_CFLAGS="$EXTRA_CFLAGS $lt_prog_compiler_pic"
 
 """)
 
-	compilerFlags = [ '-pipe', '-ansi', '-pedantic', '-W', '-Wall', '-Wpointer-arith', '-Wold-style-cast', '-Wconversion' ]
+	compilerFlags = [ '-ansi', '-pedantic', '-W', '-Wall', '-Wpointer-arith', '-Wold-style-cast', '-Wconversion' ]
 
 	for f in compilerFlags:
 		configure_in.write('# ' + f + '\n')

commit 71398fc74b32da917bb7e8bc8b7d7c1dc79dd03c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri May 1 17:11:20 2009 +0000

    Fixed dynamic_cast support detection on HPUX (aCC).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@491 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 7ba1b27..2a01b61 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1414,8 +1414,8 @@ AC_TRY_COMPILE(
 AC_MSG_CHECKING([if C++ compiler supports dynamic_cast<> (required)])
 AC_TRY_COMPILE(
 [
-   class foo { virtual ~foo() { } };
-   class bar : public foo { };
+   class foo { public: virtual ~foo() { } };
+   class bar : public foo { public: virtual ~bar() { } };
 ],[
    foo *c=0;
    bar *c1=dynamic_cast<bar*>(c);

commit 72074634c0810f69abc92c312199263921c1a619
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 20:57:03 2009 +0000

    Check return status of fsync (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@492 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/AUTHORS b/AUTHORS
index da6f087..d252ee3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,4 +19,5 @@ Other contributors:
  - Benjamin Biron <benbiron@gmail.com>
  - Bertrand Benoit <bsquare@bsquare.levillage.org>
  - Tim Teulings <rael@edge.ping.de>
+ - Georg Sauthoff <gsauthof@techfak.uni-bielefeld.de>
 
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index b371fe7..d04ebc2 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -126,7 +126,8 @@ void posixFileWriterOutputStream::write(const value_type* const data, const size
 
 void posixFileWriterOutputStream::flush()
 {
-	::fsync(m_fd);
+	if (::fsync(m_fd) == -1)
+		posixFileSystemFactory::reportError(m_path, errno);
 }
 
 

commit 063e9acffbbdff0ba65b69e27492551a4370673c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 21:05:16 2009 +0000

    Added other missing return error checks for posix system calls; check consistent for -1 (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@493 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index d04ebc2..79da351 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -63,7 +63,10 @@ posixFileIterator::posixFileIterator(const vmime::utility::file::path& path, con
 posixFileIterator::~posixFileIterator()
 {
 	if (m_dir != NULL)
-		::closedir(m_dir);
+	{
+		if (::closedir(m_dir) == -1)
+			posixFileSystemFactory::reportError(m_path, errno);
+	}
 }
 
 
@@ -86,6 +89,8 @@ ref <vmime::utility::file> posixFileIterator::nextElement()
 
 void posixFileIterator::getNextElement()
 {
+	errno = 0;
+
 	while ((m_dirEntry = ::readdir(m_dir)) != NULL)
 	{
 		const char* name = m_dirEntry->d_name;
@@ -97,6 +102,9 @@ void posixFileIterator::getNextElement()
 			break;
 		}
 	}
+
+	if (errno)
+		posixFileSystemFactory::reportError(m_path, errno);
 }
 
 
@@ -144,7 +152,8 @@ posixFileReaderInputStream::posixFileReaderInputStream(const vmime::utility::fil
 
 posixFileReaderInputStream::~posixFileReaderInputStream()
 {
-	::close(m_fd);
+	if (::close(m_fd) == -1)
+		posixFileSystemFactory::reportError(m_path, errno);
 }
 
 
@@ -156,7 +165,8 @@ bool posixFileReaderInputStream::eof() const
 
 void posixFileReaderInputStream::reset()
 {
-	::lseek(m_fd, 0, SEEK_SET);
+	if (::lseek(m_fd, 0, SEEK_SET) == off_t(-1))
+		posixFileSystemFactory::reportError(m_path, errno);
 }
 
 
@@ -178,8 +188,15 @@ vmime::utility::stream::size_type posixFileReaderInputStream::read
 vmime::utility::stream::size_type posixFileReaderInputStream::skip(const size_type count)
 {
 	const off_t curPos = ::lseek(m_fd, 0, SEEK_CUR);
+
+	if (curPos == off_t(-1))
+		posixFileSystemFactory::reportError(m_path, errno);
+
 	const off_t newPos = ::lseek(m_fd, count, SEEK_CUR);
 
+	if (newPos == off_t(-1))
+		posixFileSystemFactory::reportError(m_path, errno);
+
 	return static_cast <size_type>(newPos - curPos);
 }
 
@@ -246,7 +263,8 @@ void posixFile::createFile()
 	if ((fd = ::open(m_nativePath.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660)) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
-	::close(fd);
+	if (::close(fd) == -1)
+		posixFileSystemFactory::reportError(m_path, errno);
 }
 
 
@@ -259,32 +277,58 @@ void posixFile::createDirectory(const bool createAll)
 bool posixFile::isFile() const
 {
 	struct stat buf;
-	return (::stat(m_nativePath.c_str(), &buf) == 0 && S_ISREG(buf.st_mode));
+
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
+	{
+		posixFileSystemFactory::reportError(m_path, errno);
+		return false;
+	}
+
+	return S_ISREG(buf.st_mode);
 }
 
 
 bool posixFile::isDirectory() const
 {
 	struct stat buf;
-	return (::stat(m_nativePath.c_str(), &buf) == 0 && S_ISDIR(buf.st_mode));
+
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
+	{
+		posixFileSystemFactory::reportError(m_path, errno);
+		return false;
+	}
+
+	return S_ISDIR(buf.st_mode);
 }
 
 
 bool posixFile::canRead() const
 {
 	struct stat buf;
-	return (::stat(m_nativePath.c_str(), &buf) == 0 &&
-			S_ISREG(buf.st_mode) &&
-			::access(m_nativePath.c_str(), R_OK | F_OK) == 0);
+
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
+	{
+		posixFileSystemFactory::reportError(m_path, errno);
+		return false;
+	}
+
+	return S_ISREG(buf.st_mode) &&
+		::access(m_nativePath.c_str(), R_OK | F_OK) == 0;
 }
 
 
 bool posixFile::canWrite() const
 {
 	struct stat buf;
-	return (::stat(m_nativePath.c_str(), &buf) == 0 &&
-			S_ISREG(buf.st_mode) &&
-			::access(m_nativePath.c_str(), W_OK | F_OK) == 0);
+
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
+	{
+		posixFileSystemFactory::reportError(m_path, errno);
+		return false;
+	}
+
+	return S_ISREG(buf.st_mode) &&
+		::access(m_nativePath.c_str(), W_OK | F_OK) == 0;
 }
 
 
@@ -292,7 +336,7 @@ posixFile::length_type posixFile::getLength()
 {
 	struct stat buf;
 
-	if (::stat(m_nativePath.c_str(), &buf) != 0)
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
 	return static_cast <length_type>(buf.st_size);
@@ -325,7 +369,7 @@ void posixFile::rename(const path& newName)
 {
 	const vmime::string newNativePath = posixFileSystemFactory::pathToStringImpl(newName);
 
-	if (::rename(m_nativePath.c_str(), newNativePath.c_str()) != 0)
+	if (::rename(m_nativePath.c_str(), newNativePath.c_str()) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
 	m_path = newName;
@@ -337,17 +381,17 @@ void posixFile::remove()
 {
 	struct stat buf;
 
-	if (::stat(m_nativePath.c_str(), &buf) != 0)
+	if (::stat(m_nativePath.c_str(), &buf) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
 	if (S_ISDIR(buf.st_mode))
 	{
-		if (::rmdir(m_nativePath.c_str()) != 0)
+		if (::rmdir(m_nativePath.c_str()) == -1)
 			posixFileSystemFactory::reportError(m_path, errno);
 	}
 	else if (S_ISREG(buf.st_mode))
 	{
-		if (::unlink(m_nativePath.c_str()) != 0)
+		if (::unlink(m_nativePath.c_str()) == -1)
 			posixFileSystemFactory::reportError(m_path, errno);
 	}
 }
@@ -386,7 +430,7 @@ void posixFile::createDirectoryImpl(const vmime::utility::file::path& fullPath,
 	if (!path.isEmpty() && recursive)
 		createDirectoryImpl(fullPath, path.getParent(), true);
 
-	if (::mkdir(nativePath.c_str(), 0750) != 0)
+	if (::mkdir(nativePath.c_str(), 0750) == -1)
 		posixFileSystemFactory::reportError(fullPath, errno);
 }
 

commit da3d98391ef7004969845593d583812d06d904e7
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 21:07:35 2009 +0000

    Changed posix write wrapper since a) write can be interrupted and b) write can write less than specified without error (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@494 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 79da351..9b16d03 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -127,8 +127,29 @@ posixFileWriterOutputStream::~posixFileWriterOutputStream()
 
 void posixFileWriterOutputStream::write(const value_type* const data, const size_type count)
 {
-	if (::write(m_fd, data, count) == -1)
-		posixFileSystemFactory::reportError(m_path, errno);
+	const value_type* array = data;
+	size_t size = count;
+
+	while (1)
+	{
+		ssize_t ret = ::write(m_fd, array, size);
+
+		if (ret == -1)
+		{
+			if (errno == EINTR)
+				continue;
+
+			posixFileSystemFactory::reportError(m_path, errno);
+			break;
+		}
+		else if (size_t(ret) < size)
+		{
+			array += ret;
+			size -= ret;
+		}
+
+		break;
+	}
 }
 
 

commit 33c37b2603fc3a0608fc75d2951408057d38ba60
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 21:08:56 2009 +0000

    Use ::flush() (aka fsync()) after a maildir message is written (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@495 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index 4f0acaf..9a52171 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -945,6 +945,8 @@ void maildirFolder::copyMessageImpl(const utility::file::path& tmpDirPath,
 			if (progress)
 				progress->progress(total, size);
 		}
+
+		os->flush();
 	}
 	catch (exception& e)
 	{

commit 58afd9dee9633c8e66eb9b9a4d781fdd5de402e9
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 21:19:00 2009 +0000

    Include hostname in message id (ensure unicity when working on a network file system).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@496 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index 67d52fe..13311a5 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -25,6 +25,7 @@
 #include "vmime/net/maildir/maildirStore.hpp"
 
 #include "vmime/utility/random.hpp"
+#include "vmime/platform.hpp"
 
 #include "vmime/exception.hpp"
 
@@ -153,6 +154,8 @@ const utility::file::path::component maildirUtils::generateId()
 	oss << utility::random::getProcess();
 	oss << ".";
 	oss << utility::random::getString(6);
+	oss << ".";
+	oss << platform::getHandler()->getHostName();
 
 	return (utility::file::path::component(oss.str()));
 }

commit 184dacc1ff75195fa594a18fb697b80dd8e08e43
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Jun 21 21:32:25 2009 +0000

    gnutls_x509_crt_list_import does not support multiple DER certificates (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@497 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index 73af1da..4f64967 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -292,27 +292,26 @@ ref <security::cert::certificateChain> TLSSocket::getPeerCertificates() const
 	// Try X.509
 	gnutls_x509_crt* x509Certs = new gnutls_x509_crt[certCount];
 
-	unsigned int count = certCount;
-
-	int res = gnutls_x509_crt_list_import
-		(x509Certs, &count, rawData, GNUTLS_X509_FMT_PEM, 0);
-
-	if (res <= 0)
+	for (unsigned int i = 0; i < certCount; ++i)
 	{
-		count = certCount;
+		gnutls_x509_crt_init(x509Certs + i);
 
-		res = gnutls_x509_crt_list_import
-			(x509Certs, &count, rawData, GNUTLS_X509_FMT_DER, 0);
+		int res = gnutls_x509_crt_import(x509Certs[i], rawData + i,
+			GNUTLS_X509_FMT_DER);
+
+		if (res < 0)
+		{
+			// XXX more fine-grained error reporting?
+			delete [] x509Certs;
+			return NULL;
+		}
 	}
 
-	if (res >= 1)
 	{
 		std::vector <ref <security::cert::certificate> > certs;
 		bool error = false;
 
-		count = static_cast <unsigned int>(res);
-
-		for (unsigned int i = 0 ; i < count ; ++i)
+		for (unsigned int i = 0 ; i < certCount ; ++i)
 		{
 			size_t dataSize = 0;
 

commit c0cec33b83284f8ad6112c63cea9c11f4c067e0c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Jul 11 12:21:59 2009 +0000

    Ensure 'unsigned long' is 4 bytes long (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@498 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index a51e250..51eec6a 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -27,6 +27,7 @@
 #include "vmime/security/digest/sha1/sha1MessageDigest.hpp"
 
 #include <cstring>
+#include <cassert>
 
 
 namespace vmime {
@@ -161,8 +162,8 @@ void sha1MessageDigest::finalize()
 	i = j = 0;
 
 	std::memset(m_buffer, 0, 64);
-	std::memset(m_state, 0, 20);
-	std::memset(m_count, 0, 8);
+	std::memset(m_state, 0, 5 * sizeof(unsigned long));
+	std::memset(m_count, 0, 2 * sizeof(unsigned long));
 	std::memset(&finalcount, 0, 8);
 }
 
@@ -201,6 +202,8 @@ void sha1MessageDigest::transform
 		unsigned long l[16];
 	} CHAR64LONG16;
 
+	assert(sizeof(unsigned long) == 4);
+
 	CHAR64LONG16* block;
 	static unsigned char workspace[64];
 

commit ab6295012905d625d8606408905c8e4bb63b0635
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Jul 11 12:31:18 2009 +0000

    fsync() in posixFile::fileCreate(); changed posixFile::rename to exclusive semantics - if dst exists it fails (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@499 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 9b16d03..2a1356a 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -284,6 +284,9 @@ void posixFile::createFile()
 	if ((fd = ::open(m_nativePath.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660)) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
+	if (::fsync(fd) == -1)
+		posixFileSystemFactory::reportError(m_path, errno);
+
 	if (::close(fd) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 }
@@ -390,6 +393,9 @@ void posixFile::rename(const path& newName)
 {
 	const vmime::string newNativePath = posixFileSystemFactory::pathToStringImpl(newName);
 
+	posixFile dest(newName);
+	dest.createFile();
+
 	if (::rename(m_nativePath.c_str(), newNativePath.c_str()) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 

commit 37807bc97a51d0ef561c9102580b2dd12d66c08a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Jul 11 12:39:36 2009 +0000

    maildirFolder::addMessage() : iff FLAG_RECENT is present, add message to 'new' instead of 'cur' (Georg Sauthoff).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@500 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index 9a52171..65abdcf 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -835,9 +835,12 @@ void maildirFolder::addMessage(utility::inputStream& is, const int size,
 	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
 
 	utility::file::path tmpDirPath = store->getFormat()->
-		folderPathToFileSystemPath(m_path, maildirFormat::TMP_DIRECTORY);
-	utility::file::path curDirPath = store->getFormat()->
-		folderPathToFileSystemPath(m_path, maildirFormat::CUR_DIRECTORY);
+		folderPathToFileSystemPath(m_path,maildirFormat::TMP_DIRECTORY);
+	utility::file::path dstDirPath = store->getFormat()->
+		folderPathToFileSystemPath(m_path,
+			flags == message::FLAG_RECENT ?
+				maildirFormat::NEW_DIRECTORY :
+				maildirFormat::CUR_DIRECTORY);
 
 	const utility::file::path::component filename =
 		maildirUtils::buildFilename(maildirUtils::generateId(),
@@ -855,7 +858,7 @@ void maildirFolder::addMessage(utility::inputStream& is, const int size,
 
 	try
 	{
-		ref <utility::file> curDir = fsf->create(curDirPath);
+		ref <utility::file> curDir = fsf->create(dstDirPath);
 		curDir->createDirectory(true);
 	}
 	catch (exceptions::filesystem_exception&)
@@ -864,7 +867,7 @@ void maildirFolder::addMessage(utility::inputStream& is, const int size,
 	}
 
 	// Actually add the message
-	copyMessageImpl(tmpDirPath, curDirPath, filename, is, size, progress);
+	copyMessageImpl(tmpDirPath, dstDirPath, filename, is, size, progress);
 
 	// Append the message to the cache list
 	messageInfos msgInfos;
@@ -910,7 +913,8 @@ void maildirFolder::addMessage(utility::inputStream& is, const int size,
 
 
 void maildirFolder::copyMessageImpl(const utility::file::path& tmpDirPath,
-	const utility::file::path& curDirPath, const utility::file::path::component& filename,
+	const utility::file::path& dstDirPath,
+	const utility::file::path::component& filename,
 	utility::inputStream& is, const utility::stream::size_type size,
 	utility::progressListener* progress)
 {
@@ -970,7 +974,7 @@ void maildirFolder::copyMessageImpl(const utility::file::path& tmpDirPath,
 	// ...then, move it to 'cur'
 	try
 	{
-		file->rename(curDirPath / filename);
+		file->rename(dstDirPath / filename);
 	}
 	catch (exception& e)
 	{
@@ -980,7 +984,8 @@ void maildirFolder::copyMessageImpl(const utility::file::path& tmpDirPath,
 		// Delete temporary file
 		try
 		{
-			ref <utility::file> file = fsf->create(tmpDirPath / filename);
+			file->remove();
+			ref <utility::file> file = fsf->create(dstDirPath / filename);
 			file->remove();
 		}
 		catch (exceptions::filesystem_exception&)
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index 13311a5..bb2b69f 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -129,18 +129,24 @@ const utility::file::path::component maildirUtils::buildFlags(const int flags)
 const utility::file::path::component maildirUtils::buildFilename
 	(const utility::file::path::component& id, const int flags)
 {
-	return (buildFilename(id, buildFlags(flags)));
+	if (flags == message::FLAG_RECENT)
+		return id;
+	else
+		return (buildFilename(id, buildFlags(flags)));
 }
 
 
 const utility::file::path::component maildirUtils::buildFilename
-	(const utility::file::path::component& id, const utility::file::path::component& flags)
+	(const utility::file::path::component& id,
+	 const utility::file::path::component& flags)
 {
 #if VMIME_BUILTIN_PLATFORM_WINDOWS
-	return (utility::path::component(id.getBuffer() + "-" + flags.getBuffer()));  // use dash
+	static const char DELIMITER[] = "-";
 #else
-	return (utility::path::component(id.getBuffer() + ":" + flags.getBuffer()));  // use colon
+	static const char DELIMITER[] = ":";
 #endif
+
+	return utility::path::component(id.getBuffer() + DELIMITER + flags.getBuffer());
 }
 
 

commit 867808f0e40d69009755419d77f764d2224b8a78
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Aug 19 18:41:20 2009 +0000

    Use pkg-config for gnutls 2.8.0 and later (thanks to Andreas Metzler).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@501 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 2a01b61..2e86832 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1617,7 +1617,7 @@ AC_ARG_ENABLE(tls,
 
 if test "x$conf_tls" = "xyes"; then
 	# -- GNU TLS Library (http://www.gnu.org/software/gnutls/)
-	AM_PATH_LIBGNUTLS(1.2.0, have_gnutls=yes, have_gnutls=no)
+	PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0], have_gnutls=yes, have_gnutls=no)
 
 	if test "x$have_gnutls" = "xyes"; then
 		AM_CONDITIONAL(VMIME_HAVE_TLS_SUPPORT, true)

commit 0dc22247b059382321a3228bb07e0819596466d0
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Sep 6 12:02:10 2009 +0000

    Relicensed VMime under the GNU GPL version 3. Changed copyright year to 2009.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@502 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/AUTHORS b/AUTHORS
index d252ee3..8391c18 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,17 +1,14 @@
 
-VMIME AUTHORS AND CONTRIBUTORS
-==============================
+VMIME AUTHOR
+============
 
 Vincent Richard <vincent@vincent-richard.net>
-Project originator, design, core implementation.
+Project owner and creator. VMime was created in 1998, and publicly released
+under the GNU GPL license in 2003.
 
-Pierre Thierry <nowhere.man@levallois.eu.org>
-Patches for STL algorithms.
 
-Zarafa <http://developer.zarafa.com/VmimePatches>
-Miscellaneous patches.
-
-Other contributors:
+VMIME CONTRIBUTORS
+==================
 
  - Stefan Uhrig  <stefanuhrig@gmx.net>
  - Rafael Fernandez <prf@adinet.com.uy>
@@ -20,4 +17,9 @@ Other contributors:
  - Bertrand Benoit <bsquare@bsquare.levillage.org>
  - Tim Teulings <rael@edge.ping.de>
  - Georg Sauthoff <gsauthof@techfak.uni-bielefeld.de>
+ - Pierre Thierry <nowhere.man@levallois.eu.org> (patches for STL algorithms)
+ - Zarafa <http://developer.zarafa.com/VmimePatches>
+
+Please apologize if I have forgotten someone here.  ;)
+See SVN Changelog for full list.
 
diff --git a/COPYING b/COPYING
index 5b6e7c6..94a9ed0 100644
--- a/COPYING
+++ b/COPYING
@@ -1,285 +1,626 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
 price.  Our General Public Licenses are designed to make sure that you
 have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
 
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
 
   For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
 this License.
 
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
 otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
 be similar in spirit to the present version, but may differ in detail to
 address new problems or concerns.
 
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
 
   To do so, attach the following notices to the program.  It is safest
 to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
+state the exclusion of warranty; and each file should have at least
 the "copyright" line and a pointer to where the full notice is found.
 
     <one line to give the program's name and a brief idea of what it does.>
     Copyright (C) <year>  <name of author>
 
-    This program is free software; you can redistribute it and/or modify
+    This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation, either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 Also add information on how to contact you by electronic and paper mail.
 
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
 
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.
 
 The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
index b9a510f..4031746 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 VERSION 0.9.1svn
 ================
 
+2009-09-06  Vincent Richard  <vincent@vincent-richard.net>
+
+ * Relicensed VMime under the GNU GPL license version 3. Dual licensing
+   is now available. More info here: http://www.vmime.org/pages/Licensing
+
 2008-10-19  Vincent Richard  <vincent@vincent-richard.net>
 
  * Started version 0.9.1.
diff --git a/doc/book/intro.tex b/doc/book/intro.tex
index 93a3675..26d9abe 100644
--- a/doc/book/intro.tex
+++ b/doc/book/intro.tex
@@ -52,14 +52,14 @@ The main objectives of this library are:
 
 VMime library is Free Software and is licensed under the terms of the GNU
 General Public License\footnote{See Appendix \ref{appendix_license} and
-\url{http://www.gnu.org/copyleft/gpl.html}} (GPL):
+\url{http://www.gnu.org/copyleft/gpl.html}} (GPL) version 3:
 
 \begin{verbatim}
-   Copyright (C) 2002-2008 Vincent Richard
+   Copyright (C) 2002-2009 Vincent Richard
 
    VMime library is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
+   published by the Free Software Foundation; either version 3 of
    the License, or (at your option) any later version.
 
    VMime is distributed in the hope that it will be useful, but
@@ -79,7 +79,7 @@ GNU Free Documentation
 License\footnote{See \url{http://www.gnu.org/copyleft/fdl.html}} (FDL):
 
 \begin{verbatim}
-   Copyright (C) 2004-2007 Vincent Richard
+   Copyright (C) 2004-2009 Vincent Richard
 
    Permission is granted to copy, distribute and/or modify
    this document under the terms of the GNU Free Documentation
diff --git a/examples/example1.cpp b/examples/example1.cpp
index 5552510..a340f1d 100644
--- a/examples/example1.cpp
+++ b/examples/example1.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example2.cpp b/examples/example2.cpp
index 953d669..af91f12 100644
--- a/examples/example2.cpp
+++ b/examples/example2.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example3.cpp b/examples/example3.cpp
index 0a260a9..cb3e6ae 100644
--- a/examples/example3.cpp
+++ b/examples/example3.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example4.cpp b/examples/example4.cpp
index 09c2dad..6a746da 100644
--- a/examples/example4.cpp
+++ b/examples/example4.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example5.cpp b/examples/example5.cpp
index 11ceb83..ad84db9 100644
--- a/examples/example5.cpp
+++ b/examples/example5.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example6.cpp b/examples/example6.cpp
index 8bf7b44..bcb2df9 100644
--- a/examples/example6.cpp
+++ b/examples/example6.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/example7.cpp b/examples/example7.cpp
index 79445ea..1ddb3d0 100644
--- a/examples/example7.cpp
+++ b/examples/example7.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/examples/viewer/viewer.cpp b/examples/viewer/viewer.cpp
index 50862b3..ee21f01 100644
--- a/examples/viewer/viewer.cpp
+++ b/examples/viewer/viewer.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/address.cpp b/src/address.cpp
index 17220c1..88c39a3 100644
--- a/src/address.cpp
+++ b/src/address.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/addressList.cpp b/src/addressList.cpp
index fd7b35c..31a2a3d 100644
--- a/src/addressList.cpp
+++ b/src/addressList.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp
index ec6e2f7..65e8c88 100644
--- a/src/attachmentHelper.cpp
+++ b/src/attachmentHelper.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/base.cpp b/src/base.cpp
index 71c63cd..2e47ca3 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/body.cpp b/src/body.cpp
index 0e34762..3f5ff0f 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/bodyPart.cpp b/src/bodyPart.cpp
index b35346b..20bb102 100644
--- a/src/bodyPart.cpp
+++ b/src/bodyPart.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/bodyPartAttachment.cpp b/src/bodyPartAttachment.cpp
index b4fb7b1..f3b6b66 100644
--- a/src/bodyPartAttachment.cpp
+++ b/src/bodyPartAttachment.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/charset.cpp b/src/charset.cpp
index 798d34f..e3c11da 100644
--- a/src/charset.cpp
+++ b/src/charset.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/charsetConverter.cpp b/src/charsetConverter.cpp
index 26609db..ec74ae5 100644
--- a/src/charsetConverter.cpp
+++ b/src/charsetConverter.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/component.cpp b/src/component.cpp
index 69a6049..fbf677b 100644
--- a/src/component.cpp
+++ b/src/component.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/constants.cpp b/src/constants.cpp
index ba6f194..b3f51a2 100644
--- a/src/constants.cpp
+++ b/src/constants.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/contentDisposition.cpp b/src/contentDisposition.cpp
index 7ffa424..0ab7c45 100644
--- a/src/contentDisposition.cpp
+++ b/src/contentDisposition.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/contentDispositionField.cpp b/src/contentDispositionField.cpp
index 0630a51..355e820 100644
--- a/src/contentDispositionField.cpp
+++ b/src/contentDispositionField.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/contentHandler.cpp b/src/contentHandler.cpp
index 5d50283..6022411 100644
--- a/src/contentHandler.cpp
+++ b/src/contentHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/contentTypeField.cpp b/src/contentTypeField.cpp
index 7b5a3e2..406a06e 100644
--- a/src/contentTypeField.cpp
+++ b/src/contentTypeField.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/dateTime.cpp b/src/dateTime.cpp
index 66cd992..089a900 100644
--- a/src/dateTime.cpp
+++ b/src/dateTime.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/defaultAttachment.cpp b/src/defaultAttachment.cpp
index c2ad61e..b61d52e 100644
--- a/src/defaultAttachment.cpp
+++ b/src/defaultAttachment.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/disposition.cpp b/src/disposition.cpp
index 1b420fb..b8059a7 100644
--- a/src/disposition.cpp
+++ b/src/disposition.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/emptyContentHandler.cpp b/src/emptyContentHandler.cpp
index bbee986..5245341 100644
--- a/src/emptyContentHandler.cpp
+++ b/src/emptyContentHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/encoding.cpp b/src/encoding.cpp
index a45573d..58ce71d 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/exception.cpp b/src/exception.cpp
index 54be174..60ec95b 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index 20b8083..e643491 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/generatedMessageAttachment.cpp b/src/generatedMessageAttachment.cpp
index 205b549..e9bd1a6 100644
--- a/src/generatedMessageAttachment.cpp
+++ b/src/generatedMessageAttachment.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/header.cpp b/src/header.cpp
index 78424b3..443aab8 100644
--- a/src/header.cpp
+++ b/src/header.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/headerField.cpp b/src/headerField.cpp
index 0057712..52fe7e8 100644
--- a/src/headerField.cpp
+++ b/src/headerField.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/headerFieldFactory.cpp b/src/headerFieldFactory.cpp
index 6d949f0..807a2b3 100644
--- a/src/headerFieldFactory.cpp
+++ b/src/headerFieldFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp
index a287573..7713034 100644
--- a/src/htmlTextPart.cpp
+++ b/src/htmlTextPart.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index b1ed7a2..2f62521 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mailboxField.cpp b/src/mailboxField.cpp
index 0fc5773..0d9bd83 100644
--- a/src/mailboxField.cpp
+++ b/src/mailboxField.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mailboxGroup.cpp b/src/mailboxGroup.cpp
index ac7202c..94f7ba6 100644
--- a/src/mailboxGroup.cpp
+++ b/src/mailboxGroup.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mailboxList.cpp b/src/mailboxList.cpp
index e9fe7f9..0023d9d 100644
--- a/src/mailboxList.cpp
+++ b/src/mailboxList.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mdn/MDNHelper.cpp b/src/mdn/MDNHelper.cpp
index a4a4ee4..b419b85 100644
--- a/src/mdn/MDNHelper.cpp
+++ b/src/mdn/MDNHelper.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mdn/MDNInfos.cpp b/src/mdn/MDNInfos.cpp
index 82d580d..cd8e38f 100644
--- a/src/mdn/MDNInfos.cpp
+++ b/src/mdn/MDNInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp
index 366d46f..cff211c 100644
--- a/src/mdn/receivedMDNInfos.cpp
+++ b/src/mdn/receivedMDNInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mdn/sendableMDNInfos.cpp b/src/mdn/sendableMDNInfos.cpp
index 953e492..d274ae0 100644
--- a/src/mdn/sendableMDNInfos.cpp
+++ b/src/mdn/sendableMDNInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/mediaType.cpp b/src/mediaType.cpp
index 569ccc3..725f933 100644
--- a/src/mediaType.cpp
+++ b/src/mediaType.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/message.cpp b/src/message.cpp
index 04d1287..6f4b046 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp
index cef4f73..d619554 100644
--- a/src/messageBuilder.cpp
+++ b/src/messageBuilder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/messageId.cpp b/src/messageId.cpp
index 08a8e37..961fb63 100644
--- a/src/messageId.cpp
+++ b/src/messageId.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/messageIdSequence.cpp b/src/messageIdSequence.cpp
index 6011358..08103d0 100644
--- a/src/messageIdSequence.cpp
+++ b/src/messageIdSequence.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/messageParser.cpp b/src/messageParser.cpp
index 639ac5f..35e0bba 100644
--- a/src/messageParser.cpp
+++ b/src/messageParser.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/misc/importanceHelper.cpp b/src/misc/importanceHelper.cpp
index 763753c..22d0cdf 100644
--- a/src/misc/importanceHelper.cpp
+++ b/src/misc/importanceHelper.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/builtinServices.inl b/src/net/builtinServices.inl
index e74766e..4a6ac87 100644
--- a/src/net/builtinServices.inl
+++ b/src/net/builtinServices.inl
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/defaultConnectionInfos.cpp b/src/net/defaultConnectionInfos.cpp
index ee706a3..41f1e0f 100644
--- a/src/net/defaultConnectionInfos.cpp
+++ b/src/net/defaultConnectionInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/events.cpp b/src/net/events.cpp
index a6674a7..52c13ee 100644
--- a/src/net/events.cpp
+++ b/src/net/events.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/folder.cpp b/src/net/folder.cpp
index 20291be..47ec317 100644
--- a/src/net/folder.cpp
+++ b/src/net/folder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index 7c78b78..c3ee574 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index 2130211..c06a8d4 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 90bebf3..29c2aea 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPSStore.cpp b/src/net/imap/IMAPSStore.cpp
index 0b4b90b..9e92f92 100644
--- a/src/net/imap/IMAPSStore.cpp
+++ b/src/net/imap/IMAPSStore.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPServiceInfos.cpp b/src/net/imap/IMAPServiceInfos.cpp
index 1604411..33898f4 100644
--- a/src/net/imap/IMAPServiceInfos.cpp
+++ b/src/net/imap/IMAPServiceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPStore.cpp b/src/net/imap/IMAPStore.cpp
index 753adc6..f260e55 100644
--- a/src/net/imap/IMAPStore.cpp
+++ b/src/net/imap/IMAPStore.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPTag.cpp b/src/net/imap/IMAPTag.cpp
index 7b8ce3f..abb7924 100644
--- a/src/net/imap/IMAPTag.cpp
+++ b/src/net/imap/IMAPTag.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index 18ca00c..c4651ed 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 1118c27..6dbda80 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index eeedd41..5fb75fe 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index 65abdcf..3e361ae 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirFormat.cpp b/src/net/maildir/maildirFormat.cpp
index 17899a2..607ed61 100644
--- a/src/net/maildir/maildirFormat.cpp
+++ b/src/net/maildir/maildirFormat.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index 1ae83ee..ed87cdb 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirServiceInfos.cpp b/src/net/maildir/maildirServiceInfos.cpp
index 48869dc..55ba64e 100644
--- a/src/net/maildir/maildirServiceInfos.cpp
+++ b/src/net/maildir/maildirServiceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirStore.cpp b/src/net/maildir/maildirStore.cpp
index 8e4e002..3b77024 100644
--- a/src/net/maildir/maildirStore.cpp
+++ b/src/net/maildir/maildirStore.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index bb2b69f..19887b2 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/message.cpp b/src/net/message.cpp
index 37f020b..9a54809 100644
--- a/src/net/message.cpp
+++ b/src/net/message.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index ba70f2b..d5fc687 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index 6cdd455..b38951b 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3SStore.cpp b/src/net/pop3/POP3SStore.cpp
index 154f049..59aacb8 100644
--- a/src/net/pop3/POP3SStore.cpp
+++ b/src/net/pop3/POP3SStore.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3ServiceInfos.cpp b/src/net/pop3/POP3ServiceInfos.cpp
index da67f84..77faa5f 100644
--- a/src/net/pop3/POP3ServiceInfos.cpp
+++ b/src/net/pop3/POP3ServiceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index 16a5dff..e5e8ba7 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/pop3/POP3Utils.cpp b/src/net/pop3/POP3Utils.cpp
index b8df9fd..de70dfe 100644
--- a/src/net/pop3/POP3Utils.cpp
+++ b/src/net/pop3/POP3Utils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/sendmail/sendmailServiceInfos.cpp b/src/net/sendmail/sendmailServiceInfos.cpp
index de23e2b..fb5fb54 100644
--- a/src/net/sendmail/sendmailServiceInfos.cpp
+++ b/src/net/sendmail/sendmailServiceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/sendmail/sendmailTransport.cpp b/src/net/sendmail/sendmailTransport.cpp
index c1aded6..53ff0d1 100644
--- a/src/net/sendmail/sendmailTransport.cpp
+++ b/src/net/sendmail/sendmailTransport.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/service.cpp b/src/net/service.cpp
index 2fae23f..f12c78f 100644
--- a/src/net/service.cpp
+++ b/src/net/service.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/serviceFactory.cpp b/src/net/serviceFactory.cpp
index 0abeeb3..65f9aa1 100644
--- a/src/net/serviceFactory.cpp
+++ b/src/net/serviceFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/serviceInfos.cpp b/src/net/serviceInfos.cpp
index d6aee29..069d9e1 100644
--- a/src/net/serviceInfos.cpp
+++ b/src/net/serviceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/serviceRegistration.inl b/src/net/serviceRegistration.inl
index 75fa435..6eaca1e 100644
--- a/src/net/serviceRegistration.inl
+++ b/src/net/serviceRegistration.inl
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/session.cpp b/src/net/session.cpp
index ff23bc5..3898a8d 100644
--- a/src/net/session.cpp
+++ b/src/net/session.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/smtp/SMTPResponse.cpp b/src/net/smtp/SMTPResponse.cpp
index 24301c5..03c199b 100644
--- a/src/net/smtp/SMTPResponse.cpp
+++ b/src/net/smtp/SMTPResponse.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/smtp/SMTPSTransport.cpp b/src/net/smtp/SMTPSTransport.cpp
index 2b70731..db7fc6f 100644
--- a/src/net/smtp/SMTPSTransport.cpp
+++ b/src/net/smtp/SMTPSTransport.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/smtp/SMTPServiceInfos.cpp b/src/net/smtp/SMTPServiceInfos.cpp
index 7c39ea5..d2d0dcc 100644
--- a/src/net/smtp/SMTPServiceInfos.cpp
+++ b/src/net/smtp/SMTPServiceInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 5ad8d70..917a56c 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/tls/TLSSecuredConnectionInfos.cpp b/src/net/tls/TLSSecuredConnectionInfos.cpp
index 55df5e2..2a37069 100644
--- a/src/net/tls/TLSSecuredConnectionInfos.cpp
+++ b/src/net/tls/TLSSecuredConnectionInfos.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index d90be8e..1146d1b 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index 4f64967..c2f91f6 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/net/transport.cpp b/src/net/transport.cpp
index 5db70d2..dd4663d 100644
--- a/src/net/transport.cpp
+++ b/src/net/transport.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/object.cpp b/src/object.cpp
index a15417a..1424f68 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/options.cpp b/src/options.cpp
index a7c838e..f75da99 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/parameter.cpp b/src/parameter.cpp
index 466df3d..6cd8d1f 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp
index a45c627..090d5b4 100644
--- a/src/parameterizedHeaderField.cpp
+++ b/src/parameterizedHeaderField.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/parsedMessageAttachment.cpp b/src/parsedMessageAttachment.cpp
index 3ef17ac..bde56aa 100644
--- a/src/parsedMessageAttachment.cpp
+++ b/src/parsedMessageAttachment.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/path.cpp b/src/path.cpp
index 5816787..37a4090 100644
--- a/src/path.cpp
+++ b/src/path.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp
index dee3f39..7a674e7 100644
--- a/src/plainTextPart.cpp
+++ b/src/plainTextPart.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platform.cpp b/src/platform.cpp
index 9db92cc..d1d23de 100644
--- a/src/platform.cpp
+++ b/src/platform.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/posix/posixChildProcess.cpp b/src/platforms/posix/posixChildProcess.cpp
index d1a0d91..68ef021 100644
--- a/src/platforms/posix/posixChildProcess.cpp
+++ b/src/platforms/posix/posixChildProcess.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 2a1356a..4ec2ef3 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index 94a5072..f43972e 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index 4c2375c..6740995 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index c94076c..5412a3b 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 58b1ae9..404d3cb 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 9450efc..8a42583 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/propertySet.cpp b/src/propertySet.cpp
index c980d96..1b37179 100644
--- a/src/propertySet.cpp
+++ b/src/propertySet.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/relay.cpp b/src/relay.cpp
index b86ea14..5cd454f 100644
--- a/src/relay.cpp
+++ b/src/relay.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/cert/X509Certificate.cpp b/src/security/cert/X509Certificate.cpp
index ac1f7e0..1cd079c 100644
--- a/src/security/cert/X509Certificate.cpp
+++ b/src/security/cert/X509Certificate.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/cert/certificateChain.cpp b/src/security/cert/certificateChain.cpp
index 0425d00..71b8ab4 100644
--- a/src/security/cert/certificateChain.cpp
+++ b/src/security/cert/certificateChain.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/cert/defaultCertificateVerifier.cpp b/src/security/cert/defaultCertificateVerifier.cpp
index dc082a8..6fde551 100644
--- a/src/security/cert/defaultCertificateVerifier.cpp
+++ b/src/security/cert/defaultCertificateVerifier.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/defaultAuthenticator.cpp b/src/security/defaultAuthenticator.cpp
index 8019106..088ef0d 100644
--- a/src/security/defaultAuthenticator.cpp
+++ b/src/security/defaultAuthenticator.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/digest/md5/md5MessageDigest.cpp b/src/security/digest/md5/md5MessageDigest.cpp
index d83908f..84ca99a 100644
--- a/src/security/digest/md5/md5MessageDigest.cpp
+++ b/src/security/digest/md5/md5MessageDigest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/digest/messageDigest.cpp b/src/security/digest/messageDigest.cpp
index 6a5de13..4217984 100644
--- a/src/security/digest/messageDigest.cpp
+++ b/src/security/digest/messageDigest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/digest/messageDigestFactory.cpp b/src/security/digest/messageDigestFactory.cpp
index 1348d65..0326931 100644
--- a/src/security/digest/messageDigestFactory.cpp
+++ b/src/security/digest/messageDigestFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index 51eec6a..6d99e3f 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/SASLContext.cpp b/src/security/sasl/SASLContext.cpp
index fca95c7..51c2bed 100644
--- a/src/security/sasl/SASLContext.cpp
+++ b/src/security/sasl/SASLContext.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/SASLMechanismFactory.cpp b/src/security/sasl/SASLMechanismFactory.cpp
index a866e0c..285d6d3 100644
--- a/src/security/sasl/SASLMechanismFactory.cpp
+++ b/src/security/sasl/SASLMechanismFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/SASLSession.cpp b/src/security/sasl/SASLSession.cpp
index f7f80f5..c1688b7 100644
--- a/src/security/sasl/SASLSession.cpp
+++ b/src/security/sasl/SASLSession.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp
index 5f86aed..118429a 100644
--- a/src/security/sasl/SASLSocket.cpp
+++ b/src/security/sasl/SASLSocket.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/builtinSASLMechanism.cpp b/src/security/sasl/builtinSASLMechanism.cpp
index 1c95831..767caf9 100644
--- a/src/security/sasl/builtinSASLMechanism.cpp
+++ b/src/security/sasl/builtinSASLMechanism.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp
index 085493a..06ffc49 100644
--- a/src/security/sasl/defaultSASLAuthenticator.cpp
+++ b/src/security/sasl/defaultSASLAuthenticator.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/streamContentHandler.cpp b/src/streamContentHandler.cpp
index b5f02bf..9edf4aa 100644
--- a/src/streamContentHandler.cpp
+++ b/src/streamContentHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/stringContentHandler.cpp b/src/stringContentHandler.cpp
index 84cada5..248fca4 100644
--- a/src/stringContentHandler.cpp
+++ b/src/stringContentHandler.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/text.cpp b/src/text.cpp
index 2c811c4..f9ded7c 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/textPartFactory.cpp b/src/textPartFactory.cpp
index 977ba07..c490845 100644
--- a/src/textPartFactory.cpp
+++ b/src/textPartFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/datetimeUtils.cpp b/src/utility/datetimeUtils.cpp
index cc06f50..cf05a93 100644
--- a/src/utility/datetimeUtils.cpp
+++ b/src/utility/datetimeUtils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/b64Encoder.cpp b/src/utility/encoder/b64Encoder.cpp
index c4ba2b3..58ef320 100644
--- a/src/utility/encoder/b64Encoder.cpp
+++ b/src/utility/encoder/b64Encoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/binaryEncoder.cpp b/src/utility/encoder/binaryEncoder.cpp
index 2bc77d2..81da790 100644
--- a/src/utility/encoder/binaryEncoder.cpp
+++ b/src/utility/encoder/binaryEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/defaultEncoder.cpp b/src/utility/encoder/defaultEncoder.cpp
index db833c8..4d0ffb5 100644
--- a/src/utility/encoder/defaultEncoder.cpp
+++ b/src/utility/encoder/defaultEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/eightBitEncoder.cpp b/src/utility/encoder/eightBitEncoder.cpp
index 88f07bc..25ca6c5 100644
--- a/src/utility/encoder/eightBitEncoder.cpp
+++ b/src/utility/encoder/eightBitEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/encoder.cpp b/src/utility/encoder/encoder.cpp
index 893ed4f..85b3708 100644
--- a/src/utility/encoder/encoder.cpp
+++ b/src/utility/encoder/encoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/encoderFactory.cpp b/src/utility/encoder/encoderFactory.cpp
index 9d7c107..428788d 100644
--- a/src/utility/encoder/encoderFactory.cpp
+++ b/src/utility/encoder/encoderFactory.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/qpEncoder.cpp b/src/utility/encoder/qpEncoder.cpp
index 737d488..c3a8c6d 100644
--- a/src/utility/encoder/qpEncoder.cpp
+++ b/src/utility/encoder/qpEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/sevenBitEncoder.cpp b/src/utility/encoder/sevenBitEncoder.cpp
index 812afa9..40f0fbf 100644
--- a/src/utility/encoder/sevenBitEncoder.cpp
+++ b/src/utility/encoder/sevenBitEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/encoder/uuEncoder.cpp b/src/utility/encoder/uuEncoder.cpp
index 0e72599..d2974e6 100644
--- a/src/utility/encoder/uuEncoder.cpp
+++ b/src/utility/encoder/uuEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/filteredStream.cpp b/src/utility/filteredStream.cpp
index 5db0104..619f9da 100644
--- a/src/utility/filteredStream.cpp
+++ b/src/utility/filteredStream.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/path.cpp b/src/utility/path.cpp
index 053e612..9e314e6 100644
--- a/src/utility/path.cpp
+++ b/src/utility/path.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/progressListener.cpp b/src/utility/progressListener.cpp
index c7babcb..4bce372 100644
--- a/src/utility/progressListener.cpp
+++ b/src/utility/progressListener.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/random.cpp b/src/utility/random.cpp
index 2e373bb..d12989b 100644
--- a/src/utility/random.cpp
+++ b/src/utility/random.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/smartPtr.cpp b/src/utility/smartPtr.cpp
index bbc4843..e039036 100644
--- a/src/utility/smartPtr.cpp
+++ b/src/utility/smartPtr.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/smartPtrInt.cpp b/src/utility/smartPtrInt.cpp
index 4b4ce13..2ee677b 100644
--- a/src/utility/smartPtrInt.cpp
+++ b/src/utility/smartPtrInt.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp
index 8fbf337..483784c 100644
--- a/src/utility/stream.cpp
+++ b/src/utility/stream.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/stringProxy.cpp b/src/utility/stringProxy.cpp
index 60093b6..a4ba6d2 100644
--- a/src/utility/stringProxy.cpp
+++ b/src/utility/stringProxy.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/stringUtils.cpp b/src/utility/stringUtils.cpp
index 9566599..03b2057 100644
--- a/src/utility/stringUtils.cpp
+++ b/src/utility/stringUtils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/url.cpp b/src/utility/url.cpp
index 7f609c7..6dfa68a 100644
--- a/src/utility/url.cpp
+++ b/src/utility/url.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/utility/urlUtils.cpp b/src/utility/urlUtils.cpp
index d4243df..6df5794 100644
--- a/src/utility/urlUtils.cpp
+++ b/src/utility/urlUtils.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/word.cpp b/src/word.cpp
index 95adc5c..958c33e 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/src/wordEncoder.cpp b/src/wordEncoder.cpp
index ab7c004..154b4ef 100644
--- a/src/wordEncoder.cpp
+++ b/src/wordEncoder.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/charset/main.cpp b/tests/charset/main.cpp
index dd043ac..3e3a50b 100644
--- a/tests/charset/main.cpp
+++ b/tests/charset/main.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/misc/importanceHelperTest.cpp b/tests/misc/importanceHelperTest.cpp
index de3e7fc..d200cdf 100644
--- a/tests/misc/importanceHelperTest.cpp
+++ b/tests/misc/importanceHelperTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/net/maildir/maildirStoreTest.cpp b/tests/net/maildir/maildirStoreTest.cpp
index f24023b..5aad90b 100644
--- a/tests/net/maildir/maildirStoreTest.cpp
+++ b/tests/net/maildir/maildirStoreTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/net/smtp/SMTPResponseTest.cpp b/tests/net/smtp/SMTPResponseTest.cpp
index 3fbb19a..4ad284f 100644
--- a/tests/net/smtp/SMTPResponseTest.cpp
+++ b/tests/net/smtp/SMTPResponseTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/net/smtp/SMTPTransportTest.cpp b/tests/net/smtp/SMTPTransportTest.cpp
index 640b2a1..5015552 100644
--- a/tests/net/smtp/SMTPTransportTest.cpp
+++ b/tests/net/smtp/SMTPTransportTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/attachmentHelperTest.cpp b/tests/parser/attachmentHelperTest.cpp
index d1ae10a..142730c 100644
--- a/tests/parser/attachmentHelperTest.cpp
+++ b/tests/parser/attachmentHelperTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp
index d6fff5e..12c4f74 100644
--- a/tests/parser/bodyPartTest.cpp
+++ b/tests/parser/bodyPartTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/charsetTest.cpp b/tests/parser/charsetTest.cpp
index 5a791c5..8ad71d7 100644
--- a/tests/parser/charsetTest.cpp
+++ b/tests/parser/charsetTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/datetimeTest.cpp b/tests/parser/datetimeTest.cpp
index b8ceea2..11f9b55 100644
--- a/tests/parser/datetimeTest.cpp
+++ b/tests/parser/datetimeTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/dispositionTest.cpp b/tests/parser/dispositionTest.cpp
index dc79d66..d0572b0 100644
--- a/tests/parser/dispositionTest.cpp
+++ b/tests/parser/dispositionTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/headerTest.cpp b/tests/parser/headerTest.cpp
index e2807ad..04cd14f 100644
--- a/tests/parser/headerTest.cpp
+++ b/tests/parser/headerTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/htmlTextPartTest.cpp b/tests/parser/htmlTextPartTest.cpp
index 6276db2..c9fa588 100644
--- a/tests/parser/htmlTextPartTest.cpp
+++ b/tests/parser/htmlTextPartTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp
index 64b8e45..8411daa 100644
--- a/tests/parser/mailboxTest.cpp
+++ b/tests/parser/mailboxTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/mediaTypeTest.cpp b/tests/parser/mediaTypeTest.cpp
index 4741bda..c69fd89 100644
--- a/tests/parser/mediaTypeTest.cpp
+++ b/tests/parser/mediaTypeTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/messageIdSequenceTest.cpp b/tests/parser/messageIdSequenceTest.cpp
index 82d871f..17e9a96 100644
--- a/tests/parser/messageIdSequenceTest.cpp
+++ b/tests/parser/messageIdSequenceTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/messageIdTest.cpp b/tests/parser/messageIdTest.cpp
index 40e38eb..79154a8 100644
--- a/tests/parser/messageIdTest.cpp
+++ b/tests/parser/messageIdTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp
index f9a6113..fb7a429 100644
--- a/tests/parser/parameterTest.cpp
+++ b/tests/parser/parameterTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/pathTest.cpp b/tests/parser/pathTest.cpp
index 76a944f..b977061 100644
--- a/tests/parser/pathTest.cpp
+++ b/tests/parser/pathTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/parser/textTest.cpp b/tests/parser/textTest.cpp
index 152dbc4..5c9b521 100644
--- a/tests/parser/textTest.cpp
+++ b/tests/parser/textTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/security/digest/md5Test.cpp b/tests/security/digest/md5Test.cpp
index d2049cd..926e023 100644
--- a/tests/security/digest/md5Test.cpp
+++ b/tests/security/digest/md5Test.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/security/digest/sha1Test.cpp b/tests/security/digest/sha1Test.cpp
index 2de0296..3a73a80 100644
--- a/tests/security/digest/sha1Test.cpp
+++ b/tests/security/digest/sha1Test.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/testRunner.cpp b/tests/testRunner.cpp
index e286a10..332a14d 100644
--- a/tests/testRunner.cpp
+++ b/tests/testRunner.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp
index 0fa816c..456b8ad 100644
--- a/tests/testUtils.cpp
+++ b/tests/testUtils.cpp
@@ -4,7 +4,7 @@
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/testUtils.hpp b/tests/testUtils.hpp
index 42e8879..96daba8 100644
--- a/tests/testUtils.hpp
+++ b/tests/testUtils.hpp
@@ -4,7 +4,7 @@
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/datetimeUtilsTest.cpp b/tests/utility/datetimeUtilsTest.cpp
index 89e8118..4fd3e43 100644
--- a/tests/utility/datetimeUtilsTest.cpp
+++ b/tests/utility/datetimeUtilsTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/encoderTest.cpp b/tests/utility/encoderTest.cpp
index 648af78..4e2c9a7 100644
--- a/tests/utility/encoderTest.cpp
+++ b/tests/utility/encoderTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/filteredStreamTest.cpp b/tests/utility/filteredStreamTest.cpp
index bcc785e..ad26e6c 100644
--- a/tests/utility/filteredStreamTest.cpp
+++ b/tests/utility/filteredStreamTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/pathTest.cpp b/tests/utility/pathTest.cpp
index 6c1e442..1c9b4fb 100644
--- a/tests/utility/pathTest.cpp
+++ b/tests/utility/pathTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/smartPtrTest.cpp b/tests/utility/smartPtrTest.cpp
index ce0b941..4f68be4 100644
--- a/tests/utility/smartPtrTest.cpp
+++ b/tests/utility/smartPtrTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/stringProxyTest.cpp b/tests/utility/stringProxyTest.cpp
index e1ba6cb..40648d7 100644
--- a/tests/utility/stringProxyTest.cpp
+++ b/tests/utility/stringProxyTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/stringUtilsTest.cpp b/tests/utility/stringUtilsTest.cpp
index cbdb688..2144bda 100644
--- a/tests/utility/stringUtilsTest.cpp
+++ b/tests/utility/stringUtilsTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/tests/utility/urlTest.cpp b/tests/utility/urlTest.cpp
index 245657a..66d1d08 100644
--- a/tests/utility/urlTest.cpp
+++ b/tests/utility/urlTest.cpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/address.hpp b/vmime/address.hpp
index 31d00f0..188d6ec 100644
--- a/vmime/address.hpp
+++ b/vmime/address.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/addressList.hpp b/vmime/addressList.hpp
index 7bb7635..2e537c0 100644
--- a/vmime/addressList.hpp
+++ b/vmime/addressList.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/attachment.hpp b/vmime/attachment.hpp
index 0df96ca..f45ad28 100644
--- a/vmime/attachment.hpp
+++ b/vmime/attachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/attachmentHelper.hpp b/vmime/attachmentHelper.hpp
index f696b7e..3ce86c8 100644
--- a/vmime/attachmentHelper.hpp
+++ b/vmime/attachmentHelper.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/base.hpp b/vmime/base.hpp
index a25ad7a..ad00d3f 100644
--- a/vmime/base.hpp
+++ b/vmime/base.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/body.hpp b/vmime/body.hpp
index 30ac798..80c1bb5 100644
--- a/vmime/body.hpp
+++ b/vmime/body.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/bodyPart.hpp b/vmime/bodyPart.hpp
index b1edafc..47c11cb 100644
--- a/vmime/bodyPart.hpp
+++ b/vmime/bodyPart.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/bodyPartAttachment.hpp b/vmime/bodyPartAttachment.hpp
index f805b5a..4e1caa0 100644
--- a/vmime/bodyPartAttachment.hpp
+++ b/vmime/bodyPartAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/charset.hpp b/vmime/charset.hpp
index 0630692..1d25b74 100644
--- a/vmime/charset.hpp
+++ b/vmime/charset.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/charsetConverter.hpp b/vmime/charsetConverter.hpp
index 36b52f2..14f0dd9 100644
--- a/vmime/charsetConverter.hpp
+++ b/vmime/charsetConverter.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/component.hpp b/vmime/component.hpp
index 007cfc0..f30a76c 100644
--- a/vmime/component.hpp
+++ b/vmime/component.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/constants.hpp b/vmime/constants.hpp
index 30bc6ef..a1a59da 100644
--- a/vmime/constants.hpp
+++ b/vmime/constants.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free SOFTWARE; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software FOUNDATION; either version 2 of
+// published by the Free Software FOUNDATION; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/contentDisposition.hpp b/vmime/contentDisposition.hpp
index 19b13c2..9d1749b 100644
--- a/vmime/contentDisposition.hpp
+++ b/vmime/contentDisposition.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/contentDispositionField.hpp b/vmime/contentDispositionField.hpp
index d4be481..3474604 100644
--- a/vmime/contentDispositionField.hpp
+++ b/vmime/contentDispositionField.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/contentHandler.hpp b/vmime/contentHandler.hpp
index 303b08c..aa485f5 100644
--- a/vmime/contentHandler.hpp
+++ b/vmime/contentHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/contentTypeField.hpp b/vmime/contentTypeField.hpp
index 8712941..bd812e2 100644
--- a/vmime/contentTypeField.hpp
+++ b/vmime/contentTypeField.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/dateTime.hpp b/vmime/dateTime.hpp
index 0776575..8e99640 100644
--- a/vmime/dateTime.hpp
+++ b/vmime/dateTime.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/defaultAttachment.hpp b/vmime/defaultAttachment.hpp
index ea3f59c..0d2c3e5 100644
--- a/vmime/defaultAttachment.hpp
+++ b/vmime/defaultAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/disposition.hpp b/vmime/disposition.hpp
index 44bde21..05bfca2 100644
--- a/vmime/disposition.hpp
+++ b/vmime/disposition.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/emptyContentHandler.hpp b/vmime/emptyContentHandler.hpp
index d5aaffd..727c065 100644
--- a/vmime/emptyContentHandler.hpp
+++ b/vmime/emptyContentHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/encoding.hpp b/vmime/encoding.hpp
index aa99853..fa72dfb 100644
--- a/vmime/encoding.hpp
+++ b/vmime/encoding.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/exception.hpp b/vmime/exception.hpp
index c96d145..5b68bd7 100644
--- a/vmime/exception.hpp
+++ b/vmime/exception.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/fileAttachment.hpp b/vmime/fileAttachment.hpp
index dbf1710..0662c8e 100644
--- a/vmime/fileAttachment.hpp
+++ b/vmime/fileAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/generatedMessageAttachment.hpp b/vmime/generatedMessageAttachment.hpp
index 47da8a5..58eacbd 100644
--- a/vmime/generatedMessageAttachment.hpp
+++ b/vmime/generatedMessageAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/header.hpp b/vmime/header.hpp
index 65236cf..95a9326 100644
--- a/vmime/header.hpp
+++ b/vmime/header.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/headerField.hpp b/vmime/headerField.hpp
index 3d8f26a..50494c9 100644
--- a/vmime/headerField.hpp
+++ b/vmime/headerField.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/headerFieldFactory.hpp b/vmime/headerFieldFactory.hpp
index fc074fb..4b1e567 100644
--- a/vmime/headerFieldFactory.hpp
+++ b/vmime/headerFieldFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/headerFieldValue.hpp b/vmime/headerFieldValue.hpp
index b313d4d..adfdeb2 100644
--- a/vmime/headerFieldValue.hpp
+++ b/vmime/headerFieldValue.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/htmlTextPart.hpp b/vmime/htmlTextPart.hpp
index 140b4dd..5795eeb 100644
--- a/vmime/htmlTextPart.hpp
+++ b/vmime/htmlTextPart.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mailbox.hpp b/vmime/mailbox.hpp
index 2717ec5..2072be8 100644
--- a/vmime/mailbox.hpp
+++ b/vmime/mailbox.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mailboxField.hpp b/vmime/mailboxField.hpp
index 754ac26..edd2d28 100644
--- a/vmime/mailboxField.hpp
+++ b/vmime/mailboxField.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mailboxGroup.hpp b/vmime/mailboxGroup.hpp
index 8038c06..0061d5b 100644
--- a/vmime/mailboxGroup.hpp
+++ b/vmime/mailboxGroup.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mailboxList.hpp b/vmime/mailboxList.hpp
index 33b2ace..11e4e79 100644
--- a/vmime/mailboxList.hpp
+++ b/vmime/mailboxList.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mdn/MDNHelper.hpp b/vmime/mdn/MDNHelper.hpp
index ee9f421..f9764fa 100644
--- a/vmime/mdn/MDNHelper.hpp
+++ b/vmime/mdn/MDNHelper.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mdn/MDNInfos.hpp b/vmime/mdn/MDNInfos.hpp
index 5b7624c..3c52a60 100644
--- a/vmime/mdn/MDNInfos.hpp
+++ b/vmime/mdn/MDNInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mdn/receivedMDNInfos.hpp b/vmime/mdn/receivedMDNInfos.hpp
index 685bd79..1c258a2 100644
--- a/vmime/mdn/receivedMDNInfos.hpp
+++ b/vmime/mdn/receivedMDNInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mdn/sendableMDNInfos.hpp b/vmime/mdn/sendableMDNInfos.hpp
index 451a467..1f766ea 100644
--- a/vmime/mdn/sendableMDNInfos.hpp
+++ b/vmime/mdn/sendableMDNInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/mediaType.hpp b/vmime/mediaType.hpp
index 59d8020..658b21f 100644
--- a/vmime/mediaType.hpp
+++ b/vmime/mediaType.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/message.hpp b/vmime/message.hpp
index 449348e..f3be229 100644
--- a/vmime/message.hpp
+++ b/vmime/message.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/messageAttachment.hpp b/vmime/messageAttachment.hpp
index 2cc3abc..bdd4e8b 100644
--- a/vmime/messageAttachment.hpp
+++ b/vmime/messageAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/messageBuilder.hpp b/vmime/messageBuilder.hpp
index b94fe82..0371288 100644
--- a/vmime/messageBuilder.hpp
+++ b/vmime/messageBuilder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/messageId.hpp b/vmime/messageId.hpp
index 60f62ad..3686b11 100644
--- a/vmime/messageId.hpp
+++ b/vmime/messageId.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/messageIdSequence.hpp b/vmime/messageIdSequence.hpp
index e1989fe..5dfb840 100644
--- a/vmime/messageIdSequence.hpp
+++ b/vmime/messageIdSequence.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/messageParser.hpp b/vmime/messageParser.hpp
index 211fac7..c7d5646 100644
--- a/vmime/messageParser.hpp
+++ b/vmime/messageParser.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/misc/importanceHelper.hpp b/vmime/misc/importanceHelper.hpp
index a139ffb..37f3497 100644
--- a/vmime/misc/importanceHelper.hpp
+++ b/vmime/misc/importanceHelper.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/connectionInfos.hpp b/vmime/net/connectionInfos.hpp
index 302aecb..03f01b9 100644
--- a/vmime/net/connectionInfos.hpp
+++ b/vmime/net/connectionInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/defaultConnectionInfos.hpp b/vmime/net/defaultConnectionInfos.hpp
index 0c99684..518b4bc 100644
--- a/vmime/net/defaultConnectionInfos.hpp
+++ b/vmime/net/defaultConnectionInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/events.hpp b/vmime/net/events.hpp
index 66ce207..be05c6e 100644
--- a/vmime/net/events.hpp
+++ b/vmime/net/events.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/folder.hpp b/vmime/net/folder.hpp
index 0ae33c5..b20e9c9 100644
--- a/vmime/net/folder.hpp
+++ b/vmime/net/folder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPConnection.hpp b/vmime/net/imap/IMAPConnection.hpp
index 865a4df..147c4df 100644
--- a/vmime/net/imap/IMAPConnection.hpp
+++ b/vmime/net/imap/IMAPConnection.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPFolder.hpp b/vmime/net/imap/IMAPFolder.hpp
index 434653a..dec3878 100644
--- a/vmime/net/imap/IMAPFolder.hpp
+++ b/vmime/net/imap/IMAPFolder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPMessage.hpp b/vmime/net/imap/IMAPMessage.hpp
index caab819..690e5e2 100644
--- a/vmime/net/imap/IMAPMessage.hpp
+++ b/vmime/net/imap/IMAPMessage.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPParser.hpp b/vmime/net/imap/IMAPParser.hpp
index b307957..0f3e9ec 100644
--- a/vmime/net/imap/IMAPParser.hpp
+++ b/vmime/net/imap/IMAPParser.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPSStore.hpp b/vmime/net/imap/IMAPSStore.hpp
index efd8126..5772ad9 100644
--- a/vmime/net/imap/IMAPSStore.hpp
+++ b/vmime/net/imap/IMAPSStore.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPServiceInfos.hpp b/vmime/net/imap/IMAPServiceInfos.hpp
index 82b8c15..7286b3a 100644
--- a/vmime/net/imap/IMAPServiceInfos.hpp
+++ b/vmime/net/imap/IMAPServiceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPStore.hpp b/vmime/net/imap/IMAPStore.hpp
index bf8235e..ebff2e6 100644
--- a/vmime/net/imap/IMAPStore.hpp
+++ b/vmime/net/imap/IMAPStore.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPTag.hpp b/vmime/net/imap/IMAPTag.hpp
index 04c8b94..cab2d48 100644
--- a/vmime/net/imap/IMAPTag.hpp
+++ b/vmime/net/imap/IMAPTag.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/imap/IMAPUtils.hpp b/vmime/net/imap/IMAPUtils.hpp
index 181bd46..d1ed5c8 100644
--- a/vmime/net/imap/IMAPUtils.hpp
+++ b/vmime/net/imap/IMAPUtils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/format/courierMaildirFormat.hpp b/vmime/net/maildir/format/courierMaildirFormat.hpp
index b533abc..e8036d5 100644
--- a/vmime/net/maildir/format/courierMaildirFormat.hpp
+++ b/vmime/net/maildir/format/courierMaildirFormat.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/format/kmailMaildirFormat.hpp b/vmime/net/maildir/format/kmailMaildirFormat.hpp
index 0dfb964..e5f7222 100644
--- a/vmime/net/maildir/format/kmailMaildirFormat.hpp
+++ b/vmime/net/maildir/format/kmailMaildirFormat.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirFolder.hpp b/vmime/net/maildir/maildirFolder.hpp
index c0165fa..7474b1a 100644
--- a/vmime/net/maildir/maildirFolder.hpp
+++ b/vmime/net/maildir/maildirFolder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirFormat.hpp b/vmime/net/maildir/maildirFormat.hpp
index e00dfdf..a47c854 100644
--- a/vmime/net/maildir/maildirFormat.hpp
+++ b/vmime/net/maildir/maildirFormat.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirMessage.hpp b/vmime/net/maildir/maildirMessage.hpp
index 067bdcb..ba3c88e 100644
--- a/vmime/net/maildir/maildirMessage.hpp
+++ b/vmime/net/maildir/maildirMessage.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirServiceInfos.hpp b/vmime/net/maildir/maildirServiceInfos.hpp
index 88ac754..f3b0df8 100644
--- a/vmime/net/maildir/maildirServiceInfos.hpp
+++ b/vmime/net/maildir/maildirServiceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirStore.hpp b/vmime/net/maildir/maildirStore.hpp
index 0c78943..40ecec3 100644
--- a/vmime/net/maildir/maildirStore.hpp
+++ b/vmime/net/maildir/maildirStore.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/maildir/maildirUtils.hpp b/vmime/net/maildir/maildirUtils.hpp
index 8c9920b..c4aa0b6 100644
--- a/vmime/net/maildir/maildirUtils.hpp
+++ b/vmime/net/maildir/maildirUtils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/message.hpp b/vmime/net/message.hpp
index 2d8dc1a..a0cc1da 100644
--- a/vmime/net/message.hpp
+++ b/vmime/net/message.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3Folder.hpp b/vmime/net/pop3/POP3Folder.hpp
index 951abc5..abaa8eb 100644
--- a/vmime/net/pop3/POP3Folder.hpp
+++ b/vmime/net/pop3/POP3Folder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3Message.hpp b/vmime/net/pop3/POP3Message.hpp
index ccfa089..5dbea3f 100644
--- a/vmime/net/pop3/POP3Message.hpp
+++ b/vmime/net/pop3/POP3Message.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3SStore.hpp b/vmime/net/pop3/POP3SStore.hpp
index 9144f95..1f98bfa 100644
--- a/vmime/net/pop3/POP3SStore.hpp
+++ b/vmime/net/pop3/POP3SStore.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3ServiceInfos.hpp b/vmime/net/pop3/POP3ServiceInfos.hpp
index 23bc81d..d2dff58 100644
--- a/vmime/net/pop3/POP3ServiceInfos.hpp
+++ b/vmime/net/pop3/POP3ServiceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3Store.hpp b/vmime/net/pop3/POP3Store.hpp
index 55c0ce4..16fcce4 100644
--- a/vmime/net/pop3/POP3Store.hpp
+++ b/vmime/net/pop3/POP3Store.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/pop3/POP3Utils.hpp b/vmime/net/pop3/POP3Utils.hpp
index 51bb527..2640c0e 100644
--- a/vmime/net/pop3/POP3Utils.hpp
+++ b/vmime/net/pop3/POP3Utils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/securedConnectionInfos.hpp b/vmime/net/securedConnectionInfos.hpp
index 880e6c9..b27d30b 100644
--- a/vmime/net/securedConnectionInfos.hpp
+++ b/vmime/net/securedConnectionInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/sendmail/sendmailServiceInfos.hpp b/vmime/net/sendmail/sendmailServiceInfos.hpp
index 4c2df63..a86a4dd 100644
--- a/vmime/net/sendmail/sendmailServiceInfos.hpp
+++ b/vmime/net/sendmail/sendmailServiceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/sendmail/sendmailTransport.hpp b/vmime/net/sendmail/sendmailTransport.hpp
index 8383e11..5ff8cf2 100644
--- a/vmime/net/sendmail/sendmailTransport.hpp
+++ b/vmime/net/sendmail/sendmailTransport.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/service.hpp b/vmime/net/service.hpp
index c260f2a..5205fee 100644
--- a/vmime/net/service.hpp
+++ b/vmime/net/service.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/serviceFactory.hpp b/vmime/net/serviceFactory.hpp
index 730df2e..0362b47 100644
--- a/vmime/net/serviceFactory.hpp
+++ b/vmime/net/serviceFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/serviceInfos.hpp b/vmime/net/serviceInfos.hpp
index 745f85e..eac77a1 100644
--- a/vmime/net/serviceInfos.hpp
+++ b/vmime/net/serviceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/session.hpp b/vmime/net/session.hpp
index 3eb4cfb..426fe7a 100644
--- a/vmime/net/session.hpp
+++ b/vmime/net/session.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/smtp/SMTPResponse.hpp b/vmime/net/smtp/SMTPResponse.hpp
index 313f6a3..5ef4f09 100644
--- a/vmime/net/smtp/SMTPResponse.hpp
+++ b/vmime/net/smtp/SMTPResponse.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/smtp/SMTPSTransport.hpp b/vmime/net/smtp/SMTPSTransport.hpp
index 4922ba2..393a4f5 100644
--- a/vmime/net/smtp/SMTPSTransport.hpp
+++ b/vmime/net/smtp/SMTPSTransport.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/smtp/SMTPServiceInfos.hpp b/vmime/net/smtp/SMTPServiceInfos.hpp
index 15ea735..61f5aa8 100644
--- a/vmime/net/smtp/SMTPServiceInfos.hpp
+++ b/vmime/net/smtp/SMTPServiceInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/smtp/SMTPTransport.hpp b/vmime/net/smtp/SMTPTransport.hpp
index de0092e..050fedd 100644
--- a/vmime/net/smtp/SMTPTransport.hpp
+++ b/vmime/net/smtp/SMTPTransport.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/socket.hpp b/vmime/net/socket.hpp
index 88e1f3c..9b0319c 100644
--- a/vmime/net/socket.hpp
+++ b/vmime/net/socket.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/store.hpp b/vmime/net/store.hpp
index e60721b..1c9ac1c 100644
--- a/vmime/net/store.hpp
+++ b/vmime/net/store.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/timeoutHandler.hpp b/vmime/net/timeoutHandler.hpp
index 0877ec1..6a20665 100644
--- a/vmime/net/timeoutHandler.hpp
+++ b/vmime/net/timeoutHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/tls/TLSSecuredConnectionInfos.hpp b/vmime/net/tls/TLSSecuredConnectionInfos.hpp
index 5451633..d0e4087 100644
--- a/vmime/net/tls/TLSSecuredConnectionInfos.hpp
+++ b/vmime/net/tls/TLSSecuredConnectionInfos.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/tls/TLSSession.hpp b/vmime/net/tls/TLSSession.hpp
index 639babe..e6bd64f 100644
--- a/vmime/net/tls/TLSSession.hpp
+++ b/vmime/net/tls/TLSSession.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/tls/TLSSocket.hpp b/vmime/net/tls/TLSSocket.hpp
index 1c1d324..5112550 100644
--- a/vmime/net/tls/TLSSocket.hpp
+++ b/vmime/net/tls/TLSSocket.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/net/transport.hpp b/vmime/net/transport.hpp
index 4ece804..45dc5a5 100644
--- a/vmime/net/transport.hpp
+++ b/vmime/net/transport.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/object.hpp b/vmime/object.hpp
index 2782189..2a33aed 100644
--- a/vmime/object.hpp
+++ b/vmime/object.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/options.hpp b/vmime/options.hpp
index 5edb051..7e96c2b 100644
--- a/vmime/options.hpp
+++ b/vmime/options.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/parameter.hpp b/vmime/parameter.hpp
index 2d21cd1..e1b13a1 100644
--- a/vmime/parameter.hpp
+++ b/vmime/parameter.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/parameterizedHeaderField.hpp b/vmime/parameterizedHeaderField.hpp
index c2c8502..2940ca3 100644
--- a/vmime/parameterizedHeaderField.hpp
+++ b/vmime/parameterizedHeaderField.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/parsedMessageAttachment.hpp b/vmime/parsedMessageAttachment.hpp
index e66c6c0..abc2ff5 100644
--- a/vmime/parsedMessageAttachment.hpp
+++ b/vmime/parsedMessageAttachment.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/parserHelpers.hpp b/vmime/parserHelpers.hpp
index 9be6e4a..9b075f7 100644
--- a/vmime/parserHelpers.hpp
+++ b/vmime/parserHelpers.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/path.hpp b/vmime/path.hpp
index aa0d8cb..beaa72b 100644
--- a/vmime/path.hpp
+++ b/vmime/path.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/plainTextPart.hpp b/vmime/plainTextPart.hpp
index c9419b5..72c12ac 100644
--- a/vmime/plainTextPart.hpp
+++ b/vmime/plainTextPart.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platform.hpp b/vmime/platform.hpp
index 293320f..d390571 100644
--- a/vmime/platform.hpp
+++ b/vmime/platform.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/posix/posixChildProcess.hpp b/vmime/platforms/posix/posixChildProcess.hpp
index e689065..c25aaca 100644
--- a/vmime/platforms/posix/posixChildProcess.hpp
+++ b/vmime/platforms/posix/posixChildProcess.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/posix/posixFile.hpp b/vmime/platforms/posix/posixFile.hpp
index b7296c6..70986df 100644
--- a/vmime/platforms/posix/posixFile.hpp
+++ b/vmime/platforms/posix/posixFile.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/posix/posixHandler.hpp b/vmime/platforms/posix/posixHandler.hpp
index bc78719..397a5dd 100644
--- a/vmime/platforms/posix/posixHandler.hpp
+++ b/vmime/platforms/posix/posixHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/posix/posixSocket.hpp b/vmime/platforms/posix/posixSocket.hpp
index c230944..0d0dae6 100644
--- a/vmime/platforms/posix/posixSocket.hpp
+++ b/vmime/platforms/posix/posixSocket.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/windows/windowsFile.hpp b/vmime/platforms/windows/windowsFile.hpp
index 7e81859..a2a9e92 100644
--- a/vmime/platforms/windows/windowsFile.hpp
+++ b/vmime/platforms/windows/windowsFile.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/windows/windowsHandler.hpp b/vmime/platforms/windows/windowsHandler.hpp
index 2f65651..701edf0 100644
--- a/vmime/platforms/windows/windowsHandler.hpp
+++ b/vmime/platforms/windows/windowsHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/platforms/windows/windowsSocket.hpp b/vmime/platforms/windows/windowsSocket.hpp
index 6890ddc..61475c3 100644
--- a/vmime/platforms/windows/windowsSocket.hpp
+++ b/vmime/platforms/windows/windowsSocket.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://vmime.sourceforge.net)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/propertySet.hpp b/vmime/propertySet.hpp
index 94cf1fd..e5cbf1f 100644
--- a/vmime/propertySet.hpp
+++ b/vmime/propertySet.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/relay.hpp b/vmime/relay.hpp
index 46b6351..583ad80 100644
--- a/vmime/relay.hpp
+++ b/vmime/relay.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/authenticator.hpp b/vmime/security/authenticator.hpp
index d339975..a31fc5e 100644
--- a/vmime/security/authenticator.hpp
+++ b/vmime/security/authenticator.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/cert/X509Certificate.hpp b/vmime/security/cert/X509Certificate.hpp
index e7ca309..b916cff 100644
--- a/vmime/security/cert/X509Certificate.hpp
+++ b/vmime/security/cert/X509Certificate.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/cert/certificate.hpp b/vmime/security/cert/certificate.hpp
index 440a1a8..b7447fe 100644
--- a/vmime/security/cert/certificate.hpp
+++ b/vmime/security/cert/certificate.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/cert/certificateChain.hpp b/vmime/security/cert/certificateChain.hpp
index bb21313..02e3d55 100644
--- a/vmime/security/cert/certificateChain.hpp
+++ b/vmime/security/cert/certificateChain.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/cert/certificateVerifier.hpp b/vmime/security/cert/certificateVerifier.hpp
index e04b11c..cf03826 100644
--- a/vmime/security/cert/certificateVerifier.hpp
+++ b/vmime/security/cert/certificateVerifier.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/cert/defaultCertificateVerifier.hpp b/vmime/security/cert/defaultCertificateVerifier.hpp
index 5b4bab6..6f650f3 100644
--- a/vmime/security/cert/defaultCertificateVerifier.hpp
+++ b/vmime/security/cert/defaultCertificateVerifier.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/defaultAuthenticator.hpp b/vmime/security/defaultAuthenticator.hpp
index 641dcfe..dfb8298 100644
--- a/vmime/security/defaultAuthenticator.hpp
+++ b/vmime/security/defaultAuthenticator.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/digest/md5/md5MessageDigest.hpp b/vmime/security/digest/md5/md5MessageDigest.hpp
index 893cb05..682e7cc 100644
--- a/vmime/security/digest/md5/md5MessageDigest.hpp
+++ b/vmime/security/digest/md5/md5MessageDigest.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/digest/messageDigest.hpp b/vmime/security/digest/messageDigest.hpp
index 95c3b2b..9e432c7 100644
--- a/vmime/security/digest/messageDigest.hpp
+++ b/vmime/security/digest/messageDigest.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/digest/messageDigestFactory.hpp b/vmime/security/digest/messageDigestFactory.hpp
index 54d6d76..763d5fa 100644
--- a/vmime/security/digest/messageDigestFactory.hpp
+++ b/vmime/security/digest/messageDigestFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/digest/sha1/sha1MessageDigest.hpp b/vmime/security/digest/sha1/sha1MessageDigest.hpp
index 129db80..906009a 100644
--- a/vmime/security/digest/sha1/sha1MessageDigest.hpp
+++ b/vmime/security/digest/sha1/sha1MessageDigest.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLAuthenticator.hpp b/vmime/security/sasl/SASLAuthenticator.hpp
index 76e1c5d..daa090a 100644
--- a/vmime/security/sasl/SASLAuthenticator.hpp
+++ b/vmime/security/sasl/SASLAuthenticator.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLContext.hpp b/vmime/security/sasl/SASLContext.hpp
index e1d2de4..7703ab1 100644
--- a/vmime/security/sasl/SASLContext.hpp
+++ b/vmime/security/sasl/SASLContext.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLMechanism.hpp b/vmime/security/sasl/SASLMechanism.hpp
index 3283831..dbb7cd2 100644
--- a/vmime/security/sasl/SASLMechanism.hpp
+++ b/vmime/security/sasl/SASLMechanism.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLMechanismFactory.hpp b/vmime/security/sasl/SASLMechanismFactory.hpp
index 13d0efd..7b86061 100644
--- a/vmime/security/sasl/SASLMechanismFactory.hpp
+++ b/vmime/security/sasl/SASLMechanismFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLSession.hpp b/vmime/security/sasl/SASLSession.hpp
index 8c9eca6..79acfa9 100644
--- a/vmime/security/sasl/SASLSession.hpp
+++ b/vmime/security/sasl/SASLSession.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/SASLSocket.hpp b/vmime/security/sasl/SASLSocket.hpp
index fc6fc39..3ff27e3 100644
--- a/vmime/security/sasl/SASLSocket.hpp
+++ b/vmime/security/sasl/SASLSocket.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/builtinSASLMechanism.hpp b/vmime/security/sasl/builtinSASLMechanism.hpp
index a1ea531..ac7421c 100644
--- a/vmime/security/sasl/builtinSASLMechanism.hpp
+++ b/vmime/security/sasl/builtinSASLMechanism.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/security/sasl/defaultSASLAuthenticator.hpp b/vmime/security/sasl/defaultSASLAuthenticator.hpp
index 0b1c06e..a896b65 100644
--- a/vmime/security/sasl/defaultSASLAuthenticator.hpp
+++ b/vmime/security/sasl/defaultSASLAuthenticator.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/streamContentHandler.hpp b/vmime/streamContentHandler.hpp
index b9e8e97..aa62b2f 100644
--- a/vmime/streamContentHandler.hpp
+++ b/vmime/streamContentHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/stringContentHandler.hpp b/vmime/stringContentHandler.hpp
index 0e7d1e3..8d36889 100644
--- a/vmime/stringContentHandler.hpp
+++ b/vmime/stringContentHandler.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/text.hpp b/vmime/text.hpp
index 34427b5..dd4534d 100644
--- a/vmime/text.hpp
+++ b/vmime/text.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/textPart.hpp b/vmime/textPart.hpp
index 1e8a485..acd9fb3 100644
--- a/vmime/textPart.hpp
+++ b/vmime/textPart.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/textPartFactory.hpp b/vmime/textPartFactory.hpp
index 89e48e3..3650293 100644
--- a/vmime/textPartFactory.hpp
+++ b/vmime/textPartFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/types.hpp b/vmime/types.hpp
index de02192..bdf627e 100644
--- a/vmime/types.hpp
+++ b/vmime/types.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/childProcess.hpp b/vmime/utility/childProcess.hpp
index b4bc257..33cb633 100644
--- a/vmime/utility/childProcess.hpp
+++ b/vmime/utility/childProcess.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/datetimeUtils.hpp b/vmime/utility/datetimeUtils.hpp
index 23d1a96..b56533c 100644
--- a/vmime/utility/datetimeUtils.hpp
+++ b/vmime/utility/datetimeUtils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/b64Encoder.hpp b/vmime/utility/encoder/b64Encoder.hpp
index 831e9f6..6a3a3c6 100644
--- a/vmime/utility/encoder/b64Encoder.hpp
+++ b/vmime/utility/encoder/b64Encoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/binaryEncoder.hpp b/vmime/utility/encoder/binaryEncoder.hpp
index 783f831..02ff794 100644
--- a/vmime/utility/encoder/binaryEncoder.hpp
+++ b/vmime/utility/encoder/binaryEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/defaultEncoder.hpp b/vmime/utility/encoder/defaultEncoder.hpp
index 3ddad1f..daba3ee 100644
--- a/vmime/utility/encoder/defaultEncoder.hpp
+++ b/vmime/utility/encoder/defaultEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/eightBitEncoder.hpp b/vmime/utility/encoder/eightBitEncoder.hpp
index 2e9b138..2de002f 100644
--- a/vmime/utility/encoder/eightBitEncoder.hpp
+++ b/vmime/utility/encoder/eightBitEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/encoder.hpp b/vmime/utility/encoder/encoder.hpp
index eec0003..49f3c30 100644
--- a/vmime/utility/encoder/encoder.hpp
+++ b/vmime/utility/encoder/encoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/encoderFactory.hpp b/vmime/utility/encoder/encoderFactory.hpp
index 22f28f4..6abb223 100644
--- a/vmime/utility/encoder/encoderFactory.hpp
+++ b/vmime/utility/encoder/encoderFactory.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/qpEncoder.hpp b/vmime/utility/encoder/qpEncoder.hpp
index 6af3c90..098b4c8 100644
--- a/vmime/utility/encoder/qpEncoder.hpp
+++ b/vmime/utility/encoder/qpEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/sevenBitEncoder.hpp b/vmime/utility/encoder/sevenBitEncoder.hpp
index 98a999a..2f4870d 100644
--- a/vmime/utility/encoder/sevenBitEncoder.hpp
+++ b/vmime/utility/encoder/sevenBitEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/encoder/uuEncoder.hpp b/vmime/utility/encoder/uuEncoder.hpp
index 6cb5fa1..6289ae0 100644
--- a/vmime/utility/encoder/uuEncoder.hpp
+++ b/vmime/utility/encoder/uuEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/file.hpp b/vmime/utility/file.hpp
index 390c4f4..61ede80 100644
--- a/vmime/utility/file.hpp
+++ b/vmime/utility/file.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/filteredStream.hpp b/vmime/utility/filteredStream.hpp
index 1e03697..00be785 100644
--- a/vmime/utility/filteredStream.hpp
+++ b/vmime/utility/filteredStream.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/path.hpp b/vmime/utility/path.hpp
index c4aed26..e43291c 100644
--- a/vmime/utility/path.hpp
+++ b/vmime/utility/path.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/progressListener.hpp b/vmime/utility/progressListener.hpp
index f26599d..39b884a 100644
--- a/vmime/utility/progressListener.hpp
+++ b/vmime/utility/progressListener.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/random.hpp b/vmime/utility/random.hpp
index 1db15f5..f706c55 100644
--- a/vmime/utility/random.hpp
+++ b/vmime/utility/random.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/smartPtr.hpp b/vmime/utility/smartPtr.hpp
index d2a78a6..c448632 100644
--- a/vmime/utility/smartPtr.hpp
+++ b/vmime/utility/smartPtr.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/smartPtrInt.hpp b/vmime/utility/smartPtrInt.hpp
index a7c7345..453c00e 100644
--- a/vmime/utility/smartPtrInt.hpp
+++ b/vmime/utility/smartPtrInt.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/stream.hpp b/vmime/utility/stream.hpp
index 5f7bfa2..1faab55 100644
--- a/vmime/utility/stream.hpp
+++ b/vmime/utility/stream.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/stringProxy.hpp b/vmime/utility/stringProxy.hpp
index d080e67..21c65ea 100644
--- a/vmime/utility/stringProxy.hpp
+++ b/vmime/utility/stringProxy.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/stringUtils.hpp b/vmime/utility/stringUtils.hpp
index 89fd386..b6589db 100644
--- a/vmime/utility/stringUtils.hpp
+++ b/vmime/utility/stringUtils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/url.hpp b/vmime/utility/url.hpp
index 99585b1..7537428 100644
--- a/vmime/utility/url.hpp
+++ b/vmime/utility/url.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/utility/urlUtils.hpp b/vmime/utility/urlUtils.hpp
index 3d2955a..ba0fbf6 100644
--- a/vmime/utility/urlUtils.hpp
+++ b/vmime/utility/urlUtils.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/vmime.hpp b/vmime/vmime.hpp
index 0e54d7b..f187b9e 100644
--- a/vmime/vmime.hpp
+++ b/vmime/vmime.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/word.hpp b/vmime/word.hpp
index 14f8b0e..d787073 100644
--- a/vmime/word.hpp
+++ b/vmime/word.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,
diff --git a/vmime/wordEncoder.hpp b/vmime/wordEncoder.hpp
index 09c141d..17ca808 100644
--- a/vmime/wordEncoder.hpp
+++ b/vmime/wordEncoder.hpp
@@ -1,10 +1,10 @@
 //
 // VMime library (http://www.vmime.org)
-// Copyright (C) 2002-2008 Vincent Richard <vincent@vincent-richard.net>
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
+// published by the Free Software Foundation; either version 3 of
 // the License, or (at your option) any later version.
 //
 // This program is distributed in the hope that it will be useful,

commit cc633d7aafc1736a866c34ffda272842fe6a154c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Sep 14 15:07:06 2009 +0000

    Added workaround for Decider() for legacy versions of SCons.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@503 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 2e86832..89b58f6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -439,7 +439,11 @@ EnsureSConsVersion(0, 94)
 
 SetOption('implicit_cache', 1)
 
-Decider('MD5-timestamp')
+try:
+	Decider('MD5-timestamp')
+except:
+	SourceSignatures('MD5')
+	TargetSignatures('build')
 
 
 #############

commit 1fade7261d02652f39ffc70fdf29cfad02244732
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Sep 15 19:36:03 2009 +0000

    Fixed possible segfault (thanks to John van der Kamp, from Zarafa).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@504 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp
index d619554..a70372f 100644
--- a/src/messageBuilder.cpp
+++ b/src/messageBuilder.cpp
@@ -142,6 +142,9 @@ ref <message> messageBuilder::construct() const
 	{
 		const bodyPart& part = *msg->getBody()->getPartAt(0);
 
+		// Make a full copy of the body, otherwise the copyFrom() will delete the body we're copying
+		ref <body> bodyCopy = part.getBody()->clone().dynamicCast <body>();
+
 		// First, copy (and replace) the header fields
 		const std::vector <ref <const headerField> > fields = part.getHeader()->getFieldList();
 
@@ -153,7 +156,7 @@ ref <message> messageBuilder::construct() const
 
 		// Second, copy the body contents and sub-parts (this also remove
 		// the body part we are copying...)
-		msg->getBody()->copyFrom(*part.getBody());
+		msg->getBody()->copyFrom(*bodyCopy);
 	}
 
 	return (msg);

commit df1b82b80f63d1e4c6f30f8be03dd4b3e859b341
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Nov 3 12:37:51 2009 +0000

    Fixed possible segfault (thanks to László Vadócz).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@505 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/stringUtils.cpp b/src/utility/stringUtils.cpp
index 03b2057..abae8f9 100644
--- a/src/utility/stringUtils.cpp
+++ b/src/utility/stringUtils.cpp
@@ -142,7 +142,7 @@ string::size_type stringUtils::countASCIIchars
 	{
 		if (parserHelpers::isAscii(*i))
 		{
-			if (*i != '=' || *(i + 1) != '?') // To avoid bad behaviour...
+			if (*i != '=' || ((i + 1) != end && *(i + 1) != '?')) // To avoid bad behaviour...
 				++count;
 		}
 	}

commit 8391dcfb8e65645d473a0a67e3f5c860d30817b7
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Nov 3 14:17:55 2009 +0000

    Reset EOF flag when stream is reset.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@506 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 4ec2ef3..7ee9f19 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -188,6 +188,8 @@ void posixFileReaderInputStream::reset()
 {
 	if (::lseek(m_fd, 0, SEEK_SET) == off_t(-1))
 		posixFileSystemFactory::reportError(m_path, errno);
+
+	m_eof = false;
 }
 
 
@@ -199,7 +201,7 @@ vmime::utility::stream::size_type posixFileReaderInputStream::read
 	if ((c = ::read(m_fd, data, count)) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
 
-	if (c == 0)
+	if (c == 0 && count != 0)
 		m_eof = true;
 
 	return static_cast <size_type>(c);

commit 746d6ccc4c9a8c2387f3d4311d7b4c670d8f5e8b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Nov 4 12:52:49 2009 +0000

    Removed some unnecessary consts on integral types where overrides conflict. Added <cctype> to get the std::isspace that doesn't require a 2nd arg 'locale' (thanks to Ben Jackson).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@507 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 5412a3b..82c5696 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -464,7 +464,7 @@ void windowsFileReaderInputStream::reset()
 	SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN);
 }
 
-const vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type* const data, const size_type count)
+vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type* const data, const size_type count)
 {
 	DWORD dwBytesRead;
 	if (!ReadFile(m_hFile, (LPVOID)data, (DWORD)count, &dwBytesRead, NULL))
@@ -472,7 +472,7 @@ const vmime::utility::stream::size_type windowsFileReaderInputStream::read(value
 	return dwBytesRead;
 }
 
-const vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_type count)
+vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_type count)
 {
 	DWORD dwCurPos = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT);
 	DWORD dwNewPos = SetFilePointer(m_hFile, (LONG)count, NULL, FILE_CURRENT);
diff --git a/vmime/base.hpp b/vmime/base.hpp
index ad00d3f..ce544e1 100644
--- a/vmime/base.hpp
+++ b/vmime/base.hpp
@@ -29,6 +29,7 @@
 #include <vector>
 #include <map>
 #include <sstream>
+#include <cctype>
 #include <locale>
 
 #include "vmime/config.hpp"
diff --git a/vmime/platforms/windows/windowsFile.hpp b/vmime/platforms/windows/windowsFile.hpp
index a2a9e92..6e1c8fb 100644
--- a/vmime/platforms/windows/windowsFile.hpp
+++ b/vmime/platforms/windows/windowsFile.hpp
@@ -73,7 +73,7 @@ public:
 	bool canRead() const;
 	bool canWrite() const;
 
-	const length_type getLength();
+	length_type getLength();
 
 	const path& getFullPath() const;
 

commit eba83b2cb02ef40da3fa519fac6255735cf980b5
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Nov 4 14:12:06 2009 +0000

    Auto-detect filename. Renamed 'filename' argument to 'filepath' for disambiguity. Added constructor for input stream. Use 'word' instead of 'string' for filename.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@508 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index e643491..da7c4b7 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -31,48 +31,93 @@
 
 #include "vmime/contentDispositionField.hpp"
 
+#include "vmime/platform.hpp"
+#include "vmime/utility/file.hpp"
+
 
 namespace vmime
 {
 
 
-fileAttachment::fileAttachment(const string& filename, const mediaType& type)
+fileAttachment::fileAttachment(const string& filepath, const mediaType& type)
 {
 	m_type = type;
 
-	setData(filename);
+	setData(filepath);
 
 	m_encoding = encoding::decide(m_data);
 }
 
 
-fileAttachment::fileAttachment(const string& filename, const mediaType& type, const text& desc)
+fileAttachment::fileAttachment(const string& filepath, const mediaType& type, const text& desc)
 {
 	m_type = type;
 	m_desc = desc;
 
-	setData(filename);
+	setData(filepath);
 
 	m_encoding = encoding::decide(m_data);
 }
 
 
-fileAttachment::fileAttachment(const string& filename, const mediaType& type,
+fileAttachment::fileAttachment(const string& filepath, const mediaType& type,
 	const text& desc, const encoding& enc)
 {
 	m_type = type;
 	m_desc = desc;
 
-	setData(filename);
+	setData(filepath);
+
+	m_encoding = enc;
+}
+
+
+fileAttachment::fileAttachment(ref <utility::inputStream> is, const word& filename, const mediaType& type)
+{
+	if (!filename.isEmpty())
+		m_fileInfo.setFilename(filename);
+
+	m_type = type;
+
+	setData(is);
+
+	m_encoding = encoding::decide(m_data);
+}
+
+
+fileAttachment::fileAttachment(ref <utility::inputStream> is, const word& filename,
+	const mediaType& type, const text& desc)
+{
+	if (!filename.isEmpty())
+		m_fileInfo.setFilename(filename);
+
+	m_type = type;
+	m_desc = desc;
+
+	setData(is);
+
+	m_encoding = encoding::decide(m_data);
+}
+
+
+fileAttachment::fileAttachment(ref <utility::inputStream> is, const word& filename,
+	const mediaType& type, const text& desc, const encoding& enc)
+{
+	if (!filename.isEmpty())
+		m_fileInfo.setFilename(filename);
 
+	m_type = type;
+	m_desc = desc;
 	m_encoding = enc;
+
+	setData(is);
 }
 
 
-void fileAttachment::setData(const string& filename)
+void fileAttachment::setData(const string& filepath)
 {
 	std::ifstream* file = new std::ifstream();
-	file->open(filename.c_str(), std::ios::in | std::ios::binary);
+	file->open(filepath.c_str(), std::ios::in | std::ios::binary);
 
 	if (!*file)
 	{
@@ -82,6 +127,15 @@ void fileAttachment::setData(const string& filename)
 
 	ref <utility::inputStream> is = vmime::create <utility::inputStreamPointerAdapter>(file, true);
 
+	setData(is);
+
+	utility::file::path path = platform::getHandler()->getFileSystemFactory()->stringToPath(filepath);
+	m_fileInfo.setFilename(path.getLastComponent());
+}
+
+
+void fileAttachment::setData(ref <utility::inputStream> is)
+{
 	m_data = vmime::create <streamContentHandler>(is, 0);
 }
 
@@ -94,7 +148,7 @@ void fileAttachment::generatePart(ref <bodyPart> part) const
 		dynamicCast <contentDispositionField>();
 
 	if (m_fileInfo.hasSize()) cdf->setSize(utility::stringUtils::toString(m_fileInfo.getSize()));
-	if (m_fileInfo.hasFilename()) cdf->setFilename(m_fileInfo.getFilename());
+	if (m_fileInfo.hasFilename() && !m_fileInfo.getFilename().isEmpty()) cdf->setFilename(m_fileInfo.getFilename());
 	if (m_fileInfo.hasCreationDate()) cdf->setCreationDate(m_fileInfo.getCreationDate());
 	if (m_fileInfo.hasModificationDate()) cdf->setModificationDate(m_fileInfo.getModificationDate());
 	if (m_fileInfo.hasReadDate()) cdf->setReadDate(m_fileInfo.getReadDate());
@@ -134,8 +188,9 @@ fileAttachment::fileInfo::~fileInfo()
 }
 
 bool fileAttachment::fileInfo::hasFilename() const { return (m_filename != NULL); }
-const string& fileAttachment::fileInfo::getFilename() const { return (*m_filename); }
-void fileAttachment::fileInfo::setFilename(const string& name) { if (m_filename) { *m_filename = name; } else { m_filename = new string(name); } }
+const word& fileAttachment::fileInfo::getFilename() const { return (*m_filename); }
+void fileAttachment::fileInfo::setFilename(const string& name) { if (m_filename) { *m_filename = name; } else { m_filename = new word(name); } }
+void fileAttachment::fileInfo::setFilename(const word& name) { if (m_filename) { *m_filename = name; } else { m_filename = new word(name); } }
 
 bool fileAttachment::fileInfo::hasCreationDate() const { return (m_creationDate != NULL); }
 const datetime& fileAttachment::fileInfo::getCreationDate() const { return (*m_creationDate); }
diff --git a/src/word.cpp b/src/word.cpp
index 958c33e..ce5ddfc 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -699,6 +699,12 @@ string& word::getBuffer()
 }
 
 
+bool word::isEmpty() const
+{
+	return m_buffer.empty();
+}
+
+
 void word::setBuffer(const string& buffer)
 {
 	m_buffer = buffer;
diff --git a/vmime/fileAttachment.hpp b/vmime/fileAttachment.hpp
index 0662c8e..1516a9d 100644
--- a/vmime/fileAttachment.hpp
+++ b/vmime/fileAttachment.hpp
@@ -41,9 +41,13 @@ class fileAttachment : public defaultAttachment
 {
 public:
 
-	fileAttachment(const string& filename, const mediaType& type);
-	fileAttachment(const string& filename, const mediaType& type, const text& desc);
-	fileAttachment(const string& filename, const mediaType& type, const text& desc, const encoding& enc);
+	fileAttachment(const string& filepath, const mediaType& type);
+	fileAttachment(const string& filepath, const mediaType& type, const text& desc);
+	fileAttachment(const string& filepath, const mediaType& type, const text& desc, const encoding& enc);
+
+	fileAttachment(ref <utility::inputStream> is, const word& filename, const mediaType& type);
+	fileAttachment(ref <utility::inputStream> is, const word& filename, const mediaType& type, const text& desc);
+	fileAttachment(ref <utility::inputStream> is, const word& filename, const mediaType& type, const text& desc, const encoding& enc);
 
 	/** Stores information about a file attachment.
 	  */
@@ -65,7 +69,7 @@ public:
 		  *
 		  * @return file name
 		  */
-		const string& getFilename() const;
+		const word& getFilename() const;
 
 		/** Set the value of the 'filename' property.
 		  *
@@ -73,6 +77,12 @@ public:
 		  */
 		void setFilename(const string& name);
 
+		/** Set the value of the 'filename' property.
+		  *
+		  * @param name file name
+		  */
+		void setFilename(const word& name);
+
 		/** Check whether the 'creation-date' property is present.
 		  *
 		  * @return true if the 'creation-date' property is set,
@@ -151,7 +161,7 @@ public:
 
 	private:
 
-		string* m_filename;
+		word* m_filename;
 		unsigned int* m_size;
 		datetime* m_creationDate;
 		datetime* m_modifDate;
@@ -163,7 +173,8 @@ public:
 
 private:
 
-	void setData(const string& filename);
+	void setData(const string& filepath);
+	void setData(ref <utility::inputStream> is);
 
 	fileInfo m_fileInfo;
 
diff --git a/vmime/word.hpp b/vmime/word.hpp
index d787073..78a88e8 100644
--- a/vmime/word.hpp
+++ b/vmime/word.hpp
@@ -60,6 +60,12 @@ public:
 	  */
 	string& getBuffer();
 
+	/** Tests whether this word is empty.
+	  *
+	  * @return true if the buffer is empty, false otherwise
+	  */
+	bool isEmpty() const;
+
 	/** Set the raw data for this encoded word.
 	  *
 	  * @param buffer raw data buffer

commit ef738c99e183fe0452394f4f58441cbf0297a7d0
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Nov 12 15:40:56 2009 +0000

    Quote mailbox name instead of encoding it whenever it's possible.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@509 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index 2f62521..f6df516 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -415,7 +415,7 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
 		bool newLine = true;
 
 		m_name.encodeAndFold(os, maxLineLength, pos, &pos,
-			forceEncode ? text::FORCE_ENCODING : 0);
+			text::QUOTE_IF_POSSIBLE | (forceEncode ? text::FORCE_ENCODING : 0));
 
 		if (pos + m_email.length() + 3 > maxLineLength)
 		{
diff --git a/src/word.cpp b/src/word.cpp
index ce5ddfc..ea8244a 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -352,10 +352,22 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 		noEncoding = false;
 	}
 
-	if (noEncoding)
+	// If possible and requested (with flag), quote the buffer (no folding is performed).
+	// Quoting is possible if and only if:
+	//  - the whole buffer is ASCII-only
+	//  - the buffer does not contain quoting character (")
+	//  - there is enough remaining space on the current line to hold the whole buffer
+	if ((flags & text::QUOTE_IF_POSSIBLE) &&
+	    asciiCount == m_buffer.length() &&
+	    m_buffer.find('"') == string::npos &&
+	    (curLineLength + 2 /* 2 x " */ + m_buffer.length()) < maxLineLength)
+	{
+		os << '"' << m_buffer << '"';
+		curLineLength += 2 + m_buffer.length();
+	}
+	// We will fold lines without encoding them.
+	else if (noEncoding)
 	{
-		// We will fold lines without encoding them.
-
 		string::const_iterator lastWSpos = m_buffer.end(); // last white-space position
 		string::const_iterator curLineStart = m_buffer.begin(); // current line start
 
diff --git a/vmime/text.hpp b/vmime/text.hpp
index dd4534d..9760c48 100644
--- a/vmime/text.hpp
+++ b/vmime/text.hpp
@@ -197,7 +197,8 @@ public:
 
 		FORCE_NO_ENCODING = (1 << 0),    /**< Just fold lines, don't encode them. */
 		FORCE_ENCODING = (1 << 1),       /**< Encode lines even if they are plain ASCII text. */
-		NO_NEW_LINE_SEQUENCE = (1 << 2)  /**< Use CRLF instead of new-line sequence (CRLF + TAB). */
+		NO_NEW_LINE_SEQUENCE = (1 << 2), /**< Use CRLF instead of new-line sequence (CRLF + TAB). */
+		QUOTE_IF_POSSIBLE = (1 << 3)     /**< Use quoting instead of encoding when possible (even if FORCE_ENCODING is specified). */
 	};
 
 	/** Encode and fold text in respect to RFC-2047.

commit 71e41f1d41ff1f87654e03a5e1247e30311677c2
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Nov 30 13:04:15 2009 +0000

    Added block size on sockets to allow different buffer size for SSL.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@510 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index c3ee574..6e5a265 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -718,6 +718,12 @@ ref <session> IMAPConnection::getSession()
 }
 
 
+ref <const socket> IMAPConnection::getSocket() const
+{
+	return m_socket;
+}
+
+
 } // imap
 } // net
 } // vmime
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index c06a8d4..0122d21 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -1284,7 +1284,11 @@ void IMAPFolder::addMessage(utility::inputStream& is, const int size, const int
 	if (progress)
 		progress->start(total);
 
-	char buffer[65536];
+      const socket::size_type blockSize = std::min(is.getBlockSize(),
+		static_cast <size_t>(m_connection->getSocket()->getBlockSize()));
+
+	std::vector <char> vbuffer(blockSize);
+	char* buffer = &vbuffer.front();
 
 	while (!is.eof())
 	{
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index c2f91f6..dab0338 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -90,6 +90,12 @@ bool TLSSocket::isConnected() const
 }
 
 
+TLSSocket::size_type TLSSocket::getBlockSize() const
+{
+	return 16384;  // 16 KB
+}
+
+
 void TLSSocket::receive(string& buffer)
 {
 	const int size = receiveRaw(m_buffer, sizeof(m_buffer));
@@ -103,7 +109,7 @@ void TLSSocket::send(const string& buffer)
 }
 
 
-int TLSSocket::receiveRaw(char* buffer, const int count)
+TLSSocket::size_type TLSSocket::receiveRaw(char* buffer, const size_type count)
 {
 	const ssize_t ret = gnutls_record_recv
 		(*m_session->m_gnutlsSession,
@@ -124,7 +130,7 @@ int TLSSocket::receiveRaw(char* buffer, const int count)
 }
 
 
-void TLSSocket::sendRaw(const char* buffer, const int count)
+void TLSSocket::sendRaw(const char* buffer, const size_type count)
 {
 	gnutls_record_send
 		(*m_session->m_gnutlsSession,
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index 6740995..807ec47 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -217,6 +217,12 @@ void posixSocket::disconnect()
 }
 
 
+posixSocket::size_type posixSocket::getBlockSize() const
+{
+	return 16384;  // 16 KB
+}
+
+
 void posixSocket::receive(vmime::string& buffer)
 {
 	const int size = receiveRaw(m_buffer, sizeof(m_buffer));
@@ -224,7 +230,7 @@ void posixSocket::receive(vmime::string& buffer)
 }
 
 
-int posixSocket::receiveRaw(char* buffer, const int count)
+posixSocket::size_type posixSocket::receiveRaw(char* buffer, const size_type count)
 {
 	const int ret = ::recv(m_desc, buffer, count, 0);
 
@@ -252,9 +258,9 @@ void posixSocket::send(const vmime::string& buffer)
 }
 
 
-void posixSocket::sendRaw(const char* buffer, const int count)
+void posixSocket::sendRaw(const char* buffer, const size_type count)
 {
-	int size = count;
+	size_type size = count;
 
 	while (size > 0)
 	{
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 8a42583..3ff9ad5 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -121,6 +121,12 @@ void windowsSocket::disconnect()
 }
 
 
+windowsSocket::size_type windowsSocket::getBlockSize() const
+{
+	return 16384;  // 16 KB
+}
+
+
 void windowsSocket::receive(vmime::string& buffer)
 {
 	int ret = ::recv(m_desc, m_buffer, sizeof(m_buffer), 0);
@@ -137,7 +143,7 @@ void windowsSocket::receive(vmime::string& buffer)
 }
 
 
-int windowsSocket::receiveRaw(char* buffer, const int count)
+windowsSocket::size_type windowsSocket::receiveRaw(char* buffer, const size_type count)
 {
 	int ret = ::recv(m_desc, buffer, count, 0);
 
@@ -159,7 +165,7 @@ void windowsSocket::send(const vmime::string& buffer)
 }
 
 
-void windowsSocket::sendRaw(const char* buffer, const int count)
+void windowsSocket::sendRaw(const char* buffer, const size_type count)
 {
 	::send(m_desc, buffer, count, 0);
 }
diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp
index 118429a..d88153e 100644
--- a/src/security/sasl/SASLSocket.cpp
+++ b/src/security/sasl/SASLSocket.cpp
@@ -69,6 +69,12 @@ bool SASLSocket::isConnected() const
 }
 
 
+SASLSocket::size_type SASLSocket::getBlockSize() const
+{
+	return m_wrapped->getBlockSize();
+}
+
+
 void SASLSocket::receive(string& buffer)
 {
 	const int n = receiveRaw(m_recvBuffer, sizeof(m_recvBuffer));
@@ -77,7 +83,7 @@ void SASLSocket::receive(string& buffer)
 }
 
 
-int SASLSocket::receiveRaw(char* buffer, const int count)
+SASLSocket::size_type SASLSocket::receiveRaw(char* buffer, const size_type count)
 {
 	if (m_pendingLen != 0)
 	{
@@ -141,7 +147,7 @@ void SASLSocket::send(const string& buffer)
 }
 
 
-void SASLSocket::sendRaw(const char* buffer, const int count)
+void SASLSocket::sendRaw(const char* buffer, const size_type count)
 {
 	byte_t* output = 0;
 	int outputLen = 0;
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp
index 483784c..ec30b7d 100644
--- a/src/utility/stream.cpp
+++ b/src/utility/stream.cpp
@@ -470,7 +470,7 @@ void outputStreamSocketAdapter::flush()
 
 stream::size_type outputStreamSocketAdapter::getBlockSize()
 {
-	return 16384;  // 16 KB
+	return m_socket.getBlockSize();
 }
 
 
@@ -513,7 +513,7 @@ stream::size_type inputStreamSocketAdapter::skip
 
 stream::size_type inputStreamSocketAdapter::getBlockSize()
 {
-	return 16384;  // 16 KB
+	return m_socket.getBlockSize();
 }
 
 
diff --git a/vmime/net/imap/IMAPConnection.hpp b/vmime/net/imap/IMAPConnection.hpp
index 147c4df..820987b 100644
--- a/vmime/net/imap/IMAPConnection.hpp
+++ b/vmime/net/imap/IMAPConnection.hpp
@@ -96,6 +96,8 @@ public:
 	bool isSecuredConnection() const;
 	ref <connectionInfos> getConnectionInfos() const;
 
+	ref <const socket> getSocket() const;
+
 private:
 
 	void authenticate();
diff --git a/vmime/net/socket.hpp b/vmime/net/socket.hpp
index 9b0319c..ec6a9d3 100644
--- a/vmime/net/socket.hpp
+++ b/vmime/net/socket.hpp
@@ -41,6 +41,11 @@ public:
 
 	virtual ~socket() { }
 
+	/** Type used for lengths in streams.
+	  */
+	typedef int size_type;
+
+
 	/** Connect to the specified address and port.
 	  *
 	  * @param address server address (this can be a full qualified domain name
@@ -71,7 +76,7 @@ public:
 	  * @param count maximum number of bytes to receive (size of buffer)
 	  * @return number of bytes received/written into output buffer
 	  */
-	virtual int receiveRaw(char* buffer, const int count) = 0;
+	virtual int receiveRaw(char* buffer, const size_type count) = 0;
 
 	/** Send (text) data to the socket.
 	  *
@@ -84,7 +89,14 @@ public:
 	  * @param buffer data to send
 	  * @param count number of bytes to send (size of buffer)
 	  */
-	virtual void sendRaw(const char* buffer, const int count) = 0;
+	virtual void sendRaw(const char* buffer, const size_type count) = 0;
+
+	/** Return the preferred maximum block size when reading
+	  * from or writing to this stream.
+	  *
+	  * @return block size, in bytes
+	  */
+	virtual size_type getBlockSize() const = 0;
 
 protected:
 
diff --git a/vmime/net/tls/TLSSocket.hpp b/vmime/net/tls/TLSSocket.hpp
index 5112550..7c38970 100644
--- a/vmime/net/tls/TLSSocket.hpp
+++ b/vmime/net/tls/TLSSocket.hpp
@@ -84,10 +84,12 @@ public:
 	bool isConnected() const;
 
 	void receive(string& buffer);
-	int receiveRaw(char* buffer, const int count);
+	size_type receiveRaw(char* buffer, const size_type count);
 
 	void send(const string& buffer);
-	void sendRaw(const char* buffer, const int count);
+	void sendRaw(const char* buffer, const size_type count);
+
+	size_type getBlockSize() const;
 
 private:
 
diff --git a/vmime/platforms/posix/posixSocket.hpp b/vmime/platforms/posix/posixSocket.hpp
index 0d0dae6..9cd49d4 100644
--- a/vmime/platforms/posix/posixSocket.hpp
+++ b/vmime/platforms/posix/posixSocket.hpp
@@ -48,10 +48,12 @@ public:
 	void disconnect();
 
 	void receive(vmime::string& buffer);
-	int receiveRaw(char* buffer, const int count);
+	size_type receiveRaw(char* buffer, const size_type count);
 
 	void send(const vmime::string& buffer);
-	void sendRaw(const char* buffer, const int count);
+	void sendRaw(const char* buffer, const size_type count);
+
+	size_type getBlockSize() const;
 
 protected:
 
diff --git a/vmime/platforms/windows/windowsSocket.hpp b/vmime/platforms/windows/windowsSocket.hpp
index 61475c3..2940157 100644
--- a/vmime/platforms/windows/windowsSocket.hpp
+++ b/vmime/platforms/windows/windowsSocket.hpp
@@ -50,10 +50,12 @@ public:
 	void disconnect();
 
 	void receive(vmime::string& buffer);
-	int receiveRaw(char* buffer, const int count);
+	size_type receiveRaw(char* buffer, const size_type count);
 
 	void send(const vmime::string& buffer);
-	void sendRaw(const char* buffer, const int count);
+	void sendRaw(const char* buffer, const size_type count);
+
+	size_type getBlockSize() const;
 
 private:
 
diff --git a/vmime/security/sasl/SASLSocket.hpp b/vmime/security/sasl/SASLSocket.hpp
index 3ff27e3..0348331 100644
--- a/vmime/security/sasl/SASLSocket.hpp
+++ b/vmime/security/sasl/SASLSocket.hpp
@@ -53,10 +53,12 @@ public:
 	bool isConnected() const;
 
 	void receive(string& buffer);
-	int receiveRaw(char* buffer, const int count);
+	size_type receiveRaw(char* buffer, const size_type count);
 
 	void send(const string& buffer);
-	void sendRaw(const char* buffer, const int count);
+	void sendRaw(const char* buffer, const size_type count);
+
+	size_type getBlockSize() const;
 
 private:
 

commit 4e36e8816b57fc2f8b34be327f4b67a0366b6664
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 1 13:23:26 2009 +0000

    Fixed missing function.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@511 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp
index 456b8ad..ee17c92 100644
--- a/tests/testUtils.cpp
+++ b/tests/testUtils.cpp
@@ -51,6 +51,12 @@ bool testSocket::isConnected() const
 }
 
 
+testSocket::size_type testSocket::getBlockSize() const
+{
+	return 16384;
+}
+
+
 void testSocket::receive(vmime::string& buffer)
 {
 	buffer = m_inBuffer;
diff --git a/tests/testUtils.hpp b/tests/testUtils.hpp
index 96daba8..227d1b3 100644
--- a/tests/testUtils.hpp
+++ b/tests/testUtils.hpp
@@ -216,6 +216,8 @@ public:
 	int receiveRaw(char* buffer, const int count);
 	void sendRaw(const char* buffer, const int count);
 
+	size_type getBlockSize() const;
+
 	/** Send data to client.
 	  *
 	  * @buffer data to send

commit fdc04f8dfd184c980b0a34d0297c41b5831edab0
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 1 13:24:38 2009 +0000

    Added and moved tests for RFC-2231.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@512 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp
index fb7a429..6d24438 100644
--- a/tests/parser/parameterTest.cpp
+++ b/tests/parser/parameterTest.cpp
@@ -32,7 +32,9 @@ VMIME_TEST_SUITE_BEGIN
 
 	VMIME_TEST_LIST_BEGIN
 		VMIME_TEST(testParse)
+		VMIME_TEST(testParseRFC2231)
 		VMIME_TEST(testGenerate)
+		VMIME_TEST(testGenerateRFC2231)
 		VMIME_TEST(testNonStandardEncodedParam)
 	VMIME_TEST_LIST_END
 
@@ -134,57 +136,60 @@ VMIME_TEST_SUITE_BEGIN
 		VASSERT_EQ("7.1", 1, p7.getParameterCount());
 		VASSERT_EQ("7.2", "param1", PARAM_NAME(p7, 0));
 		VASSERT_EQ("7.3", "this is a slash: \"\\\"", PARAM_VALUE(p7, 0));
+	}
 
+	void testParseRFC2231()
+	{
 		// Extended parameter with charset specified in more than one
 		// section (this is forbidden by RFC, but is should not fail)
-		parameterizedHeaderField p8;
-		p8.parse("X; param1*0*=charset1'language1'value1;\r\n"
-			 "   param1*1*=charset2'language2'value2;");
+		parameterizedHeaderField p1;
+		p1.parse("X; param1*0*=charset1'language1'value1;\r\n"
+			   "   param1*1*=charset2'language2'value2;");
 
-		VASSERT_EQ("8.1", 1, p8.getParameterCount());
-		VASSERT_EQ("8.2", "param1", PARAM_NAME(p8, 0));
-		VASSERT_EQ("8.3", "charset1", PARAM_CHARSET(p8, 0));
-		VASSERT_EQ("8.4", "value1charset2'language2'value2", PARAM_BUFFER(p8, 0));
+		VASSERT_EQ("1.1", 1, p1.getParameterCount());
+		VASSERT_EQ("1.2", "param1", PARAM_NAME(p1, 0));
+		VASSERT_EQ("1.3", "charset1", PARAM_CHARSET(p1, 0));
+		VASSERT_EQ("1.4", "value1charset2'language2'value2", PARAM_BUFFER(p1, 0));
 
 		// Charset not specified in the first section (that is not encoded),
 		// but specified in the second one (legal)
-		parameterizedHeaderField p9;
-		p9.parse("X; param1*0=value1;\r\n"
-			 "   param1*1*=charset'language'value2;");
+		parameterizedHeaderField p2;
+		p2.parse("X; param1*0=value1;\r\n"
+			   "   param1*1*=charset'language'value2;");
 
-		VASSERT_EQ("9.1", 1, p9.getParameterCount());
-		VASSERT_EQ("9.2", "param1", PARAM_NAME(p9, 0));
-		VASSERT_EQ("9.3", "charset", PARAM_CHARSET(p9, 0));
-		VASSERT_EQ("9.4", "value1value2", PARAM_BUFFER(p9, 0));
+		VASSERT_EQ("2.1", 1, p2.getParameterCount());
+		VASSERT_EQ("2.2", "param1", PARAM_NAME(p2, 0));
+		VASSERT_EQ("2.3", "charset", PARAM_CHARSET(p2, 0));
+		VASSERT_EQ("2.4", "value1value2", PARAM_BUFFER(p2, 0));
 
 		// Characters prefixed with '%' in a simple (not extended) section
 		// should not be decoded
-		parameterizedHeaderField p10;
-		p10.parse("X; param1=val%20ue1");
+		parameterizedHeaderField p3;
+		p3.parse("X; param1=val%20ue1");
 
-		VASSERT_EQ("10.1", 1, p10.getParameterCount());
-		VASSERT_EQ("10.2", "param1", PARAM_NAME(p10, 0));
-		VASSERT_EQ("10.3", "val%20ue1", PARAM_VALUE(p10, 0));
+		VASSERT_EQ("3.1", 1, p3.getParameterCount());
+		VASSERT_EQ("3.2", "param1", PARAM_NAME(p3, 0));
+		VASSERT_EQ("3.3", "val%20ue1", PARAM_VALUE(p3, 0));
 
 		// Multiple sections + charset specified and encoding
-		parameterizedHeaderField p11;
-		p11.parse("X; param1*0*=charset'language'value1a%20;"
-			  "   param1*1*=value1b%20;"
-			  "   param1*2=value1c");
+		parameterizedHeaderField p4;
+		p4.parse("X; param1*0*=charset'language'value1a%20;"
+			   "   param1*1*=value1b%20;"
+			   "   param1*2=value1c");
 
-		VASSERT_EQ("11.1", 1, p11.getParameterCount());
-		VASSERT_EQ("11.2", "param1", PARAM_NAME(p11, 0));
-		VASSERT_EQ("11.3", "charset", PARAM_CHARSET(p11, 0));
-		VASSERT_EQ("11.4", "value1a value1b value1c", PARAM_BUFFER(p11, 0));
+		VASSERT_EQ("4.1", 1, p4.getParameterCount());
+		VASSERT_EQ("4.2", "param1", PARAM_NAME(p4, 0));
+		VASSERT_EQ("4.3", "charset", PARAM_CHARSET(p4, 0));
+		VASSERT_EQ("4.4", "value1a value1b value1c", PARAM_BUFFER(p4, 0));
 
 		// No charset specified: defaults to US-ASCII
-		parameterizedHeaderField p12;
-		p12.parse("X; param1*='language'value1");
+		parameterizedHeaderField p5;
+		p5.parse("X; param1*='language'value1");
 
-		VASSERT_EQ("12.1", 1, p12.getParameterCount());
-		VASSERT_EQ("12.2", "param1", PARAM_NAME(p12, 0));
-		VASSERT_EQ("12.3", "us-ascii", PARAM_CHARSET(p12, 0));
-		VASSERT_EQ("12.4", "value1", PARAM_BUFFER(p12, 0));
+		VASSERT_EQ("5.1", 1, p5.getParameterCount());
+		VASSERT_EQ("5.2", "param1", PARAM_NAME(p5, 0));
+		VASSERT_EQ("5.3", "us-ascii", PARAM_CHARSET(p5, 0));
+		VASSERT_EQ("5.4", "value1", PARAM_BUFFER(p5, 0));
 	}
 
 	void testGenerate()
@@ -206,21 +211,24 @@ VMIME_TEST_SUITE_BEGIN
 		p2b.appendParameter(vmime::create <vmime::parameter>("param1", "va\\lue\"1"));
 
 		VASSERT_EQ("2b", "F: X; param1=\"va\\\\lue\\\"1\"", p2b.generate());
+	}
 
+	void testGenerateRFC2231()
+	{
 		// Extended parameter with charset specifier
-		parameterizedHeaderField p3;
-		p3.appendParameter(vmime::create <vmime::parameter>("param1",
+		parameterizedHeaderField p1;
+		p1.appendParameter(vmime::create <vmime::parameter>("param1",
 			vmime::word("value 1\xe9", vmime::charset("charset"))));
 
-		VASSERT_EQ("3", "F: X; param1=\"value 1\";param1*=charset''value%201%E9", p3.generate());
+		VASSERT_EQ("1", "F: X; param1=\"value 1\";param1*=charset''value%201%E9", p1.generate());
 
 		// Value that spans on multiple lines
-		parameterizedHeaderField p4;
-		p4.appendParameter(vmime::create <vmime::parameter>("param1",
+		parameterizedHeaderField p2;
+		p2.appendParameter(vmime::create <vmime::parameter>("param1",
 			vmime::word("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
 				    vmime::charset("charset"))));
 
-		VASSERT_EQ("4", "F: X; \r\n "
+		VASSERT_EQ("2", "F: X; \r\n "
 			"param1=abcdefghijklm;\r\n "
 			"param1*0*=charset''abc;\r\n "
 			"param1*1*=defghijkl;\r\n "
@@ -228,7 +236,23 @@ VMIME_TEST_SUITE_BEGIN
 			"param1*3*=vwxyzABCD;\r\n "
 			"param1*4*=EFGHIJKLM;\r\n "
 			"param1*5*=NOPQRSTUV;\r\n "
-			"param1*6*=WXYZ", p4.generate(25));  // max line length = 25
+			"param1*6*=WXYZ", p2.generate(25));  // max line length = 25
+
+		// Non-ASCII parameter value
+		parameterizedHeaderField p3;
+		p3.appendParameter(vmime::create <vmime::parameter>("param1",
+			vmime::word("δσσσσσσσσσσσσσσσσσσσσδσδα δσαδσδσαδσαδασδασ δσαδασδσα δσαδασδσα δασδασδασ δασαχφδδσα 2008.doc",
+				vmime::charset("utf-8"))));
+
+		VASSERT_EQ("3", "F: X; \r\n "
+			"param1=\"      2008.doc\";param1*0*=utf-8''%CE%B4%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
+			"param1*1*=%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
+			"param1*2*=%CE%B4%CF%83%CE%B4%CE%B1%20%CE%B4%CF%83%CE%B1%CE%B4%CF%83%CE%B4%CF;\r\n "
+			"param1*3*=%83%CE%B1%CE%B4%CF%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CE%B1%CF%83%20;\r\n "
+			"param1*4*=%CE%B4%CF%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CF%83%CE%B1%20%CE%B4%CF;\r\n "
+			"param1*5*=%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CF%83%CE%B1%20%CE%B4%CE%B1%CF%83;\r\n "
+			"param1*6*=%CE%B4%CE%B1%CF%83%CE%B4%CE%B1%CF%83%20%CE%B4%CE%B1%CF%83%CE%B1%CF;\r\n "
+			"param1*7*=%87%CF%86%CE%B4%CE%B4%CF%83%CE%B1%202008.doc", p3.generate(80));
 	}
 
 	void testNonStandardEncodedParam()

commit 6687ee18d8364bb3c5da17199abf55213d2fc665
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 1 13:44:34 2009 +0000

    Added option to return ISO week-numbering instead of default calendar-numbering.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@513 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/datetimeUtils.cpp b/src/utility/datetimeUtils.cpp
index cf05a93..6ea5be6 100644
--- a/src/utility/datetimeUtils.cpp
+++ b/src/utility/datetimeUtils.cpp
@@ -256,7 +256,7 @@ int datetimeUtils::getDayOfWeek(const int year, const int month, const int day)
 }
 
 
-int datetimeUtils::getWeekOfYear(const int year, const int month, const int day)
+int datetimeUtils::getWeekOfYear(const int year, const int month, const int day, const bool iso)
 {
 	// Algorithm from http://personal.ecu.edu/mccartyr/ISOwdALG.txt
 
@@ -322,7 +322,7 @@ int datetimeUtils::getWeekOfYear(const int year, const int month, const int day)
 			WeekNumber -= 1;
 	}
 
-	if (WeekNumber == 1 && month == 12)
+	if (!iso && (WeekNumber == 1 && month == 12))
 		WeekNumber = 53;
 
 	return WeekNumber;
diff --git a/tests/utility/datetimeUtilsTest.cpp b/tests/utility/datetimeUtilsTest.cpp
index 4fd3e43..4671e75 100644
--- a/tests/utility/datetimeUtilsTest.cpp
+++ b/tests/utility/datetimeUtilsTest.cpp
@@ -143,10 +143,11 @@ VMIME_TEST_SUITE_BEGIN
 	{
 		VASSERT_EQ("1.1", 52, datetimeUtils::getWeekOfYear(2003, 12, 27));
 		VASSERT_EQ("1.2", 52, datetimeUtils::getWeekOfYear(2003, 12, 28));
-		VASSERT_EQ("1.3",  1, datetimeUtils::getWeekOfYear(2003, 12, 29));
-		VASSERT_EQ("1.4",  1, datetimeUtils::getWeekOfYear(2004,  1,  4));
-		VASSERT_EQ("1.5",  2, datetimeUtils::getWeekOfYear(2004,  1,  5));
-		VASSERT_EQ("1.6",  2, datetimeUtils::getWeekOfYear(2004,  1, 11));
+		VASSERT_EQ("1.3",  1, datetimeUtils::getWeekOfYear(2003, 12, 29, true));
+		VASSERT_EQ("1.4", 53, datetimeUtils::getWeekOfYear(2003, 12, 29, false));
+		VASSERT_EQ("1.5",  1, datetimeUtils::getWeekOfYear(2004,  1,  4));
+		VASSERT_EQ("1.6",  2, datetimeUtils::getWeekOfYear(2004,  1,  5));
+		VASSERT_EQ("1.7",  2, datetimeUtils::getWeekOfYear(2004,  1, 11));
 
 		VASSERT_EQ("2.1", 52, datetimeUtils::getWeekOfYear(2004, 12, 26));
 		VASSERT_EQ("2.2", 53, datetimeUtils::getWeekOfYear(2004, 12, 27));
diff --git a/vmime/utility/datetimeUtils.hpp b/vmime/utility/datetimeUtils.hpp
index b56533c..d5f89be 100644
--- a/vmime/utility/datetimeUtils.hpp
+++ b/vmime/utility/datetimeUtils.hpp
@@ -84,9 +84,11 @@ public:
 	  * @param year year in 4-digit format
 	  * @param month month (1-12), January is 1, December is 12 (see datetime::Months enum)
 	  * @param day month day (1-31)
+	  * @param iso if TRUE, use ISO week-numbering year (default is to use calendar year).
+	  * For more information, read here: http://en.wikipedia.org/wiki/ISO_8601#Week_dates
 	  * @return the week number (1 is the first week of the year)
 	  */
-	static int getWeekOfYear(const int year, const int month, const int day);
+	static int getWeekOfYear(const int year, const int month, const int day, const bool iso = false);
 };
 
 

commit 3b5ccb4334651cc9ba9b99259d44dc9e47d8e22a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 1 14:24:55 2009 +0000

    Fixed directory renaming.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@514 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 7ee9f19..b814b75 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -396,7 +396,11 @@ void posixFile::rename(const path& newName)
 	const vmime::string newNativePath = posixFileSystemFactory::pathToStringImpl(newName);
 
 	posixFile dest(newName);
-	dest.createFile();
+
+	if (isDirectory())
+		dest.createDirectory();
+	else
+		dest.createFile();
 
 	if (::rename(m_nativePath.c_str(), newNativePath.c_str()) == -1)
 		posixFileSystemFactory::reportError(m_path, errno);
diff --git a/tests/net/maildir/maildirStoreTest.cpp b/tests/net/maildir/maildirStoreTest.cpp
index 5aad90b..5f8c703 100644
--- a/tests/net/maildir/maildirStoreTest.cpp
+++ b/tests/net/maildir/maildirStoreTest.cpp
@@ -322,12 +322,28 @@ public:
 
 	void testRenameFolder_KMail()
 	{
-		testRenameFolderImpl(TEST_MAILDIR_KMAIL, TEST_MAILDIRFILES_KMAIL);
+		try
+		{
+			testRenameFolderImpl(TEST_MAILDIR_KMAIL, TEST_MAILDIRFILES_KMAIL);
+		}
+		catch (vmime::exception& e)
+		{
+			std::cerr << e;
+			throw e;
+		}
 	}
 
 	void testRenameFolder_Courier()
 	{
-		testRenameFolderImpl(TEST_MAILDIR_COURIER, TEST_MAILDIRFILES_COURIER);
+		try
+		{
+			testRenameFolderImpl(TEST_MAILDIR_COURIER, TEST_MAILDIRFILES_COURIER);
+		}
+		catch (vmime::exception& e)
+		{
+			std::cerr << e;
+			throw e;
+		}
 	}
 
 	void testRenameFolderImpl(const vmime::string* const dirs, const vmime::string* const files)
diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp
index ee17c92..36455cf 100644
--- a/tests/testUtils.cpp
+++ b/tests/testUtils.cpp
@@ -187,3 +187,61 @@ vmime::ref <vmime::net::timeoutHandler> testTimeoutHandlerFactory::create()
 	return vmime::create <testTimeoutHandler>();
 }
 
+
+
+// Exception helper
+std::ostream& operator<<(std::ostream& os, const vmime::exception& e)
+{
+	os << "* vmime::exceptions::" << e.name() << std::endl;
+	os << "    what = " << e.what() << std::endl;
+
+	// More information for special exceptions
+	if (dynamic_cast <const vmime::exceptions::command_error*>(&e))
+	{
+		const vmime::exceptions::command_error& cee =
+			dynamic_cast <const vmime::exceptions::command_error&>(e);
+
+		os << "    command = " << cee.command() << std::endl;
+		os << "    response = " << cee.response() << std::endl;
+	}
+
+	if (dynamic_cast <const vmime::exceptions::invalid_response*>(&e))
+	{
+		const vmime::exceptions::invalid_response& ir =
+			dynamic_cast <const vmime::exceptions::invalid_response&>(e);
+
+		os << "    response = " << ir.response() << std::endl;
+	}
+
+	if (dynamic_cast <const vmime::exceptions::connection_greeting_error*>(&e))
+	{
+		const vmime::exceptions::connection_greeting_error& cgee =
+			dynamic_cast <const vmime::exceptions::connection_greeting_error&>(e);
+
+		os << "    response = " << cgee.response() << std::endl;
+	}
+
+	if (dynamic_cast <const vmime::exceptions::authentication_error*>(&e))
+	{
+		const vmime::exceptions::authentication_error& aee =
+			dynamic_cast <const vmime::exceptions::authentication_error&>(e);
+
+		os << "    response = " << aee.response() << std::endl;
+	}
+
+	if (dynamic_cast <const vmime::exceptions::filesystem_exception*>(&e))
+	{
+		const vmime::exceptions::filesystem_exception& fse =
+			dynamic_cast <const vmime::exceptions::filesystem_exception&>(e);
+
+		os << "    path = " << vmime::platform::getHandler()->
+			getFileSystemFactory()->pathToString(fse.path()) << std::endl;
+	}
+
+	if (e.other() != NULL)
+		os << *e.other();
+
+	return os;
+}
+
+
diff --git a/tests/testUtils.hpp b/tests/testUtils.hpp
index 227d1b3..9aee153 100644
--- a/tests/testUtils.hpp
+++ b/tests/testUtils.hpp
@@ -305,3 +305,7 @@ public:
 	vmime::ref <vmime::net::timeoutHandler> create();
 };
 
+
+// Exception helper
+std::ostream& operator<<(std::ostream& os, const vmime::exception& e);
+

commit 75b25e29e28fd00ae2e92c28baed98f62838e119
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Dec 2 11:49:00 2009 +0000

    Fixed compilation issue with Intel Compiler (thanks to Eric Trinh for report).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@515 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/vmime/propertySet.hpp b/vmime/propertySet.hpp
index e5cbf1f..e5e91dd 100644
--- a/vmime/propertySet.hpp
+++ b/vmime/propertySet.hpp
@@ -432,7 +432,7 @@ public:
 
 #ifndef VMIME_INLINE_TEMPLATE_SPECIALIZATION
 
-template <> void propertySet::property::setValue(const string& value);
+template <> void propertySet::property::setValue <string>(const string& value);
 template <> void propertySet::property::setValue(const bool& value);
 
 template <> string propertySet::property::getValue() const;

commit e46c5fc23527db2409e872020f0e007f98e13c2d
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 8 09:31:06 2009 +0000

    Initialize multi-threading for GNUTLS/GCrypt (thanks to Bartek Szurgot).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@516 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index 1146d1b..d4eab3e 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -24,6 +24,13 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/extra.h>
 
+#include "vmime/config.hpp"
+
+#if VMIME_HAVE_PTHREAD
+#	include <gcrypt.h>
+#	include <errno.h>
+#endif // VMIME_HAVE_PTHREAD
+
 #include "vmime/net/tls/TLSSession.hpp"
 
 #include "vmime/exception.hpp"
@@ -38,6 +45,14 @@
 #endif // VMIME_DEBUG && GNUTLS_DEBUG
 
 
+#if VMIME_HAVE_PTHREAD && defined(GCRY_THREAD_OPTION_PTHREAD_IMPL)
+extern "C"
+{
+	GCRY_THREAD_OPTION_PTHREAD_IMPL;
+}
+#endif // VMIME_HAVE_PTHREAD && defined(GCRY_THREAD_OPTION_PTHREAD_IMPL
+
+
 namespace vmime {
 namespace net {
 namespace tls {
@@ -50,6 +65,10 @@ struct TLSGlobal
 {
 	TLSGlobal()
 	{
+#if VMIME_HAVE_PTHREAD && defined(GCRY_THREAD_OPTION_PTHREAD_IMPL)
+		gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif // VMIME_HAVE_PTHREAD && defined(GCRY_THREAD_OPTION_PTHREAD_IMPL
+
 		gnutls_global_init();
 		//gnutls_global_init_extra();
 

commit 9e4d59d30924211495daf8c96fa8bb94537a9447
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 8 10:03:34 2009 +0000

    Fixed not exception-safe constructor, which could lead to possible memory leak (thanks to Bartek Szurgot). Get rid of const-ness on factories.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@517 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/AUTHORS b/AUTHORS
index 8391c18..f0b5e2d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,6 +19,7 @@ VMIME CONTRIBUTORS
  - Georg Sauthoff <gsauthof@techfak.uni-bielefeld.de>
  - Pierre Thierry <nowhere.man@levallois.eu.org> (patches for STL algorithms)
  - Zarafa <http://developer.zarafa.com/VmimePatches>
+ - Bartek Szurgot <vempirelord@wp.pl, http://baszerr.org>
 
 Please apologize if I have forgotten someone here.  ;)
 See SVN Changelog for full list.
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 6dbda80..721517e 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -49,7 +49,7 @@ const string courierMaildirFormat::getName() const
 
 void courierMaildirFormat::createFolder(const folder::path& path)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	if (!fsf->isValidPath(folderPathToFileSystemPath(path, ROOT_DIRECTORY)))
 		throw exceptions::invalid_folder_name();
@@ -80,7 +80,7 @@ void courierMaildirFormat::createFolder(const folder::path& path)
 
 void courierMaildirFormat::destroyFolder(const folder::path& path)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	// Recursively delete directories of subfolders
 	const std::vector <folder::path> folders = listFolders(path, true);
@@ -119,7 +119,7 @@ void courierMaildirFormat::renameFolder
 void courierMaildirFormat::renameFolderImpl
 	(const folder::path& oldPath, const folder::path& newPath)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	const utility::file::path oldFSPath =
 		folderPathToFileSystemPath(oldPath, ROOT_DIRECTORY);
@@ -134,7 +134,7 @@ void courierMaildirFormat::renameFolderImpl
 
 bool courierMaildirFormat::folderExists(const folder::path& path) const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(folderPathToFileSystemPath(path, ROOT_DIRECTORY));
@@ -254,7 +254,7 @@ const std::vector <folder::path> courierMaildirFormat::listFolders
 bool courierMaildirFormat::listDirectories(const folder::path& root,
 	std::vector <string>& dirs, const bool onlyTestForExistence) const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(getContext()->getStore()->getFileSystemPath());
@@ -496,7 +496,7 @@ const folder::path::component courierMaildirFormat::fromModifiedUTF7(const strin
 
 bool courierMaildirFormat::supports() const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(getContext()->getStore()->getFileSystemPath());
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index 5fb75fe..a21d106 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -49,7 +49,7 @@ const string kmailMaildirFormat::getName() const
 
 void kmailMaildirFormat::createFolder(const folder::path& path)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	if (!fsf->isValidPath(folderPathToFileSystemPath(path, ROOT_DIRECTORY)))
 		throw exceptions::invalid_folder_name();
@@ -75,7 +75,7 @@ void kmailMaildirFormat::createFolder(const folder::path& path)
 void kmailMaildirFormat::destroyFolder(const folder::path& path)
 {
 	// Delete 'folder' and '.folder.directory' directories
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	maildirUtils::recursiveFSDelete(fsf->create
 		(folderPathToFileSystemPath(path, ROOT_DIRECTORY)));  // root
@@ -87,7 +87,7 @@ void kmailMaildirFormat::destroyFolder(const folder::path& path)
 
 bool kmailMaildirFormat::folderExists(const folder::path& path) const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(folderPathToFileSystemPath(path, ROOT_DIRECTORY));
@@ -177,7 +177,7 @@ const std::vector <folder::path> kmailMaildirFormat::listFolders
 void kmailMaildirFormat::listFoldersImpl
 	(std::vector <folder::path>& list, const folder::path& root, const bool recursive) const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create(folderPathToFileSystemPath(root,
 		root.isEmpty() ? ROOT_DIRECTORY : CONTAINER_DIRECTORY));
@@ -226,7 +226,7 @@ bool kmailMaildirFormat::isSubfolderDirectory(const utility::file& file)
 
 void kmailMaildirFormat::renameFolder(const folder::path& oldPath, const folder::path& newPath)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(folderPathToFileSystemPath(oldPath, ROOT_DIRECTORY));
@@ -277,7 +277,7 @@ void kmailMaildirFormat::renameFolder(const folder::path& oldPath, const folder:
 
 bool kmailMaildirFormat::folderHasSubfolders(const folder::path& path) const
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> rootDir = fsf->create
 		(folderPathToFileSystemPath(path, CONTAINER_DIRECTORY));
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index 3e361ae..dd680c9 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -264,7 +264,7 @@ void maildirFolder::scanFolder()
 		m_messageCount = 0;
 		m_unreadMessageCount = 0;
 
-		utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+		ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 		utility::file::path newDirPath = store->getFormat()->folderPathToFileSystemPath
 			(m_path, maildirFormat::NEW_DIRECTORY);
@@ -760,7 +760,7 @@ void maildirFolder::setMessageFlagsImpl
 {
 	ref <maildirStore> store = m_store.acquire();
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	utility::file::path curDirPath = store->getFormat()->
 		folderPathToFileSystemPath(m_path, maildirFormat::CUR_DIRECTORY);
@@ -832,7 +832,7 @@ void maildirFolder::addMessage(utility::inputStream& is, const int size,
 	else if (m_mode == MODE_READ_ONLY)
 		throw exceptions::illegal_state("Folder is read-only");
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	utility::file::path tmpDirPath = store->getFormat()->
 		folderPathToFileSystemPath(m_path,maildirFormat::TMP_DIRECTORY);
@@ -918,7 +918,7 @@ void maildirFolder::copyMessageImpl(const utility::file::path& tmpDirPath,
 	utility::inputStream& is, const utility::stream::size_type size,
 	utility::progressListener* progress)
 {
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	ref <utility::file> file = fsf->create(tmpDirPath / filename);
 
@@ -1058,7 +1058,7 @@ void maildirFolder::copyMessagesImpl(const folder::path& dest, const std::vector
 {
 	ref <maildirStore> store = m_store.acquire();
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	utility::file::path curDirPath = store->getFormat()->folderPathToFileSystemPath
 		(m_path, maildirFormat::CUR_DIRECTORY);
@@ -1200,7 +1200,7 @@ void maildirFolder::expunge()
 	else if (m_mode == MODE_READ_ONLY)
 		throw exceptions::illegal_state("Folder is read-only");
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	utility::file::path curDirPath = store->getFormat()->
 		folderPathToFileSystemPath(m_path, maildirFormat::CUR_DIRECTORY);
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index ed87cdb..8999d84 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -346,7 +346,7 @@ void maildirMessage::extractImpl(utility::outputStream& os, utility::progressLis
 {
 	ref <const maildirFolder> folder = m_folder.acquire();
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	const utility::file::path path = folder->getMessageFSPath(m_num);
 	ref <utility::file> file = fsf->create(path);
@@ -393,7 +393,7 @@ void maildirMessage::fetchPartHeader(ref <part> p)
 
 	ref <maildirPart> mp = p.dynamicCast <maildirPart>();
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	const utility::file::path path = folder->getMessageFSPath(m_num);
 	ref <utility::file> file = fsf->create(path);
@@ -430,7 +430,7 @@ void maildirMessage::fetch(ref <maildirFolder> msgFolder, const int options)
 	if (folder != msgFolder)
 		throw exceptions::folder_not_found();
 
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	const utility::file::path path = folder->getMessageFSPath(m_num);
 	ref <utility::file> file = fsf->create(path);
diff --git a/src/net/maildir/maildirStore.cpp b/src/net/maildir/maildirStore.cpp
index 3b77024..26f4593 100644
--- a/src/net/maildir/maildirStore.cpp
+++ b/src/net/maildir/maildirStore.cpp
@@ -132,7 +132,7 @@ void maildirStore::connect()
 		throw exceptions::already_connected();
 
 	// Get root directory
-	utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+	ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
 
 	m_fsPath = fsf->stringToPath(GET_PROPERTY(string, PROPERTY_SERVER_ROOTPATH));
 
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index f43972e..104bc40 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -55,18 +55,14 @@ posixHandler::posixHandler()
 	m_socketFactory = vmime::create <posixSocketFactory>();
 #endif
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	m_fileSysFactory = new posixFileSystemFactory();
-	m_childProcFactory = new posixChildProcessFactory();
+	m_fileSysFactory = vmime::create <posixFileSystemFactory>();
+	m_childProcFactory = vmime::create <posixChildProcessFactory>();
 #endif
 }
 
 
 posixHandler::~posixHandler()
 {
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-	delete (m_fileSysFactory);
-	delete (m_childProcFactory);
-#endif
 }
 
 
@@ -173,9 +169,9 @@ unsigned int posixHandler::getProcessId() const
 
 #if VMIME_HAVE_MESSAGING_FEATURES
 
-ref <vmime::net::socketFactory> posixHandler::getSocketFactory() const
+ref <vmime::net::socketFactory> posixHandler::getSocketFactory()
 {
-	return m_socketFactory.dynamicCast <vmime::net::socketFactory>();
+	return m_socketFactory;
 }
 
 #endif
@@ -183,15 +179,15 @@ ref <vmime::net::socketFactory> posixHandler::getSocketFactory() const
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
 
-vmime::utility::fileSystemFactory* posixHandler::getFileSystemFactory() const
+ref <vmime::utility::fileSystemFactory> posixHandler::getFileSystemFactory()
 {
-	return (m_fileSysFactory);
+	return m_fileSysFactory;
 }
 
 
-vmime::utility::childProcessFactory* posixHandler::getChildProcessFactory() const
+ref <vmime::utility::childProcessFactory> posixHandler::getChildProcessFactory()
 {
-	return (m_childProcFactory);
+	return m_childProcFactory;
 }
 
 #endif
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 404d3cb..1a37c83 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -49,17 +49,13 @@ windowsHandler::windowsHandler()
 	m_socketFactory = vmime::create <windowsSocketFactory>();
 #endif
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	m_fileSysFactory = new windowsFileSystemFactory();
+	m_fileSysFactory = vmime::create <windowsFileSystemFactory>();
 #endif
 }
 
 
 windowsHandler::~windowsHandler()
 {
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-	delete (m_fileSysFactory);
-#endif
-
 	WSACleanup();
 }
 
@@ -240,9 +236,9 @@ unsigned int windowsHandler::getProcessId() const
 
 #if VMIME_HAVE_MESSAGING_FEATURES
 
-ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() const
+ref <vmime::net::socketFactory> windowsHandler::getSocketFactory()
 {
-	return m_socketFactory.dynamicCast <vmime::net::socketFactory>();
+	return m_socketFactory;
 }
 
 #endif
@@ -250,13 +246,13 @@ ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() const
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
 
-vmime::utility::fileSystemFactory* windowsHandler::getFileSystemFactory() const
+ref <vmime::utility::fileSystemFactory> windowsHandler::getFileSystemFactory()
 {
-	return (m_fileSysFactory);
+	return m_fileSysFactory;
 }
 
 
-vmime::utility::childProcessFactory* windowsHandler::getChildProcessFactory() const
+ref <vmime::utility::childProcessFactory> windowsHandler::getChildProcessFactory()
 {
 	// TODO: Not implemented
 	return (NULL);
diff --git a/tests/net/maildir/maildirStoreTest.cpp b/tests/net/maildir/maildirStoreTest.cpp
index 5f8c703..3b1980e 100644
--- a/tests/net/maildir/maildirStoreTest.cpp
+++ b/tests/net/maildir/maildirStoreTest.cpp
@@ -501,7 +501,7 @@ private:
 
 	const vmime::utility::url getStoreURL()
 	{
-		vmime::utility::fileSystemFactory* fsf =
+		vmime::ref <vmime::utility::fileSystemFactory> fsf =
 			vmime::platform::getHandler()->getFileSystemFactory();
 
 		vmime::utility::url url(std::string("maildir://localhost")
@@ -512,7 +512,7 @@ private:
 
 	void createMaildir(const vmime::string* const dirs, const vmime::string* const files)
 	{
-		vmime::utility::fileSystemFactory* fsf =
+		vmime::ref <vmime::utility::fileSystemFactory> fsf =
 			vmime::platform::getHandler()->getFileSystemFactory();
 
 		vmime::ref <vmime::utility::file> rootDir = fsf->create(m_tempPath);
@@ -544,7 +544,7 @@ private:
 
 	void destroyMaildir()
 	{
-		vmime::utility::fileSystemFactory* fsf =
+		vmime::ref <vmime::utility::fileSystemFactory> fsf =
 			vmime::platform::getHandler()->getFileSystemFactory();
 
 		recursiveDelete(fsf->create(m_tempPath));
diff --git a/vmime/platform.hpp b/vmime/platform.hpp
index d390571..0281554 100644
--- a/vmime/platform.hpp
+++ b/vmime/platform.hpp
@@ -108,7 +108,7 @@ public:
 		  *
 		  * @return socket factory
 		  */
-		virtual ref <net::socketFactory> getSocketFactory() const = 0;
+		virtual ref <net::socketFactory> getSocketFactory() = 0;
 #endif
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
@@ -116,14 +116,14 @@ public:
 		  *
 		  * @return file-system factory
 		  */
-		virtual utility::fileSystemFactory* getFileSystemFactory() const = 0;
+		virtual ref <utility::fileSystemFactory> getFileSystemFactory() = 0;
 
 		/** Return a pointer to a factory that creates child process objects,
 		  * which are used to spawn processes (run executable files).
 		  *
 		  * @return child process factory
 		  */
-		virtual utility::childProcessFactory* getChildProcessFactory() const = 0;
+		virtual ref <utility::childProcessFactory> getChildProcessFactory() = 0;
 #endif
 
 	};
@@ -135,7 +135,7 @@ public:
 		sm_handler = vmime::create <TYPE>();
 	}
 
-	static ref <const handler> getHandler()
+	static ref <handler> getHandler()
 	{
 		if (!sm_handler)
 			throw exceptions::no_platform_handler();
diff --git a/vmime/platforms/posix/posixHandler.hpp b/vmime/platforms/posix/posixHandler.hpp
index 397a5dd..8e572a2 100644
--- a/vmime/platforms/posix/posixHandler.hpp
+++ b/vmime/platforms/posix/posixHandler.hpp
@@ -61,13 +61,13 @@ public:
 	unsigned int getProcessId() const;
 
 #if VMIME_HAVE_MESSAGING_FEATURES
-	ref <vmime::net::socketFactory> getSocketFactory() const;
+	ref <vmime::net::socketFactory> getSocketFactory();
 #endif
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	vmime::utility::fileSystemFactory* getFileSystemFactory() const;
+	ref <vmime::utility::fileSystemFactory> getFileSystemFactory();
 
-	vmime::utility::childProcessFactory* getChildProcessFactory() const;
+	ref <vmime::utility::childProcessFactory> getChildProcessFactory();
 #endif
 
 	void wait() const;
@@ -79,8 +79,8 @@ private:
 #endif
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	posixFileSystemFactory* m_fileSysFactory;
-	posixChildProcessFactory* m_childProcFactory;
+	ref <posixFileSystemFactory> m_fileSysFactory;
+	ref <posixChildProcessFactory> m_childProcFactory;
 #endif
 };
 
diff --git a/vmime/platforms/windows/windowsHandler.hpp b/vmime/platforms/windows/windowsHandler.hpp
index 701edf0..53df363 100644
--- a/vmime/platforms/windows/windowsHandler.hpp
+++ b/vmime/platforms/windows/windowsHandler.hpp
@@ -60,13 +60,13 @@ public:
 	unsigned int getProcessId() const;
 
 #if VMIME_HAVE_MESSAGING_FEATURES
-	ref <vmime::net::socketFactory> getSocketFactory() const;
+	ref <vmime::net::socketFactory> getSocketFactory();
 #endif
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	vmime::utility::fileSystemFactory* getFileSystemFactory() const;
+	ref <vmime::utility::fileSystemFactory> getFileSystemFactory();
 
-	vmime::utility::childProcessFactory* getChildProcessFactory() const;
+	ref <vmime::utility::childProcessFactory> getChildProcessFactory();
 #endif
 
 	void wait() const;
@@ -78,7 +78,7 @@ private:
 #endif
 
 #if VMIME_HAVE_FILESYSTEM_FEATURES
-	windowsFileSystemFactory* m_fileSysFactory;
+	ref <windowsFileSystemFactory> m_fileSysFactory;
 #endif
 };
 
diff --git a/vmime/utility/childProcess.hpp b/vmime/utility/childProcess.hpp
index 33cb633..b5405f7 100644
--- a/vmime/utility/childProcess.hpp
+++ b/vmime/utility/childProcess.hpp
@@ -85,7 +85,7 @@ public:
 /** Create 'childProcess' objects.
   */
 
-class childProcessFactory
+class childProcessFactory : public object
 {
 public:
 
diff --git a/vmime/utility/file.hpp b/vmime/utility/file.hpp
index 61ede80..f1d877e 100644
--- a/vmime/utility/file.hpp
+++ b/vmime/utility/file.hpp
@@ -214,7 +214,7 @@ private:
 /** Constructs 'file' objects.
   */
 
-class fileSystemFactory
+class fileSystemFactory : public object
 {
 public:
 

commit e2f7eb2eef7de7fd926e1d80e2a108869a839ec4
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Dec 8 10:21:33 2009 +0000

    Fixed non thread-safe getLocalCharset() function (thanks to Bartek Szurgot).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@518 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index 104bc40..2c11307 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -36,6 +36,11 @@
 #include <netdb.h>
 
 #include <string.h>
+#include <cassert>
+
+#if VMIME_HAVE_PTHREAD
+#	include <pthread.h>
+#endif // VMIME_HAVE_PTHREAD
 
 /*
 #ifdef _POSIX_PRIORITY_SCHEDULING
@@ -44,6 +49,43 @@
 */
 
 
+#if VMIME_HAVE_PTHREAD
+
+namespace
+{
+	// This construction ensures mutex will be initialized in compile-time
+	// and will be available any time in the runtime.
+	pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+	// Helper lock, to be exception safe all the time.
+	class PLockHelper
+	{
+	public:
+
+		PLockHelper()
+		{
+			if (pthread_mutex_lock(&g_mutex) != 0)
+				assert(!"unable to lock mutex - thread safety's void");
+		}
+
+		~PLockHelper()
+		{
+			if (pthread_mutex_unlock(&g_mutex) != 0)
+				assert(!"unable to unlock mutex - application's dead...");
+		}
+
+	private:
+
+		// Object cannot be copied
+		PLockHelper(const PLockHelper&);
+		const PLockHelper& operator=(const PLockHelper&);
+	};
+
+} // unnamed namespace
+
+#endif // VMIME_HAVE_PTHREAD
+
+
 namespace vmime {
 namespace platforms {
 namespace posix {
@@ -109,6 +151,8 @@ const vmime::datetime posixHandler::getCurrentLocalTime() const
 
 const vmime::charset posixHandler::getLocaleCharset() const
 {
+	const PLockHelper lock;
+
 	const char* prevLocale = ::setlocale(LC_ALL, "");
 	vmime::charset ch(::nl_langinfo(CODESET));
 	::setlocale(LC_ALL, prevLocale);

commit d2f72cddc908788a539810ff428dbcc123be1dd3
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun Dec 13 12:50:36 2009 +0000

    Makes 'To' optional, like 'Cc' and 'Bcc'. An exception is still thrown if there are no recipients at all (see bug #2912670).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@519 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp
index a70372f..870d59e 100644
--- a/src/messageBuilder.cpp
+++ b/src/messageBuilder.cpp
@@ -54,11 +54,17 @@ ref <message> messageBuilder::construct() const
 	if (m_from.isEmpty())
 		throw exceptions::no_expeditor();
 
-	if (m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty())
+	if ((m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty()) &&
+	    (m_cc.isEmpty() || m_cc.getAddressAt(0)->isEmpty()) &&
+	    (m_bcc.isEmpty() || m_bcc.getAddressAt(0)->isEmpty()))
+	{
 		throw exceptions::no_recipient();
+	}
 
 	msg->getHeader()->From()->setValue(m_from);
-	msg->getHeader()->To()->setValue(m_to);
+
+	if (!m_to.isEmpty())
+		msg->getHeader()->To()->setValue(m_to);
 
 	if (!m_cc.isEmpty())
 		msg->getHeader()->Cc()->setValue(m_cc);

commit eefa93eba21736bf9689317c35b0fd9ea6c30e69
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Jan 20 08:42:47 2010 +0000

    Fixed bug #2933667: CRLF filter broken.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@520 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/filteredStream.cpp b/src/utility/filteredStream.cpp
index 619f9da..c1b01ef 100644
--- a/src/utility/filteredStream.cpp
+++ b/src/utility/filteredStream.cpp
@@ -231,8 +231,8 @@ void CRLFToLFFilteredOutputStream::write
 
 		if (previousChar == '\r')
 		{
-			if (pos != data)
-				m_stream.write(start, pos - 1 - data);  // do not write \r
+			if (pos != start)
+				m_stream.write(start, pos - 1 - start);  // do not write \r
 
 			m_stream.write("\n", 1);
 
diff --git a/tests/utility/filteredStreamTest.cpp b/tests/utility/filteredStreamTest.cpp
index ad26e6c..a2e6f3e 100644
--- a/tests/utility/filteredStreamTest.cpp
+++ b/tests/utility/filteredStreamTest.cpp
@@ -175,6 +175,7 @@ VMIME_TEST_SUITE_BEGIN
 		testFilteredOutputStreamHelper<FILTER>("4", "foo\nbar", "foo", "\r\nbar");
 		testFilteredOutputStreamHelper<FILTER>("5", "foo\nbar", "foo", "\r", "\nbar");
 		testFilteredOutputStreamHelper<FILTER>("6", "foo\nbar", "foo", "\r", "\n", "bar");
+		testFilteredOutputStreamHelper<FILTER>("7", "foo\nba\nr", "foo\r", "\nba\r\nr");
 	}
 
 	// stopSequenceFilteredInputStream

commit 85ad52fef45592a0c3335afc3564b3485db07657
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Feb 1 13:06:06 2010 +0000

    Fixed bug #2927077: account for multi-byte charsets in invalid sequence output.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@521 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/charsetConverter.cpp b/src/charsetConverter.cpp
index ec74ae5..798adf0 100644
--- a/src/charsetConverter.cpp
+++ b/src/charsetConverter.cpp
@@ -121,7 +121,18 @@ void charsetConverter::convert(utility::inputStream& in, utility::outputStream&
 
 				// Output a special character to indicate we don't known how to
 				// convert the sequence at this position
-				out.write("?", 1);
+				const char* invalidCharIn = "?";
+				size_t invalidCharInLen = 1;
+
+				char invalidCharOutBuffer[16];
+				char* invalidCharOutPtr = invalidCharOutBuffer;
+				size_t invalidCharOutLen = 16;
+
+				if (iconv(cd, ICONV_HACK(&invalidCharIn), &invalidCharInLen,
+					&invalidCharOutPtr, &invalidCharOutLen) != static_cast <size_t>(-1))
+				{
+					out.write(invalidCharOutBuffer, 16 - invalidCharOutLen);
+				}
 
 				// Skip a byte and leave unconverted bytes in the input buffer
 				std::copy(const_cast <char*>(inPtr + 1), inBuffer + sizeof(inBuffer), inBuffer);

commit 99869c3d4c41304034667400ac6a5c3edc07146d
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Feb 1 13:26:12 2010 +0000

    Fixed bug #2927077: account for multi-byte charsets in invalid sequence output.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@522 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/charsetConverter.cpp b/src/charsetConverter.cpp
index 798adf0..38b9e5e 100644
--- a/src/charsetConverter.cpp
+++ b/src/charsetConverter.cpp
@@ -53,6 +53,27 @@ extern "C"
 }
 
 
+
+// Output replacement char when an invalid sequence is encountered
+template <typename OUTPUT_CLASS, typename ICONV_DESC>
+void outputInvalidChar(OUTPUT_CLASS& out, ICONV_DESC cd)
+{
+	const char* invalidCharIn = "?";
+	size_t invalidCharInLen = 1;
+
+	char invalidCharOutBuffer[16];
+	char* invalidCharOutPtr = invalidCharOutBuffer;
+	size_t invalidCharOutLen = 16;
+
+	if (iconv(cd, ICONV_HACK(&invalidCharIn), &invalidCharInLen,
+		&invalidCharOutPtr, &invalidCharOutLen) != static_cast <size_t>(-1))
+	{
+		out.write(invalidCharOutBuffer, 16 - invalidCharOutLen);
+	}
+}
+
+
+
 namespace vmime
 {
 
@@ -121,18 +142,7 @@ void charsetConverter::convert(utility::inputStream& in, utility::outputStream&
 
 				// Output a special character to indicate we don't known how to
 				// convert the sequence at this position
-				const char* invalidCharIn = "?";
-				size_t invalidCharInLen = 1;
-
-				char invalidCharOutBuffer[16];
-				char* invalidCharOutPtr = invalidCharOutBuffer;
-				size_t invalidCharOutLen = 16;
-
-				if (iconv(cd, ICONV_HACK(&invalidCharIn), &invalidCharInLen,
-					&invalidCharOutPtr, &invalidCharOutLen) != static_cast <size_t>(-1))
-				{
-					out.write(invalidCharOutBuffer, 16 - invalidCharOutLen);
-				}
+				outputInvalidChar(out, cd);
 
 				// Skip a byte and leave unconverted bytes in the input buffer
 				std::copy(const_cast <char*>(inPtr + 1), inBuffer + sizeof(inBuffer), inBuffer);
@@ -246,7 +256,7 @@ void charsetFilteredOutputStream::write
 			// character and skip one byte in the invalid sequence.
 			if (m_unconvCount >= sizeof(m_unconvBuffer))
 			{
-				m_stream.write("?", 1);
+				outputInvalidChar(m_stream, cd);
 
 				std::copy(m_unconvBuffer + 1,
 					m_unconvBuffer + m_unconvCount, m_unconvBuffer);
@@ -369,7 +379,7 @@ void charsetFilteredOutputStream::flush()
 			// Skip a "blocking" character
 			if (inputConverted == 0)
 			{
-				m_stream.write("?", 1);
+				outputInvalidChar(m_stream, cd);
 
 				offset++;
 				m_unconvCount--;

commit fb9a3f5572922a285284af7b88bea90e69897345
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Feb 1 16:33:31 2010 +0000

    Fixed memory leak.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@523 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/maildir/maildirFormat.cpp b/src/net/maildir/maildirFormat.cpp
index 607ed61..7844542 100644
--- a/src/net/maildir/maildirFormat.cpp
+++ b/src/net/maildir/maildirFormat.cpp
@@ -52,7 +52,7 @@ maildirFormat::context::context(ref <maildirStore> store)
 
 ref <maildirStore> maildirFormat::context::getStore() const
 {
-	return m_store;
+	return m_store.acquire().constCast <maildirStore>();
 }
 
 
diff --git a/vmime/net/maildir/maildirFormat.hpp b/vmime/net/maildir/maildirFormat.hpp
index a47c854..0940696 100644
--- a/vmime/net/maildir/maildirFormat.hpp
+++ b/vmime/net/maildir/maildirFormat.hpp
@@ -55,7 +55,7 @@ public:
 
 	private:
 
-		ref <maildirStore> m_store;
+		weak_ref <maildirStore> m_store;
 	};
 
 

commit 66bd70eb441da32d95ec103ebc26c9b53d90d28e
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 3 10:45:17 2010 +0000

    Removed wide-char support.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@524 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 89b58f6..33bc2a3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -530,14 +530,6 @@ opts.AddOptions(
 		defaultSendmailPath
 	),
 	EnumOption(
-		'with_wide_char_support',
-		'Support for wide characters (rarely used, should be set to "no")',
-		'no',
-		allowed_values = ('yes', 'no'),
-		map = { },
-		ignorecase = 1
-	),
-	EnumOption(
 		'byte_order',
 		'Byte order (Big Endian or Little Endian)',
 		sys.byteorder,
@@ -802,12 +794,6 @@ config_hpp.write('\n')
 
 config_hpp.write('// Options\n')
 
-config_hpp.write('// -- Wide characters support\n')
-if env['with_wide_char_support'] == 'yes':
-	config_hpp.write('#define VMIME_WIDE_CHAR_SUPPORT 1\n')
-else:
-	config_hpp.write('#define VMIME_WIDE_CHAR_SUPPORT 0\n')
-
 config_hpp.write('// -- File-system support\n')
 if env['with_filesystem'] == 'yes':
 	config_hpp.write('#define VMIME_HAVE_FILESYSTEM_FEATURES 1\n')
@@ -1916,8 +1902,6 @@ typedef signed ${VMIME_TYPE_INT32} vmime_int32;
 typedef unsigned ${VMIME_TYPE_INT32} vmime_uint32;
 
 // Options
-// -- Wide characters support
-#define VMIME_WIDE_CHAR_SUPPORT 0
 // -- File-system support
 #define VMIME_HAVE_FILESYSTEM_FEATURES 1
 // -- SASL support
@@ -2261,8 +2245,6 @@ typedef unsigned int vmime_uint32;
 
 
 // Options
-// -- Wide characters support
-#define VMIME_WIDE_CHAR_SUPPORT 0
 // -- File-system support
 #define VMIME_HAVE_FILESYSTEM_FEATURES 1
 // -- SASL support
diff --git a/src/base.cpp b/src/base.cpp
index 2e47ca3..b895985 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -55,12 +55,6 @@ namespace vmime
   */
 const string NULL_STRING;
 
-#if VMIME_WIDE_CHAR_SUPPORT
-	/** "Null" (empty) wide-char string.
-	  */
-	const wstring NULL_WSTRING;
-#endif
-
 /** "Null" (empty) text.
   */
 const text NULL_TEXT;
diff --git a/src/text.cpp b/src/text.cpp
index f9ded7c..89a541a 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -91,21 +91,6 @@ void text::generate(utility::outputStream& os, const string::size_type maxLineLe
 }
 
 
-#if VMIME_WIDE_CHAR_SUPPORT
-
-const wstring text::getDecodedText() const
-{
-	wstring out;
-
-	for (std::vector <ref <word> >::const_iterator i = m_words.begin() ; i != m_words.end() ; ++i)
-		out += (*i)->getDecodedText();
-
-	return (out);
-}
-
-#endif
-
-
 void text::copyFrom(const component& other)
 {
 	const text& t = dynamic_cast <const text&>(other);
diff --git a/src/word.cpp b/src/word.cpp
index ea8244a..4f91108 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -621,20 +621,6 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 }
 
 
-#if VMIME_WIDE_CHAR_SUPPORT
-
-const wstring word::getDecodedText() const
-{
-	wstring out;
-
-	charset::decode(m_buffer, out, m_charset);
-
-	return (out);
-}
-
-#endif
-
-
 word& word::operator=(const word& w)
 {
 	m_buffer = w.m_buffer;
diff --git a/vmime/base.hpp b/vmime/base.hpp
index ce544e1..60e637d 100644
--- a/vmime/base.hpp
+++ b/vmime/base.hpp
@@ -48,9 +48,6 @@ namespace vmime
 
 	// "Null" strings
 	extern const string NULL_STRING;
-#if VMIME_WIDE_CHAR_SUPPORT
-	extern const wstring NULL_WSTRING;
-#endif
 
 	extern const text NULL_TEXT;
 	extern const word NULL_WORD;
diff --git a/vmime/text.hpp b/vmime/text.hpp
index 9760c48..15e11ae 100644
--- a/vmime/text.hpp
+++ b/vmime/text.hpp
@@ -129,10 +129,6 @@ public:
 	  */
 	const std::vector <ref <word> > getWordList();
 
-	// Decoding
-#if VMIME_WIDE_CHAR_SUPPORT
-	const wstring getDecodedText() const;
-#endif
 
 	/** Return the text converted into the specified charset.
 	  * The encoded-words are decoded and then converted in the
diff --git a/vmime/types.hpp b/vmime/types.hpp
index bdf627e..d1137e1 100644
--- a/vmime/types.hpp
+++ b/vmime/types.hpp
@@ -36,9 +36,6 @@
 namespace vmime
 {
 	typedef std::string string;
-#if VMIME_WIDE_CHAR_SUPPORT
-	typedef std::wstring wstring;
-#endif
 
 	typedef unsigned short port_t;
 
diff --git a/vmime/word.hpp b/vmime/word.hpp
index 78a88e8..ad848ec 100644
--- a/vmime/word.hpp
+++ b/vmime/word.hpp
@@ -91,10 +91,6 @@ public:
 	bool operator==(const word& w) const;
 	bool operator!=(const word& w) const;
 
-#if VMIME_WIDE_CHAR_SUPPORT
-	const wstring getDecodedText() const;
-#endif
-
 	/** Return the contained text converted to the specified charset.
 	  *
 	  * @param dest output charset

commit 221ae58cc1587a78a221988398f9377417b17e25
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 3 10:56:12 2010 +0000

    Use homemade isSpace() instead of std::ispace() for portability.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@525 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/word.cpp b/src/word.cpp
index 4f91108..f24d631 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -475,7 +475,7 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 
 				os << string(curLineStart, lastWSpos);
 
-				if (lastWSpos > curLineStart && std::isspace(*(lastWSpos - 1)))
+				if (lastWSpos > curLineStart && parserHelpers::isSpace(*(lastWSpos - 1)))
 					state->lastCharIsSpace = true;
 				else
 					state->lastCharIsSpace = false;

commit af61f3bcc07eabd7cad06e9619882ce239cb419f
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 3 11:01:40 2010 +0000

    Fixed compilation issue on Windows.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@526 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 82c5696..624612a 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -268,7 +268,7 @@ bool windowsFile::canWrite() const
 	return true;
 }
 
-const windowsFile::length_type windowsFile::getLength()
+windowsFile::length_type windowsFile::getLength()
 {
 	HANDLE hFile = CreateFile(
 		m_nativePath.c_str(),

commit bc1016c7e1f18c1088809a2104b295563a2d253a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 10 09:12:25 2010 +0000

    Allow spaces to appear in mailbox display name without encoding or quoting. Encode or quote if CR or LF is present.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@527 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index f6df516..036f003 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -369,7 +369,7 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
 		// We have to encode the name:
 		//   - if it contains characters in a charset different from "US-ASCII",
 		//   - and/or if it contains one or more of these special chars:
-		//        SPACE  TAB  "  ;  ,  <  >  (  )  @  /  ?  .  =  :
+		//        CR  LF  TAB  "  ;  ,  <  >  (  )  @  /  ?  .  =  :
 
 		// Check whether there are words that are not "US-ASCII"
 		// and/or contain the special chars.
@@ -386,7 +386,8 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
 				{
 					switch (*c)
 					{
-					case ' ':
+					case '\r':
+					case '\n':
 					case '\t':
 					case ';':
 					case ',':

commit 65d0cd058e4806b1a783656e3239403edd628f5b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 10 09:41:36 2010 +0000

    Don't quote if no encoding is needed.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@528 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/word.cpp b/src/word.cpp
index f24d631..667f1fb 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -357,7 +357,8 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 	//  - the whole buffer is ASCII-only
 	//  - the buffer does not contain quoting character (")
 	//  - there is enough remaining space on the current line to hold the whole buffer
-	if ((flags & text::QUOTE_IF_POSSIBLE) &&
+	if (!noEncoding &&
+	    (flags & text::QUOTE_IF_POSSIBLE) &&
 	    asciiCount == m_buffer.length() &&
 	    m_buffer.find('"') == string::npos &&
 	    (curLineLength + 2 /* 2 x " */ + m_buffer.length()) < maxLineLength)

commit 5b770cf6cb94b90e72360314e31ea05ca8dfe396
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 10 10:39:10 2010 +0000

    Fixed missing M4 file in dist tarball.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@529 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 33bc2a3..f6dc257 100644
--- a/SConstruct
+++ b/SConstruct
@@ -376,6 +376,7 @@ libvmimetest_sources = [
 ]
 
 libvmime_autotools = [
+	'm4/acx_pthread.m4',
 	'm4/iconv.m4',
 	'm4/lib-ld.m4',
 	'm4/lib-link.m4',

commit ce3c3fffbdf366e9c6afc4216485f0f9e0ce13a2
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri Feb 12 22:00:49 2010 +0000

    Replaced 'Options' with 'Variables' to solve warnings about the former being deprecated.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@530 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index f6dc257..d45aec0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -459,15 +459,15 @@ if defaultSendmailPath == None:
 
 
 # Command line options
-opts = Options('options.cache')
+opts = Variables('options.cache')
 
-opts.AddOptions(
+opts.AddVariables(
 	(
 		'prefix',
 		'Installation prefix directory',
 		'/usr'
 	),
-	EnumOption(
+	EnumVariable(
 		'debug',
 		'Debug version (useful for developers only)',
 		'no',
@@ -475,7 +475,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'with_messaging',
 		'Messaging support (connection to mail store/transport servers)',
 		'yes',
@@ -483,7 +483,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'with_filesystem',
 		'Enable file-system support (this is needed for "maildir" messaging support)',
 		'yes',
@@ -509,7 +509,7 @@ opts.AddOptions(
 		    + 'Currently available platform handlers: posix.',
 		'"posix"'
 	),
-	EnumOption(
+	EnumVariable(
 	 	'with_sasl',
 		'Enable SASL support (requires GNU SASL library)',
 		'yes',
@@ -517,7 +517,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'with_tls',
 		'Enable TLS support (requires GNU TLS library)',
 		'yes',
@@ -530,7 +530,7 @@ opts.AddOptions(
 		'Specifies the path to sendmail.',
 		defaultSendmailPath
 	),
-	EnumOption(
+	EnumVariable(
 		'byte_order',
 		'Byte order (Big Endian or Little Endian)',
 		sys.byteorder,
@@ -538,7 +538,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'pf_8bit_type',
 		'The C-language 8-bit type for your platform',
 		'char',
@@ -546,7 +546,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'pf_16bit_type',
 		'The C-language 16-bit type for your platform',
 		'short',
@@ -554,7 +554,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'pf_32bit_type',
 		'The C-language 32-bit type for your platform',
 		'int',
@@ -562,7 +562,7 @@ opts.AddOptions(
 		map = { },
 		ignorecase = 1
 	),
-	EnumOption(
+	EnumVariable(
 		'build_tests',
 		'Build unit tests (run with "scons run-tests")',
 		'no',

commit 6dcc7213c7881e312fcbc68742f33c38a425fe7e
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri Feb 12 22:11:03 2010 +0000

    Solved 'underquoted' warnings from m4 macros.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@531 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/m4/ost_posix.m4 b/m4/ost_posix.m4
index 6572b1e..ab05e25 100644
--- a/m4/ost_posix.m4
+++ b/m4/ost_posix.m4
@@ -19,7 +19,7 @@ dnl distribute this file as part of a program that contains a configuration
 dnl script generated by Autoconf, you may include it under the same 
 dnl distribution terms that you use for the rest of that program.
 
-AC_DEFUN(OST_SYS_POSIX,[
+AC_DEFUN([OST_SYS_POSIX],[
  AC_REQUIRE([OST_PROG_CC_POSIX])
  AC_CACHE_CHECK(whether system meets Posix.1,
 	ost_cv_sys_posix1,
@@ -65,7 +65,7 @@ AC_DEFUN(OST_SYS_POSIX,[
 	])
 ])
 
-AC_DEFUN(OST_CC_FCNTL,[
+AC_DEFUN([OST_CC_FCNTL],[
 	AC_REQUIRE([OST_SYS_POSIX])
 	AC_CHECK_HEADERS(fcntl.h sys/fcntl.h)
 AH_BOTTOM([
diff --git a/m4/ost_prog.m4 b/m4/ost_prog.m4
index c9e66f5..aaa82f3 100644
--- a/m4/ost_prog.m4
+++ b/m4/ost_prog.m4
@@ -19,18 +19,18 @@ dnl distribute this file as part of a program that contains a configuration
 dnl script generated by Autoconf, you may include it under the same
 dnl distribution terms that you use for the rest of that program.
 
-AC_DEFUN(OST_PROG_CC_POSIX,[
+AC_DEFUN([OST_PROG_CC_POSIX],[
 	AC_PROG_CC
 	AC_PROG_CPP
 	AC_ISC_POSIX]
 )
 
-AC_DEFUN(OST_PROG_COMMON,[
+AC_DEFUN([OST_PROG_COMMON],[
 	AC_REQUIRE([AC_PROG_INSTALL])
 	AC_REQUIRE([AC_PROG_MAKE_SET])
 ])
 
-AC_DEFUN(OST_PROJ_LIBRARY,[
+AC_DEFUN([OST_PROJ_LIBRARY],[
 	AC_REQUIRE([AM_PROG_LIBTOOL])
 	AC_REQUIRE([AC_PROG_RANLIB])
 	if test ! -z "[$2]" ; then
@@ -43,14 +43,14 @@ AC_DEFUN(OST_PROJ_LIBRARY,[
 	fi
 ])
 
-AC_DEFUN(OST_PROG_LIBVER,[
+AC_DEFUN([OST_PROG_LIBVER],[
 	LT_MAJOR="`echo $LT_VERSION | sed s/:.*$//`"
 	AC_SUBST(LT_RELEASE)
 	AC_SUBST(LT_MAJOR)
 ])
 
 
-AC_DEFUN(OST_PROG_LIBRARY,[
+AC_DEFUN([OST_PROG_LIBRARY],[
 	AC_REQUIRE([AM_PROG_LIBTOOL])
 	AC_REQUIRE([AC_PROG_RANLIB])
 	if test ! -z "[$2]" ; then
diff --git a/m4/ost_systime.m4 b/m4/ost_systime.m4
index f48f207..145611e 100644
--- a/m4/ost_systime.m4
+++ b/m4/ost_systime.m4
@@ -19,7 +19,7 @@ dnl distribute this file as part of a program that contains a configuration
 dnl script generated by Autoconf, you may include it under the same 
 dnl distribution terms that you use for the rest of that program.
 
-AC_DEFUN(OST_CC_SYSTIME,[
+AC_DEFUN([OST_CC_SYSTIME],[
 	AC_HEADER_TIME
 	AC_CHECK_HEADERS(sys/time.h)
 AH_TOP([

commit 0af45816e99b3d8e7a9902a35330095408c487ae
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri Feb 12 22:28:37 2010 +0000

    Updated gettext m4 macros to 0.17.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@532 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index ea0b0c4..e3d26fc 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,17 +1,19 @@
-# lib-link.m4 serial 6 (gettext-0.14.3)
-dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+# lib-link.m4 serial 13 (gettext-0.17)
+dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-AC_PREREQ(2.50)
+AC_PREREQ(2.54)
 
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
@@ -24,13 +26,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
   ])
   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
   AC_SUBST([LIB]NAME)
   AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
   dnl results of this search when this library appears as a dependency.
   HAVE_LIB[]NAME=yes
@@ -46,6 +51,8 @@ dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
@@ -82,17 +89,23 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
     CPPFLAGS="$ac_save_CPPFLAGS"
     LIB[]NAME=
     LTLIB[]NAME=
+    LIB[]NAME[]_PREFIX=
   fi
   AC_SUBST([HAVE_LIB]NAME)
   AC_SUBST([LIB]NAME)
   AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
   undefine([Name])
   undefine([NAME])
 ])
 
 dnl Determine the platform dependent parameters needed to use rpath:
-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
-dnl hardcode_direct, hardcode_minus_L.
+dnl   acl_libext,
+dnl   acl_shlibext,
+dnl   acl_hardcode_libdir_flag_spec,
+dnl   acl_hardcode_libdir_separator,
+dnl   acl_hardcode_direct,
+dnl   acl_hardcode_minus_L.
 AC_DEFUN([AC_LIB_RPATH],
 [
   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
@@ -109,12 +122,14 @@ AC_DEFUN([AC_LIB_RPATH],
     acl_cv_rpath=done
   ])
   wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
   dnl Determine whether the user wants rpath handling at all.
   AC_ARG_ENABLE(rpath,
     [  --disable-rpath         do not hardcode runtime library paths],
@@ -124,19 +139,24 @@ AC_DEFUN([AC_LIB_RPATH],
 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl Autoconf >= 2.61 supports dots in --with options.
+  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
   AC_LIB_WITH_FINAL_PREFIX([
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
   ])
-  AC_LIB_ARG_WITH([lib$1-prefix],
-[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
+[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -148,7 +168,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         ])
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
       fi
     fi
 ])
@@ -157,6 +177,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   LIB[]NAME=
   LTLIB[]NAME=
   INC[]NAME=
+  LIB[]NAME[]_PREFIX=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -196,22 +217,55 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
           found_la=
           found_so=
           found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
           if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
+            dir="$additional_libdir"
+            dnl The same code as in the loop below:
+            dnl First look for a shared library.
+            if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
                 fi
               fi
             fi
+            dnl Then look for a static library.
+            if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIB[]NAME; do
@@ -219,21 +273,46 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               case "$x" in
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
                       found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
                       fi
                     fi
                   fi
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                   ;;
               esac
               if test "X$found_dir" != "X"; then
@@ -248,7 +327,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               dnl Linking with a shared library. We attempt to hardcode its
               dnl directory into the executable's runpath, unless it's the
               dnl standard /usr/lib.
-              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
                 dnl No hardcoding is needed.
                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
               else
@@ -267,12 +346,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
                 dnl The hardcoding into $LIBNAME is system dependent.
-                if test "$hardcode_direct" = yes; then
+                if test "$acl_hardcode_direct" = yes; then
                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
                   dnl resulting binary.
                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                 else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
                     dnl Use an explicit option to hardcode DIR into the resulting
                     dnl binary.
                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
@@ -303,13 +382,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                     if test -z "$haveit"; then
                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
                     fi
-                    if test "$hardcode_minus_L" != no; then
+                    if test "$acl_hardcode_minus_L" != no; then
                       dnl FIXME: Not sure whether we should use
                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
                       dnl here.
                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                     else
-                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
                       dnl here, because this doesn't fit in flags passed to the
                       dnl compiler. So give up. No hardcoding. This affects only
                       dnl very old systems.
@@ -334,8 +413,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
             dnl Assume the include files are nearby.
             additional_includedir=
             case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                LIB[]NAME[]_PREFIX="$basedir"
                 additional_includedir="$basedir/include"
                 ;;
             esac
@@ -396,9 +476,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                     dnl   3. if it's already present in $LDFLAGS or the already
                     dnl      constructed $LIBNAME,
                     dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/lib"; then
+                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -497,18 +577,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
     done
   done
   if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
       dnl Weird platform: only the last -rpath option counts, the user must
       dnl pass all path elements in one option. We can arrange that for a
       dnl single library, but not when more than one $LIBNAMEs are used.
       alldirs=
       for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
       done
-      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
       acl_save_libdir="$libdir"
       libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
     else
@@ -516,7 +596,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
       for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
       done
@@ -551,3 +631,79 @@ AC_DEFUN([AC_LIB_APPENDTOVAR],
     fi
   done
 ])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+  AC_REQUIRE([AC_LIB_RPATH])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  $1=
+  if test "$enable_rpath" != no; then
+    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+      dnl Use an explicit option to hardcode directories into the resulting
+      dnl binary.
+      rpathdirs=
+      next=
+      for opt in $2; do
+        if test -n "$next"; then
+          dir="$next"
+          dnl No need to hardcode the standard /usr/lib.
+          if test "X$dir" != "X/usr/$acl_libdirstem"; then
+            rpathdirs="$rpathdirs $dir"
+          fi
+          next=
+        else
+          case $opt in
+            -L) next=yes ;;
+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                 dnl No need to hardcode the standard /usr/lib.
+                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
+                   rpathdirs="$rpathdirs $dir"
+                 fi
+                 next= ;;
+            *) next= ;;
+          esac
+        fi
+      done
+      if test "X$rpathdirs" != "X"; then
+        if test -n ""$3""; then
+          dnl libtool is used for linking. Use -R options.
+          for dir in $rpathdirs; do
+            $1="${$1}${$1:+ }-R$dir"
+          done
+        else
+          dnl The linker is used for linking directly.
+          if test -n "$acl_hardcode_libdir_separator"; then
+            dnl Weird platform: only the last -rpath option counts, the user
+            dnl must pass all path elements in one option.
+            alldirs=
+            for dir in $rpathdirs; do
+              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+            done
+            acl_save_libdir="$libdir"
+            libdir="$alldirs"
+            eval flag=\"$acl_hardcode_libdir_flag_spec\"
+            libdir="$acl_save_libdir"
+            $1="$flag"
+          else
+            dnl The -rpath options are cumulative.
+            for dir in $rpathdirs; do
+              acl_save_libdir="$libdir"
+              libdir="$dir"
+              eval flag=\"$acl_hardcode_libdir_flag_spec\"
+              libdir="$acl_save_libdir"
+              $1="${$1}${$1:+ }$flag"
+            done
+          fi
+        fi
+      fi
+    fi
+  fi
+  AC_SUBST([$1])
+])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 0d895ca..a8684e1 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 4 (gettext-0.14.2)
+# lib-prefix.m4 serial 5 (gettext-0.15)
 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,6 +24,7 @@ AC_DEFUN([AC_LIB_PREFIX],
   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
@@ -45,7 +46,7 @@ AC_DEFUN([AC_LIB_PREFIX],
         ])
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
       fi
     fi
 ])
@@ -87,7 +88,7 @@ AC_DEFUN([AC_LIB_PREFIX],
     dnl   2. if it's already present in $LDFLAGS,
     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
     dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_libdir" != "X/usr/lib"; then
+    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
       haveit=
       for x in $LDFLAGS; do
         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
@@ -97,7 +98,7 @@ AC_DEFUN([AC_LIB_PREFIX],
         fi
       done
       if test -z "$haveit"; then
-        if test "X$additional_libdir" = "X/usr/local/lib"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
           if test -n "$GCC"; then
             case $host_os in
               linux*) haveit=yes;;
@@ -151,3 +152,34 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 ])
+
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+  dnl There is no formal standard regarding lib and lib64. The current
+  dnl practice is that on a system supporting 32-bit and 64-bit instruction
+  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+  dnl libraries go under $prefix/lib. We determine the compiler's default
+  dnl mode by looking at the compiler's library search path. If at least
+  dnl of its elements ends in /lib64 or points to a directory whose absolute
+  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+  dnl default, namely "lib".
+  acl_libdirstem=lib
+  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+  if test -n "$searchpath"; then
+    acl_save_IFS="${IFS= 	}"; IFS=":"
+    for searchdir in $searchpath; do
+      if test -d "$searchdir"; then
+        case "$searchdir" in
+          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+          *) searchdir=`cd "$searchdir" && pwd`
+             case "$searchdir" in
+               */lib64 ) acl_libdirstem=lib64 ;;
+             esac ;;
+        esac
+      fi
+    done
+    IFS="$acl_save_IFS"
+  fi
+])

commit 508bfaf7f46e7c324e503794812bfee6fd422594
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Feb 15 09:05:49 2010 +0000

    Fixed test for global constructor failing when cross building.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@533 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index d45aec0..2452745 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1364,7 +1364,7 @@ sh libtool --mode=link $CXX -o libtest.la -rpath / -version-info 0 mylib.lo  >&5
 $CXX -c $CFLAGS $CPPFLAGS mytest.$ac_ext >&5
 sh libtool --mode=link $CXX -o mytest mytest.o libtest.la >&5 2>/dev/null
 
-if test -x mytest; then
+if test -x mytest -a "$cross_compiling" != yes; then
 	myresult=`./mytest`
 	if test "X$myresult" = "XPASS"; then
 		AC_MSG_RESULT(yes)

commit 4ebf3f0343a54af998ac0f039820f790b4c5f255
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Feb 17 22:27:53 2010 +0000

    Fixed shebang for systems that don't have /bin/bash.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@534 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/bootstrap b/bootstrap
index 457eaa8..01309ce 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,4 +1,5 @@
 #! /bin/bash
+#! /usr/bin/env bash
 #
 # Bootstrap file for 'autotools' build
 #

commit 253a55ef8991269e0b66bf6b54e1aed0b385cb6b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Mar 6 12:48:39 2010 +0000

    Use 'glibtoolize' instead of 'libtoolize' on MacOSX.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@535 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/bootstrap b/bootstrap
index 01309ce..1540429 100755
--- a/bootstrap
+++ b/bootstrap
@@ -13,6 +13,13 @@ rm -Rf autom4te.cache
 (mkdir autotools >& /dev/null)
 (cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh)
 
+# Check for "glibtoolize" instead of "libtoolize" on OSX
+LIBTOOLIZE=libtoolize
+if which glibtoolize > /dev/null 2>&1; then
+	LIBTOOLIZE=glibtoolize
+fi
+
+
 DIE=0
 
 echo ""
@@ -36,7 +43,7 @@ if test $DIE = 0 ; then
 fi
 
 if test $DIE = 0 ; then
-	echo -n "* Running libtoolize... " ; (libtoolize --copy --force --automake >& bootstrap.tmpout) \
+	echo -n "* Running libtoolize... " ; ($LIBTOOLIZE --copy --force --automake >& bootstrap.tmpout) \
 		&& (echo "[OK]" ; cat bootstrap.tmpout ; rm -f bootstrap.tmpout) \
 		|| (echo "[NO]" ; cat bootstrap.tmpout ; rm -f bootstrap.tmpout ; not_a_command >& /dev/null) || DIE=1
 fi

commit 5ccf29bc69f34dada3dca2f0bf7aac7b6714dffb
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Mar 10 13:29:33 2010 +0000

    Fixed bug #2966885: memory leak caused by strong ref (thanks to tuxx from SF).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@536 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp
index 06ffc49..32192f7 100644
--- a/src/security/sasl/defaultSASLAuthenticator.cpp
+++ b/src/security/sasl/defaultSASLAuthenticator.cpp
@@ -96,7 +96,7 @@ const string defaultSASLAuthenticator::getAnonymousToken() const
 
 const string defaultSASLAuthenticator::getServiceName() const
 {
-	return m_saslSession->getServiceName();
+	return m_saslSession.acquire()->getServiceName();
 }
 
 
@@ -121,7 +121,7 @@ void defaultSASLAuthenticator::setSASLSession(ref <SASLSession> sess)
 
 ref <SASLSession> defaultSASLAuthenticator::getSASLSession() const
 {
-	return m_saslSession;
+	return m_saslSession.acquire();
 }
 
 
diff --git a/vmime/security/sasl/defaultSASLAuthenticator.hpp b/vmime/security/sasl/defaultSASLAuthenticator.hpp
index a896b65..7595de7 100644
--- a/vmime/security/sasl/defaultSASLAuthenticator.hpp
+++ b/vmime/security/sasl/defaultSASLAuthenticator.hpp
@@ -67,10 +67,8 @@ private:
 
 	defaultAuthenticator m_default;
 
-
 	weak_ref <net::service> m_service;
-
-	ref <SASLSession> m_saslSession;
+	weak_ref <SASLSession> m_saslSession;
 	ref <SASLMechanism> m_saslMech;
 };
 

commit af7be2b3da767f2723879fd78dbbcf991f069715
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Mar 10 15:54:23 2010 +0000

    Fixed compilation issue with 'const'.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@537 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp
index 32192f7..4eae4e3 100644
--- a/src/security/sasl/defaultSASLAuthenticator.cpp
+++ b/src/security/sasl/defaultSASLAuthenticator.cpp
@@ -121,7 +121,7 @@ void defaultSASLAuthenticator::setSASLSession(ref <SASLSession> sess)
 
 ref <SASLSession> defaultSASLAuthenticator::getSASLSession() const
 {
-	return m_saslSession.acquire();
+	return m_saslSession.acquire().constCast <SASLSession>();
 }
 
 

commit 2a62318173c8285202bbddbba3fb1e77a1dc9d3a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Mar 16 08:39:45 2010 +0000

    Return false instead of throwing an exception if file does not exist in isDirectory(), isFile(), canRead() and canWrite().
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@538 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index b814b75..ec529eb 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -306,6 +306,9 @@ bool posixFile::isFile() const
 
 	if (::stat(m_nativePath.c_str(), &buf) == -1)
 	{
+		if (errno == ENOENT)
+			return false;
+
 		posixFileSystemFactory::reportError(m_path, errno);
 		return false;
 	}
@@ -320,6 +323,9 @@ bool posixFile::isDirectory() const
 
 	if (::stat(m_nativePath.c_str(), &buf) == -1)
 	{
+		if (errno == ENOENT)
+			return false;
+
 		posixFileSystemFactory::reportError(m_path, errno);
 		return false;
 	}
@@ -334,6 +340,9 @@ bool posixFile::canRead() const
 
 	if (::stat(m_nativePath.c_str(), &buf) == -1)
 	{
+		if (errno == ENOENT)
+			return false;
+
 		posixFileSystemFactory::reportError(m_path, errno);
 		return false;
 	}
@@ -349,6 +358,9 @@ bool posixFile::canWrite() const
 
 	if (::stat(m_nativePath.c_str(), &buf) == -1)
 	{
+		if (errno == ENOENT)
+			return false;
+
 		posixFileSystemFactory::reportError(m_path, errno);
 		return false;
 	}

commit 298f8712f6e2bb6e0f1b321906eb691793554f05
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Mar 16 11:54:11 2010 +0000

    Fixed calls to 'empty' instead of 'clear' (thanks to John van der Kamp, from Zarafa).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@539 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index 036f003..5cb0139 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -311,7 +311,7 @@ void mailbox::parse(const string& buffer, const string::size_type position,
 	// (email address is mandatory, whereas name is optional).
 	if (address.empty() && !name.empty())
 	{
-		m_email.empty();
+		m_email.clear();
 		m_email.reserve(name.size());
 		m_name.removeAllWords();
 
@@ -324,7 +324,7 @@ void mailbox::parse(const string& buffer, const string::size_type position,
 	else
 	{
 		text::decodeAndUnfold(name, &m_name);
-		m_email.empty();
+		m_email.clear();
 		m_email.reserve(address.size());
 
 		for (string::size_type i = 0 ; i < address.size() ; ++i)

commit ec603c6c52734c44467f17dfded90a38e3516d3a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Mar 16 15:55:47 2010 +0000

    Migrated config script for newer versions of SCons.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@540 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 2452745..384c90f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -436,7 +436,7 @@ libvmime_dist_files += libvmime_autotools
 #  Set options  #
 #################
 
-EnsureSConsVersion(0, 94)
+EnsureSConsVersion(0, 98, 1)
 
 SetOption('implicit_cache', 1)
 
@@ -578,7 +578,10 @@ opts.AddVariables(
 #  Configuration Environment  #
 ###############################
 
-env = Environment(options = opts)
+try:
+	env = Environment(variables = opts)
+except TypeError:
+	env = Environment(options = opts)
 
 env.Append(ENV = os.environ)
 env.Append(ENV = {'PATH' : os.environ['PATH']})
@@ -953,7 +956,7 @@ Default(libVmime)
 # Tests
 if env['build_tests'] == 'yes':
 	if env['debug'] == 'yes':
-		env = env.Copy()
+		env = env.Clone()
 		env.Append(LIBS = ['cppunit', 'dl', packageVersionedGenericName + '-debug', 'pthread'])
 		env.Append(LIBPATH=['.'])
 		Default(

commit 586397b44f047e1c3be7936cf5538f32769c6e47
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Apr 8 18:28:22 2010 +0000

    Fixed parsing of non-significant whitespaces in field values.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@541 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp
index 090d5b4..464990e 100644
--- a/src/parameterizedHeaderField.cpp
+++ b/src/parameterizedHeaderField.cpp
@@ -85,12 +85,32 @@ void parameterizedHeaderField::parse(const string& buffer, const string::size_ty
 	const string::value_type* const pstart = buffer.data() + position;
 	const string::value_type* p = pstart;
 
-	const string::size_type start = position;
+	// Skip non-significant whitespaces
+	string::size_type valueStart = position;
 
-	while (p < pend && *p != ';') ++p;
+	while (p < pend && parserHelpers::isSpace(*p))
+	{
+		++p;
+		++valueStart;
+	}
+
+	// Advance up to ';', if any
+	string::size_type valueLength = 0;
+
+	while (p < pend && *p != ';')  // FIXME: support ";" inside quoted or RFC-2047-encoded text
+	{
+		++p;
+		++valueLength;
+	}
+
+	// Trim whitespaces at the end of the value
+	while (valueLength > 0 && parserHelpers::isSpace(buffer[valueStart + valueLength - 1]))
+		--valueLength;
 
-	getValue()->parse(buffer, start, position + (p - pstart));
+	// Parse value
+	getValue()->parse(buffer, valueStart, valueStart + valueLength);
 
+	// Reset parameters
 	removeAllParameters();
 
 	// If there is one or more parameters following...
diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp
index 6d24438..803bb59 100644
--- a/tests/parser/parameterTest.cpp
+++ b/tests/parser/parameterTest.cpp
@@ -36,6 +36,7 @@ VMIME_TEST_SUITE_BEGIN
 		VMIME_TEST(testGenerate)
 		VMIME_TEST(testGenerateRFC2231)
 		VMIME_TEST(testNonStandardEncodedParam)
+		VMIME_TEST(testParseNonSignificantWS)
 	VMIME_TEST_LIST_END
 
 
@@ -53,6 +54,7 @@ VMIME_TEST_SUITE_BEGIN
 	};
 
 
+#define FIELD_VALUE(f) (f.getValue()->generate())
 #define PARAM_VALUE(p, n) (p.getParameterAt(n)->getValue().generate())
 #define PARAM_NAME(p, n) (p.getParameterAt(n)->getName())
 #define PARAM_CHARSET(p, n) \
@@ -278,5 +280,22 @@ VMIME_TEST_SUITE_BEGIN
 		VASSERT_EQ("2.3", "Logo VMime.png", PARAM_VALUE(p2, 0));
 	}
 
+	// Parse parameters with non-significant whitespaces
+	void testParseNonSignificantWS()
+	{
+		parameterizedHeaderField p1;
+		p1.parse(" \t X   \r\n");
+
+		VASSERT_EQ("1.1", "X", FIELD_VALUE(p1));
+
+		parameterizedHeaderField p2;
+		p2.parse(" X  ; param1 =  value1 \r\n");
+
+		VASSERT_EQ("2.1", 1, p2.getParameterCount());
+		VASSERT_EQ("2.2", "X", FIELD_VALUE(p2));
+		VASSERT_EQ("2.3", "param1", PARAM_NAME(p2, 0));
+		VASSERT_EQ("2.4", "value1", PARAM_VALUE(p2, 0));
+	}
+
 VMIME_TEST_SUITE_END
 

commit 29a45062173bede8d485af035c92e00b894172f7
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Apr 10 06:43:40 2010 +0000

    Fixed duplicate shebang.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@542 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/bootstrap b/bootstrap
index 1540429..9c9c3d3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,4 +1,3 @@
-#! /bin/bash
 #! /usr/bin/env bash
 #
 # Bootstrap file for 'autotools' build

commit a198fe0e65788519507e527e6b0a52d25bd970a1
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Apr 13 09:51:30 2010 +0000

    Register non-standard encoding names.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@543 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/encoder/encoderFactory.cpp b/src/utility/encoder/encoderFactory.cpp
index 428788d..2237178 100644
--- a/src/utility/encoder/encoderFactory.cpp
+++ b/src/utility/encoder/encoderFactory.cpp
@@ -46,6 +46,10 @@ encoderFactory::encoderFactory()
 	registerName <sevenBitEncoder>("7bit");
 	registerName <eightBitEncoder>("8bit");
 	registerName <binaryEncoder>("binary");
+
+	// Also register some non-standard encoding names
+	registerName <sevenBitEncoder>("7-bit");
+	registerName <eightBitEncoder>("8-bit");
 }
 
 

commit 596b8882088f0c12f7c4ae1848b24cd521112131
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue May 4 10:07:56 2010 +0000

    Fixed typo.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@544 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 384c90f..d05f8bc 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1071,7 +1071,7 @@ def generateAutotools(target, source, env):
 	# Generate pkg-config file for shared and static library
 	vmime_pc_in = open(packageVersionedGenericName + ".pc.in", 'w')
 	vmime_pc_in.write("# File automatically generated by SConstruct ('scons autotools')\n")
-	vmime_pc_in.write("# DOT NOT EDIT!\n")
+	vmime_pc_in.write("# DO NOT EDIT!\n")
 	vmime_pc_in.write("\n")
 	vmime_pc_in.write("prefix=@prefix@\n")
 	vmime_pc_in.write("exec_prefix=@exec_prefix@\n")
@@ -1091,7 +1091,7 @@ def generateAutotools(target, source, env):
 	Makefile_am = open("Makefile.am", 'w')
 	Makefile_am.write("""
 # File automatically generated by SConstruct ('scons autotools')
-# DOT NOT EDIT!
+# DO NOT EDIT!
 
 BINDING =
 INCLUDE = vmime
@@ -1123,7 +1123,7 @@ docdir = $(datadir)/doc/$(GENERIC_LIBRARY_NAME)
 	Makefile_am = open("vmime/Makefile.am", 'w')
 	Makefile_am.write("""
 # File automatically generated by SConstruct ('scons autotools')
-# DOT NOT EDIT!
+# DO NOT EDIT!
 """)
 
 	#Makefile_am.write(packageVersionedName + "includedir = $(prefix)/include/@GENERIC_VERSIONED_LIBRARY_NAME@/@GENERIC_LIBRARY_NAME@\n")
@@ -1145,7 +1145,7 @@ docdir = $(datadir)/doc/$(GENERIC_LIBRARY_NAME)
 	Makefile_am = open("src/Makefile.am", 'w')
 	Makefile_am.write("""
 # File automatically generated by SConstruct ('scons autotools')
-# DOT NOT EDIT!
+# DO NOT EDIT!
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 INTERNALS =
@@ -1235,7 +1235,7 @@ noinst_HEADERS = $(INTERNALS)
 # configure.in
 
 # File automatically generated by SConstruct ('scons autotools')
-# DOT NOT EDIT!
+# DO NOT EDIT!
 
 # Init
 """)

commit 926e5c458c5e1c2950c29043e1f7464d26d20c6b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue May 4 10:49:10 2010 +0000

    Use STARTTLS for additional connections (thanks to Andrei).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@545 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index 6e5a265..825a002 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -156,7 +156,7 @@ void IMAPConnection::connect()
 	const bool tlsRequired = HAS_PROPERTY(PROPERTY_CONNECTION_TLS_REQUIRED)
 		&& GET_PROPERTY(bool, PROPERTY_CONNECTION_TLS_REQUIRED);
 
-	if (!store->isSecuredConnection() && tls)  // only if not IMAPS
+	if (!store->isIMAPS() && tls)  // only if not IMAPS
 	{
 		try
 		{

commit 9577cf0e03906b13210de550ee806f92fc45a373
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri May 14 16:56:20 2010 +0000

    Fixed parsing of header field value with no data on the first line (folding).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@546 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/headerField.cpp b/src/headerField.cpp
index 52fe7e8..cdde8ec 100644
--- a/src/headerField.cpp
+++ b/src/headerField.cpp
@@ -146,6 +146,12 @@ ref <headerField> headerField::parseNext(const string& buffer, const string::siz
 				{
 					c = buffer[pos];
 
+					// Check for folded line
+					if (c == '\r' && pos + 2 < end && buffer[pos + 1] == '\n' &&
+						(buffer[pos + 2] == ' ' || buffer[pos + 2] == '\t'))
+					{
+						pos += 3;
+					}
 					// Check for end of contents
 					if (c == '\r' && pos + 1 < end && buffer[pos + 1] == '\n')
 					{

commit 25cb2c1432f4912106ab70dc1cea00fee21b91c0
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue May 18 13:52:27 2010 +0000

    Added helper function to construct parsed message from net message. Splitted IMAP source files.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@547 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/ChangeLog b/ChangeLog
index 4031746..b824b4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 VERSION 0.9.1svn
 ================
 
+2010-05-18  Vincent Richard  <vincent@vincent-richard.net>
+
+ * net/*: added helper function vmime::net::message::getParsedMessage()
+   to construct a RFC-822 parsed message from a net message.
+
 2009-09-06  Vincent Richard  <vincent@vincent-richard.net>
 
  * Relicensed VMime under the GNU GPL license version 3. Dual licensing
diff --git a/SConstruct b/SConstruct
index d05f8bc..99b2190 100644
--- a/SConstruct
+++ b/SConstruct
@@ -261,6 +261,9 @@ libvmime_messaging_proto_sources = [
 			'net/imap/IMAPMessage.cpp',      'net/imap/IMAPMessage.hpp',
 			'net/imap/IMAPTag.cpp',          'net/imap/IMAPTag.hpp',
 			'net/imap/IMAPUtils.cpp',        'net/imap/IMAPUtils.hpp',
+			'net/imap/IMAPMessagePartContentHandler.cpp', 'net/imap/IMAPMessagePartContentHandler.hpp',
+			'net/imap/IMAPStructure.cpp',    'net/imap/IMAPStructure.hpp',
+			'net/imap/IMAPPart.cpp',         'net/imap/IMAPPart.hpp',
 			'net/imap/IMAPParser.hpp',
 		]
 	],
diff --git a/src/bodyPart.cpp b/src/bodyPart.cpp
index 20bb102..7d60461 100644
--- a/src/bodyPart.cpp
+++ b/src/bodyPart.cpp
@@ -37,6 +37,15 @@ bodyPart::bodyPart()
 }
 
 
+bodyPart::bodyPart(weak_ref <vmime::bodyPart> parentPart)
+	: m_header(vmime::create <header>()),
+	  m_body(vmime::create <body>()),
+	  m_parent(parentPart)
+{
+	m_body->setParentPart(thisRef().dynamicCast <bodyPart>());
+}
+
+
 void bodyPart::parse(const string& buffer, const string::size_type position,
 	const string::size_type end, string::size_type* newPosition)
 {
diff --git a/src/headerField.cpp b/src/headerField.cpp
index cdde8ec..d1d4236 100644
--- a/src/headerField.cpp
+++ b/src/headerField.cpp
@@ -300,7 +300,8 @@ const std::vector <ref <const component> > headerField::getChildComponents() con
 {
 	std::vector <ref <const component> > list;
 
-	list.push_back(m_value);
+	if (m_value)
+		list.push_back(m_value);
 
 	return (list);
 }
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 29c2aea..adfef01 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -27,6 +27,9 @@
 #include "vmime/net/imap/IMAPStore.hpp"
 #include "vmime/net/imap/IMAPConnection.hpp"
 #include "vmime/net/imap/IMAPUtils.hpp"
+#include "vmime/net/imap/IMAPStructure.hpp"
+#include "vmime/net/imap/IMAPPart.hpp"
+#include "vmime/net/imap/IMAPMessagePartContentHandler.hpp"
 
 #include <sstream>
 #include <iterator>
@@ -38,198 +41,6 @@ namespace net {
 namespace imap {
 
 
-//
-// IMAPpart
-//
-
-class IMAPstructure;
-
-class IMAPpart : public part
-{
-private:
-
-	friend class vmime::creator;
-
-	IMAPpart(ref <IMAPpart> parent, const int number, const IMAPParser::body_type_mpart* mpart);
-	IMAPpart(ref <IMAPpart> parent, const int number, const IMAPParser::body_type_1part* part);
-
-public:
-
-	ref <const structure> getStructure() const;
-	ref <structure> getStructure();
-
-	ref <const IMAPpart> getParent() const { return m_parent.acquire(); }
-
-	const mediaType& getType() const { return (m_mediaType); }
-	int getSize() const { return (m_size); }
-	int getNumber() const { return (m_number); }
-
-	ref <const header> getHeader() const
-	{
-		if (m_header == NULL)
-			throw exceptions::unfetched_object();
-		else
-			return m_header;
-	}
-
-
-	static ref <IMAPpart> create
-		(ref <IMAPpart> parent, const int number, const IMAPParser::body* body)
-	{
-		if (body->body_type_mpart())
-		{
-			ref <IMAPpart> part = vmime::create <IMAPpart>(parent, number, body->body_type_mpart());
-			part->m_structure = vmime::create <IMAPstructure>(part, body->body_type_mpart()->list());
-
-			return part;
-		}
-		else
-		{
-			return vmime::create <IMAPpart>(parent, number, body->body_type_1part());
-		}
-	}
-
-
-	header& getOrCreateHeader()
-	{
-		if (m_header != NULL)
-			return (*m_header);
-		else
-			return (*(m_header = vmime::create <header>()));
-	}
-
-private:
-
-	ref <IMAPstructure> m_structure;
-	weak_ref <IMAPpart> m_parent;
-	ref <header> m_header;
-
-	int m_number;
-	int m_size;
-	mediaType m_mediaType;
-};
-
-
-
-//
-// IMAPstructure
-//
-
-class IMAPstructure : public structure
-{
-public:
-
-	IMAPstructure()
-	{
-	}
-
-	IMAPstructure(const IMAPParser::body* body)
-	{
-		m_parts.push_back(IMAPpart::create(NULL, 0, body));
-	}
-
-	IMAPstructure(ref <IMAPpart> parent, const std::vector <IMAPParser::body*>& list)
-	{
-		int number = 0;
-
-		for (std::vector <IMAPParser::body*>::const_iterator
-		     it = list.begin() ; it != list.end() ; ++it, ++number)
-		{
-			m_parts.push_back(IMAPpart::create(parent, number, *it));
-		}
-	}
-
-
-	ref <const part> getPartAt(const int x) const
-	{
-		return m_parts[x];
-	}
-
-	ref <part> getPartAt(const int x)
-	{
-		return m_parts[x];
-	}
-
-	int getPartCount() const
-	{
-		return m_parts.size();
-	}
-
-
-	static ref <IMAPstructure> emptyStructure()
-	{
-		return (m_emptyStructure);
-	}
-
-private:
-
-	static ref <IMAPstructure> m_emptyStructure;
-
-	std::vector <ref <IMAPpart> > m_parts;
-};
-
-
-ref <IMAPstructure> IMAPstructure::m_emptyStructure = vmime::create <IMAPstructure>();
-
-
-
-IMAPpart::IMAPpart(ref <IMAPpart> parent, const int number, const IMAPParser::body_type_mpart* mpart)
-	: m_parent(parent), m_header(NULL), m_number(number), m_size(0)
-{
-	m_mediaType = vmime::mediaType
-		("multipart", mpart->media_subtype()->value());
-}
-
-
-IMAPpart::IMAPpart(ref <IMAPpart> parent, const int number, const IMAPParser::body_type_1part* part)
-	: m_parent(parent), m_header(NULL), m_number(number), m_size(0)
-{
-	if (part->body_type_text())
-	{
-		m_mediaType = vmime::mediaType
-			("text", part->body_type_text()->
-				media_text()->media_subtype()->value());
-
-		m_size = part->body_type_text()->body_fields()->body_fld_octets()->value();
-	}
-	else if (part->body_type_msg())
-	{
-		m_mediaType = vmime::mediaType
-			("message", part->body_type_msg()->
-				media_message()->media_subtype()->value());
-	}
-	else
-	{
-		m_mediaType = vmime::mediaType
-			(part->body_type_basic()->media_basic()->media_type()->value(),
-			 part->body_type_basic()->media_basic()->media_subtype()->value());
-
-		m_size = part->body_type_basic()->body_fields()->body_fld_octets()->value();
-	}
-
-	m_structure = NULL;
-}
-
-
-ref <const structure> IMAPpart::getStructure() const
-{
-	if (m_structure != NULL)
-		return (m_structure);
-	else
-		return (IMAPstructure::emptyStructure());
-}
-
-
-ref <structure> IMAPpart::getStructure()
-{
-	if (m_structure != NULL)
-		return (m_structure);
-	else
-		return (IMAPstructure::emptyStructure());
-}
-
-
-
 #ifndef VMIME_BUILDING_DOC
 
 //
@@ -400,7 +211,22 @@ void IMAPMessage::fetchPartHeader(ref <part> p)
 
 	extract(p, ossAdapter, NULL, 0, -1, true, true);
 
-	p.dynamicCast <IMAPpart>()->getOrCreateHeader().parse(oss.str());
+	p.dynamicCast <IMAPPart>()->getOrCreateHeader().parse(oss.str());
+}
+
+
+void IMAPMessage::fetchPartHeaderForStructure(ref <structure> str)
+{
+	for (int i = 0, n = str->getPartCount() ; i < n ; ++i)
+	{
+		ref <class part> part = str->getPartAt(i);
+
+		// Fetch header of current part
+		fetchPartHeader(part);
+
+		// Fetch header of sub-parts
+		fetchPartHeaderForStructure(part->getStructure());
+	}
 }
 
 
@@ -418,7 +244,7 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
 
 	if (p != NULL)
 	{
-		ref <const IMAPpart> currentPart = p.dynamicCast <const IMAPpart>();
+		ref <const IMAPPart> currentPart = p.dynamicCast <const IMAPPart>();
 		std::vector <int> numbers;
 
 		numbers.push_back(currentPart->getNumber());
@@ -446,8 +272,17 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
 	command << "FETCH " << m_num << " BODY";
 	if (peek) command << ".PEEK";
 	command << "[";
-	command << section.str();
-	if (headerOnly) command << ".MIME";   // "MIME" not "HEADER" for parts
+
+	if (section.str().empty() && headerOnly)
+	{
+		command << "HEADER";
+	}
+	else
+	{
+		command << section.str();
+		if (headerOnly) command << ".MIME";   // "MIME" not "HEADER" for parts
+	}
+
 	command << "]";
 
 	if (start != 0 || length != -1)
@@ -621,7 +456,7 @@ void IMAPMessage::processFetchResponse
 		}
 		case IMAPParser::msg_att_item::BODY_STRUCTURE:
 		{
-			m_structure = vmime::create <IMAPstructure>((*it)->body());
+			m_structure = vmime::create <IMAPStructure>((*it)->body());
 			break;
 		}
 		case IMAPParser::msg_att_item::RFC822_HEADER:
@@ -796,6 +631,80 @@ void IMAPMessage::setFlags(const int flags, const int mode)
 }
 
 
+void IMAPMessage::constructParsedMessage(ref <bodyPart> parentPart, ref <structure> str, int level)
+{
+	if (level == 0)
+	{
+		ref <class part> part = str->getPartAt(0);
+
+		// Copy header
+		ref <const header> hdr = part->getHeader();
+		parentPart->getHeader()->copyFrom(*hdr);
+
+		// Initialize body
+		parentPart->getBody()->setContents
+			(vmime::create <IMAPMessagePartContentHandler>
+				(thisRef().dynamicCast <IMAPMessage>(),
+				 part, parentPart->getBody()->getEncoding()));
+
+		constructParsedMessage(parentPart, part->getStructure(), 1);
+	}
+	else
+	{
+		for (int i = 0, n = str->getPartCount() ; i < n ; ++i)
+		{
+			ref <class part> part = str->getPartAt(i);
+
+			ref <bodyPart> childPart = vmime::create <bodyPart>();
+
+			// Copy header
+			ref <const header> hdr = part->getHeader();
+			childPart->getHeader()->copyFrom(*hdr);
+
+			// Initialize body
+			childPart->getBody()->setContents
+				(vmime::create <IMAPMessagePartContentHandler>
+					(thisRef().dynamicCast <IMAPMessage>(),
+					 part, childPart->getBody()->getEncoding()));
+
+			// Add child part
+			parentPart->getBody()->appendPart(childPart);
+
+			// Construct sub parts
+			constructParsedMessage(childPart, part->getStructure(), ++level);
+		}
+	}
+}
+
+
+ref <vmime::message> IMAPMessage::getParsedMessage()
+{
+	// Fetch structure
+	ref <structure> structure = NULL;
+
+	try
+	{
+		structure = getStructure();
+	}
+	catch (exceptions::unfetched_object&)
+	{
+		fetch(m_folder.acquire(), IMAPFolder::FETCH_STRUCTURE);
+		structure = getStructure();
+	}
+
+	// Fetch header for each part
+	fetchPartHeaderForStructure(structure);
+
+	// Construct message from structure
+	ref <vmime::message> msg = vmime::create <vmime::message>();
+
+	constructParsedMessage(msg, structure);
+
+	return msg;
+}
+
+
 } // imap
 } // net
 } // vmime
+
diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp
new file mode 100644
index 0000000..12d387c
--- /dev/null
+++ b/src/net/imap/IMAPMessagePartContentHandler.cpp
@@ -0,0 +1,179 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#include "vmime/net/imap/imapmessagepartcontenthandler.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+IMAPMessagePartContentHandler::IMAPMessagePartContentHandler
+	(ref <IMAPMessage> msg, ref <class part> part, const vmime::encoding& encoding)
+	: m_message(msg), m_part(part), m_encoding(encoding)
+{
+}
+
+
+ref <contentHandler> IMAPMessagePartContentHandler::clone() const
+{
+	return create <IMAPMessagePartContentHandler>
+		(m_message.acquire().constCast <IMAPMessage>(),
+		 m_part.acquire().constCast <part>(),
+		 m_encoding);
+}
+
+
+void IMAPMessagePartContentHandler::generate
+	(utility::outputStream& os, const vmime::encoding& enc, const string::size_type maxLineLength) const
+{
+	ref <IMAPMessage> msg = m_message.acquire().constCast <IMAPMessage>();
+	ref <part> part = m_part.acquire().constCast <class part>();
+
+	// Data is already encoded
+	if (isEncoded())
+	{
+		// The data is already encoded but the encoding specified for
+		// the generation is different from the current one. We need
+		// to re-encode data: decode from input buffer to temporary
+		// buffer, and then re-encode to output stream...
+		if (m_encoding != enc)
+		{
+			// Extract part contents to temporary buffer
+			std::ostringstream oss;
+			utility::outputStreamAdapter tmp(oss);
+
+			msg->extractPart(part, tmp, NULL);
+
+			// Decode to another temporary buffer
+			utility::inputStreamStringProxyAdapter in(oss.str());
+
+			std::ostringstream oss2;
+			utility::outputStreamAdapter tmp2(oss2);
+
+			ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
+			theDecoder->decode(in, tmp2);
+
+			// Reencode to output stream
+			string str = oss2.str();
+			utility::inputStreamStringAdapter tempIn(str);
+
+			ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
+			theEncoder->getProperties()["maxlinelength"] = maxLineLength;
+			theEncoder->encode(tempIn, os);
+		}
+		// No encoding to perform
+		else
+		{
+			msg->extractPart(part, os);
+		}
+	}
+	// Need to encode data before
+	else
+	{
+		// Extract part contents to temporary buffer
+		std::ostringstream oss;
+		utility::outputStreamAdapter tmp(oss);
+
+		msg->extractPart(part, tmp, NULL);
+
+		// Encode temporary buffer to output stream
+		ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
+		theEncoder->getProperties()["maxlinelength"] = maxLineLength;
+
+		utility::inputStreamStringAdapter is(oss.str());
+
+		theEncoder->encode(is, os);
+	}
+}
+
+
+void IMAPMessagePartContentHandler::extract
+	(utility::outputStream& os, utility::progressListener* progress) const
+{
+	ref <IMAPMessage> msg = m_message.acquire().constCast <IMAPMessage>();
+	ref <part> part = m_part.acquire().constCast <class part>();
+
+	// No decoding to perform
+	if (!isEncoded())
+	{
+		msg->extractPart(part, os, progress);
+	}
+	// Need to decode data
+	else
+	{
+		// Extract part contents to temporary buffer
+		std::ostringstream oss;
+		utility::outputStreamAdapter tmp(oss);
+
+		msg->extractPart(part, tmp, NULL);
+
+		// Encode temporary buffer to output stream
+		utility::inputStreamStringAdapter is(oss.str());
+		utility::progressListenerSizeAdapter plsa(progress, getLength());
+
+		ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
+		theDecoder->decode(is, os, &plsa);
+	}
+}
+
+
+void IMAPMessagePartContentHandler::extractRaw
+	(utility::outputStream& os, utility::progressListener* progress) const
+{
+	ref <IMAPMessage> msg = m_message.acquire().constCast <IMAPMessage>();
+	ref <part> part = m_part.acquire().constCast <class part>();
+
+	msg->extractPart(part, os, progress);
+}
+
+
+string::size_type IMAPMessagePartContentHandler::getLength() const
+{
+	return m_part.acquire()->getSize();
+}
+
+
+bool IMAPMessagePartContentHandler::isEncoded() const
+{
+	return m_encoding != NO_ENCODING;
+}
+
+
+const vmime::encoding& IMAPMessagePartContentHandler::getEncoding() const
+{
+	return m_encoding;
+}
+
+
+bool IMAPMessagePartContentHandler::isEmpty() const
+{
+	return getLength() == 0;
+}
+
+
+} // imap
+} // net
+} // vmime
+
diff --git a/src/net/imap/IMAPPart.cpp b/src/net/imap/IMAPPart.cpp
new file mode 100644
index 0000000..32021e8
--- /dev/null
+++ b/src/net/imap/IMAPPart.cpp
@@ -0,0 +1,152 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#include "vmime/net/imap/IMAPPart.hpp"
+#include "vmime/net/imap/IMAPStructure.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+IMAPPart::IMAPPart(ref <IMAPPart> parent, const int number, const IMAPParser::body_type_mpart* mpart)
+	: m_parent(parent), m_header(NULL), m_number(number), m_size(0)
+{
+	m_mediaType = vmime::mediaType
+		("multipart", mpart->media_subtype()->value());
+}
+
+
+IMAPPart::IMAPPart(ref <IMAPPart> parent, const int number, const IMAPParser::body_type_1part* part)
+	: m_parent(parent), m_header(NULL), m_number(number), m_size(0)
+{
+	if (part->body_type_text())
+	{
+		m_mediaType = vmime::mediaType
+			("text", part->body_type_text()->
+				media_text()->media_subtype()->value());
+
+		m_size = part->body_type_text()->body_fields()->body_fld_octets()->value();
+	}
+	else if (part->body_type_msg())
+	{
+		m_mediaType = vmime::mediaType
+			("message", part->body_type_msg()->
+				media_message()->media_subtype()->value());
+	}
+	else
+	{
+		m_mediaType = vmime::mediaType
+			(part->body_type_basic()->media_basic()->media_type()->value(),
+			 part->body_type_basic()->media_basic()->media_subtype()->value());
+
+		m_size = part->body_type_basic()->body_fields()->body_fld_octets()->value();
+	}
+
+	m_structure = NULL;
+}
+
+
+ref <const structure> IMAPPart::getStructure() const
+{
+	if (m_structure != NULL)
+		return m_structure;
+	else
+		return IMAPStructure::emptyStructure();
+}
+
+
+ref <structure> IMAPPart::getStructure()
+{
+	if (m_structure != NULL)
+		return m_structure;
+	else
+		return IMAPStructure::emptyStructure();
+}
+
+
+ref <const IMAPPart> IMAPPart::getParent() const
+{
+	return m_parent.acquire();
+}
+
+
+const mediaType& IMAPPart::getType() const
+{
+	return m_mediaType;
+}
+
+
+int IMAPPart::getSize() const
+{
+	return m_size;
+}
+
+
+int IMAPPart::getNumber() const
+{
+	return m_number;
+}
+
+
+ref <const header> IMAPPart::getHeader() const
+{
+	if (m_header == NULL)
+		throw exceptions::unfetched_object();
+	else
+		return m_header;
+}
+
+
+// static
+ref <IMAPPart> IMAPPart::create
+	(ref <IMAPPart> parent, const int number, const IMAPParser::body* body)
+{
+	if (body->body_type_mpart())
+	{
+		ref <IMAPPart> part = vmime::create <IMAPPart>(parent, number, body->body_type_mpart());
+		part->m_structure = vmime::create <IMAPStructure>(part, body->body_type_mpart()->list());
+
+		return part;
+	}
+	else
+	{
+		return vmime::create <IMAPPart>(parent, number, body->body_type_1part());
+	}
+}
+
+
+header& IMAPPart::getOrCreateHeader()
+{
+	if (m_header != NULL)
+		return *m_header;
+	else
+		return *(m_header = vmime::create <header>());
+}
+
+
+} // imap
+} // net
+} // vmime
+
diff --git a/src/net/imap/IMAPStructure.cpp b/src/net/imap/IMAPStructure.cpp
new file mode 100644
index 0000000..357febe
--- /dev/null
+++ b/src/net/imap/IMAPStructure.cpp
@@ -0,0 +1,85 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#include "vmime/net/imap/IMAPStructure.hpp"
+#include "vmime/net/imap/IMAPPart.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+IMAPStructure::IMAPStructure()
+{
+}
+
+
+IMAPStructure::IMAPStructure(const IMAPParser::body* body)
+{
+	m_parts.push_back(IMAPPart::create(NULL, 0, body));
+}
+
+
+IMAPStructure::IMAPStructure(ref <IMAPPart> parent, const std::vector <IMAPParser::body*>& list)
+{
+	int number = 0;
+
+	for (std::vector <IMAPParser::body*>::const_iterator
+	     it = list.begin() ; it != list.end() ; ++it, ++number)
+	{
+		m_parts.push_back(IMAPPart::create(parent, number, *it));
+	}
+}
+
+
+ref <const part> IMAPStructure::getPartAt(const int x) const
+{
+	return m_parts[x];
+}
+
+
+ref <part> IMAPStructure::getPartAt(const int x)
+{
+	return m_parts[x];
+}
+
+
+int IMAPStructure::getPartCount() const
+{
+	return m_parts.size();
+}
+
+
+// static
+ref <IMAPStructure> IMAPStructure::emptyStructure()
+{
+	static ref <IMAPStructure> emptyStructure = vmime::create <IMAPStructure>();
+	return emptyStructure;
+}
+
+
+} // imap
+} // net
+} // vmime
+
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index 8999d84..51cd1ba 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -524,6 +524,20 @@ ref <header> maildirMessage::getOrCreateHeader()
 }
 
 
+ref <vmime::message> maildirMessage::getParsedMessage()
+{
+	std::ostringstream oss;
+	utility::outputStreamAdapter os(oss);
+
+	extract(os);
+
+	vmime::ref <vmime::message> msg = vmime::create <vmime::message>();
+	msg->parse(oss.str());
+
+	return msg;
+}
+
+
 } // maildir
 } // net
 } // vmime
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index b38951b..50f4f87 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -218,6 +218,20 @@ void POP3Message::setFlags(const int /* flags */, const int /* mode */)
 }
 
 
+ref <vmime::message> POP3Message::getParsedMessage()
+{
+	std::ostringstream oss;
+	utility::outputStreamAdapter os(oss);
+
+	extract(os);
+
+	vmime::ref <vmime::message> msg = vmime::create <vmime::message>();
+	msg->parse(oss.str());
+
+	return msg;
+}
+
+
 } // pop3
 } // net
 } // vmime
diff --git a/vmime/bodyPart.hpp b/vmime/bodyPart.hpp
index 47c11cb..aa0f040 100644
--- a/vmime/bodyPart.hpp
+++ b/vmime/bodyPart.hpp
@@ -46,6 +46,7 @@ class bodyPart : public component
 public:
 
 	bodyPart();
+	bodyPart(weak_ref <vmime::bodyPart> parentPart);
 
 	/** Return the header section of this part.
 	  *
diff --git a/vmime/contentHandler.hpp b/vmime/contentHandler.hpp
index aa485f5..38e4e24 100644
--- a/vmime/contentHandler.hpp
+++ b/vmime/contentHandler.hpp
@@ -87,7 +87,8 @@ public:
 	virtual void extractRaw(utility::outputStream& os, utility::progressListener* progress = NULL) const = 0;
 
 	/** Returns the actual length of data. WARNING: this can return 0 if no
-	  * length was specified when setting data of this object.
+	  * length was specified when setting data of this object, or if the
+	  * length is not known).
 	  *
 	  * @return length of data
 	  */
diff --git a/vmime/net/imap/IMAPMessage.hpp b/vmime/net/imap/IMAPMessage.hpp
index 690e5e2..edbf69f 100644
--- a/vmime/net/imap/IMAPMessage.hpp
+++ b/vmime/net/imap/IMAPMessage.hpp
@@ -28,6 +28,8 @@
 #include "vmime/net/message.hpp"
 #include "vmime/net/folder.hpp"
 
+#include "vmime/net/imap/IMAPParser.hpp"
+
 
 namespace vmime {
 namespace net {
@@ -75,12 +77,29 @@ public:
 
 	void fetchPartHeader(ref <part> p);
 
+	ref <vmime::message> getParsedMessage();
+
 private:
 
 	void fetch(ref <IMAPFolder> folder, const int options);
 
 	void processFetchResponse(const int options, const IMAPParser::msg_att* msgAtt);
 
+	/** Recursively fetch part header for all parts in the structure.
+	  *
+	  * @param str structure for which to fetch parts headers
+	  */
+	void fetchPartHeaderForStructure(ref <structure> str);
+
+	/** Recursively contruct parsed message from structure.
+	  * Called by getParsedMessage().
+	  *
+	  * @param parentPart root body part (the message)
+	  * @param str structure for which to construct part
+	  * @param level current nesting level (0 is root)
+	  */
+	void constructParsedMessage(ref <bodyPart> parentPart, ref <structure> str, int level = 0);
+
 	void extract(ref <const part> p, utility::outputStream& os, utility::progressListener* progress, const int start, const int length, const bool headerOnly, const bool peek) const;
 
 
diff --git a/vmime/net/imap/IMAPMessagePartContentHandler.hpp b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
new file mode 100644
index 0000000..0c4641e
--- /dev/null
+++ b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
@@ -0,0 +1,73 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#ifndef VMIME_NET_IMAP_IMAPMESSAGEPARTCONTENTHANDLER_HPP_INCLUDED
+#define VMIME_NET_IMAP_IMAPMESSAGEPARTCONTENTHANDLER_HPP_INCLUDED
+
+
+#include "vmime/contentHandler.hpp"
+#include "vmime/net/imap/IMAPMessage.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+class IMAPMessagePartContentHandler : public contentHandler
+{
+public:
+
+	IMAPMessagePartContentHandler(ref <IMAPMessage> msg, ref <class part> part, const vmime::encoding& encoding);
+
+	ref <contentHandler> clone() const;
+
+	void generate(utility::outputStream& os, const vmime::encoding& enc, const string::size_type maxLineLength = lineLengthLimits::infinite) const;
+
+	void extract(utility::outputStream& os, utility::progressListener* progress = NULL) const;
+	void extractRaw(utility::outputStream& os, utility::progressListener* progress = NULL) const;
+
+	string::size_type getLength() const;
+
+	bool isEncoded() const;
+
+	const vmime::encoding& getEncoding() const;
+
+	bool isEmpty() const;
+
+private:
+
+	weak_ref <IMAPMessage> m_message;
+	weak_ref <part> m_part;
+
+	vmime::encoding m_encoding;
+};
+
+
+} // imap
+} // net
+} // vmime
+
+
+#endif // VMIME_NET_IMAP_IMAPMESSAGEPARTCONTENTHANDLER_HPP_INCLUDED
+
diff --git a/vmime/net/imap/IMAPPart.hpp b/vmime/net/imap/IMAPPart.hpp
new file mode 100644
index 0000000..d84db1b
--- /dev/null
+++ b/vmime/net/imap/IMAPPart.hpp
@@ -0,0 +1,88 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#ifndef VMIME_NET_IMAP_IMAPPART_HPP_INCLUDED
+#define VMIME_NET_IMAP_IMAPPART_HPP_INCLUDED
+
+
+#include "vmime/net/message.hpp"
+
+#include "vmime/net/imap/IMAPParser.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+class IMAPStructure;
+
+
+class IMAPPart : public part
+{
+private:
+
+	friend class vmime::creator;
+
+	IMAPPart(ref <IMAPPart> parent, const int number, const IMAPParser::body_type_mpart* mpart);
+	IMAPPart(ref <IMAPPart> parent, const int number, const IMAPParser::body_type_1part* part);
+
+public:
+
+	ref <const structure> getStructure() const;
+	ref <structure> getStructure();
+
+	ref <const IMAPPart> getParent() const;
+
+	const mediaType& getType() const;
+	int getSize() const;
+	int getNumber() const;
+
+	ref <const header> getHeader() const;
+
+
+	static ref <IMAPPart> create
+		(ref <IMAPPart> parent, const int number, const IMAPParser::body* body);
+
+
+	header& getOrCreateHeader();
+
+private:
+
+	ref <IMAPStructure> m_structure;
+	weak_ref <IMAPPart> m_parent;
+	ref <header> m_header;
+
+	int m_number;
+	int m_size;
+	mediaType m_mediaType;
+};
+
+
+} // imap
+} // net
+} // vmime
+
+
+#endif // VMIME_NET_IMAP_IMAPPART_HPP_INCLUDED
+
diff --git a/vmime/net/imap/IMAPStructure.hpp b/vmime/net/imap/IMAPStructure.hpp
new file mode 100644
index 0000000..e43676c
--- /dev/null
+++ b/vmime/net/imap/IMAPStructure.hpp
@@ -0,0 +1,67 @@
+//
+// VMime library (http://www.vmime.org)
+// Copyright (C) 2002-2009 Vincent Richard <vincent@vincent-richard.net>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 3 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Linking this library statically or dynamically with other modules is making
+// a combined work based on this library.  Thus, the terms and conditions of
+// the GNU General Public License cover the whole combination.
+//
+
+#ifndef VMIME_NET_IMAP_IMAPSTRUCTURE_HPP_INCLUDED
+#define VMIME_NET_IMAP_IMAPSTRUCTURE_HPP_INCLUDED
+
+
+#include "vmime/net/message.hpp"
+
+#include "vmime/net/imap/IMAPParser.hpp"
+
+
+namespace vmime {
+namespace net {
+namespace imap {
+
+
+class IMAPPart;
+
+
+class IMAPStructure : public structure
+{
+public:
+
+	IMAPStructure();
+	IMAPStructure(const IMAPParser::body* body);
+	IMAPStructure(ref <IMAPPart> parent, const std::vector <IMAPParser::body*>& list);
+
+	ref <const part> getPartAt(const int x) const;
+	ref <part> getPartAt(const int x);
+	int getPartCount() const;
+
+	static ref <IMAPStructure> emptyStructure();
+
+private:
+
+	std::vector <ref <IMAPPart> > m_parts;
+};
+
+
+} // imap
+} // net
+} // vmime
+
+
+#endif // VMIME_NET_IMAP_IMAPSTRUCTURE_HPP_INCLUDED
+
diff --git a/vmime/net/maildir/maildirMessage.hpp b/vmime/net/maildir/maildirMessage.hpp
index ba3c88e..cd66d43 100644
--- a/vmime/net/maildir/maildirMessage.hpp
+++ b/vmime/net/maildir/maildirMessage.hpp
@@ -75,6 +75,8 @@ public:
 
 	void fetchPartHeader(ref <part> p);
 
+	ref <vmime::message> getParsedMessage();
+
 private:
 
 	void fetch(ref <maildirFolder> folder, const int options);
diff --git a/vmime/net/message.hpp b/vmime/net/message.hpp
index a0cc1da..b6ebef8 100644
--- a/vmime/net/message.hpp
+++ b/vmime/net/message.hpp
@@ -31,6 +31,8 @@
 #include "vmime/utility/progressListener.hpp"
 #include "vmime/utility/stream.hpp"
 
+#include "vmime/message.hpp"
+
 
 namespace vmime {
 namespace net {
@@ -286,6 +288,16 @@ public:
 	  * @param p the part for which to fetch the header
 	  */
 	virtual void fetchPartHeader(ref <part> p) = 0;
+
+	/** Get the RFC-822 message for this abstract message.
+	  * Warning: This may require getting some data (ie: structure and headers) from
+	  * the server, which is done automatically. Actual message contents (ie: body)
+	  * will not be fetched if possible (IMAP allows it, whereas POP3 will require
+	  * to fetch the whole message).
+	  *
+	  * @return a RFC-822-parsed message
+	  */
+	virtual ref <vmime::message> getParsedMessage() = 0;
 };
 
 
diff --git a/vmime/net/pop3/POP3Message.hpp b/vmime/net/pop3/POP3Message.hpp
index 5dbea3f..337cc5d 100644
--- a/vmime/net/pop3/POP3Message.hpp
+++ b/vmime/net/pop3/POP3Message.hpp
@@ -77,6 +77,8 @@ public:
 
 	void fetchPartHeader(ref <part> p);
 
+	ref <vmime::message> getParsedMessage();
+
 private:
 
 	void fetch(ref <POP3Folder> folder, const int options);

commit 6a967daa852e3ef6f277e8bbcf50e07770d04661
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu May 20 09:57:51 2010 +0000

    Fixed type size.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@548 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index 6d99e3f..e4bcea4 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -135,7 +135,7 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len)
 
 void sha1MessageDigest::finalize()
 {
-	unsigned long i, j;
+	unsigned int i, j;
 	unsigned char finalcount[8];
 
 	for (i = 0 ; i < 8 ; i++)
@@ -162,8 +162,8 @@ void sha1MessageDigest::finalize()
 	i = j = 0;
 
 	std::memset(m_buffer, 0, 64);
-	std::memset(m_state, 0, 5 * sizeof(unsigned long));
-	std::memset(m_count, 0, 2 * sizeof(unsigned long));
+	std::memset(m_state, 0, 5 * sizeof(unsigned int));
+	std::memset(m_count, 0, 2 * sizeof(unsigned int));
 	std::memset(&finalcount, 0, 8);
 }
 
@@ -192,17 +192,17 @@ void sha1MessageDigest::finalize(const byte_t* buffer,
   * This is the core of the algorithm.
   */
 void sha1MessageDigest::transform
-	(unsigned long state[5], const unsigned char buffer[64])
+	(unsigned int state[5], const unsigned char buffer[64])
 {
-	unsigned long a, b, c, d, e;
+	unsigned int a, b, c, d, e;
 
 	typedef union
 	{
 		unsigned char c[64];
-		unsigned long l[16];
+		unsigned int l[16];
 	} CHAR64LONG16;
 
-	assert(sizeof(unsigned long) == 4);
+	assert(sizeof(unsigned int) == 4);
 
 	CHAR64LONG16* block;
 	static unsigned char workspace[64];
diff --git a/vmime/security/digest/sha1/sha1MessageDigest.hpp b/vmime/security/digest/sha1/sha1MessageDigest.hpp
index 906009a..c8da349 100644
--- a/vmime/security/digest/sha1/sha1MessageDigest.hpp
+++ b/vmime/security/digest/sha1/sha1MessageDigest.hpp
@@ -59,10 +59,10 @@ protected:
 
 	void init();
 
-	static void transform(unsigned long state[5], const byte_t buffer[64]);
+	static void transform(unsigned int state[5], const byte_t buffer[64]);
 
-	unsigned long m_state[5];
-	unsigned long m_count[2];
+	unsigned int m_state[5];
+	unsigned int m_count[2];
 	byte_t m_buffer[64];
 
 	byte_t m_digest[20];

commit 90f9e6fb020975996377f09e0569a17b8feaaf71
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu May 20 10:00:19 2010 +0000

    Fixed unit tests build on OSX.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@549 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/SConstruct b/SConstruct
index 99b2190..fb01edf 100644
--- a/SConstruct
+++ b/SConstruct
@@ -962,6 +962,10 @@ if env['build_tests'] == 'yes':
 		env = env.Clone()
 		env.Append(LIBS = ['cppunit', 'dl', packageVersionedGenericName + '-debug', 'pthread'])
 		env.Append(LIBPATH=['.'])
+
+		if sys.platform == "mac" or sys.platform == "darwin":
+			env.Append(LIBS = ['iconv', 'gcrypt'])
+
 		Default(
 			env.Program(
 				target = 'run-tests',

commit 8bdccea503ad998f029a13e3963877c416a6bc0c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu May 20 15:28:51 2010 +0000

    Fixed case-sensitive include.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@550 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp
index 12d387c..a226b68 100644
--- a/src/net/imap/IMAPMessagePartContentHandler.cpp
+++ b/src/net/imap/IMAPMessagePartContentHandler.cpp
@@ -21,7 +21,7 @@
 // the GNU General Public License cover the whole combination.
 //
 
-#include "vmime/net/imap/imapmessagepartcontenthandler.hpp"
+#include "vmime/net/imap/IMAPMessagePartContentHandler.hpp"
 
 
 namespace vmime {

commit ab5050b777359913f1e73b396dcc44da71870b29
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri May 21 06:01:33 2010 +0000

    Fixed missing #include.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@551 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index d4eab3e..cb5351a 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -27,6 +27,7 @@
 #include "vmime/config.hpp"
 
 #if VMIME_HAVE_PTHREAD
+#	include <pthread.h>
 #	include <gcrypt.h>
 #	include <errno.h>
 #endif // VMIME_HAVE_PTHREAD

commit bb65b540ddce6793cfb1d16bb3c07730ccd7a791
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri May 21 07:41:15 2010 +0000

    Always encode special charsets.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@552 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/utility/stringUtils.cpp b/src/utility/stringUtils.cpp
index abae8f9..7f61a7d 100644
--- a/src/utility/stringUtils.cpp
+++ b/src/utility/stringUtils.cpp
@@ -151,6 +151,24 @@ string::size_type stringUtils::countASCIIchars
 }
 
 
+string::size_type stringUtils::findFirstNonASCIIchar
+	(const string::const_iterator begin, const string::const_iterator end)
+{
+	string::size_type pos = string::npos;
+
+	for (string::const_iterator i = begin ; i != end ; ++i)
+	{
+		if (!parserHelpers::isAscii(*i))
+		{
+			pos = i - begin;
+			break;
+		}
+	}
+
+	return pos;
+}
+
+
 const string stringUtils::unquote(const string& str)
 {
 	if (str.length() < 2)
diff --git a/src/word.cpp b/src/word.cpp
index 667f1fb..9d0177f 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -336,30 +336,22 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 	if (state == NULL)
 		state = &defaultGeneratorState;
 
-	// Calculate the number of ASCII chars to check whether encoding is needed
-	// and _which_ encoding to use.
-	const string::size_type asciiCount =
-		utility::stringUtils::countASCIIchars(m_buffer.begin(), m_buffer.end());
+	// Find out if encoding is forced or required by contents + charset
+	bool encodingNeeded = (flags & text::FORCE_ENCODING) != 0;
 
-	bool noEncoding = (flags & text::FORCE_NO_ENCODING) ||
-	    (!(flags & text::FORCE_ENCODING) && asciiCount == m_buffer.length());
-
-	if (!(flags & text::FORCE_NO_ENCODING) &&
-	    m_buffer.find_first_of("\n\r") != string::npos)
-	{
-		// Force encoding when there are only ASCII chars, but there is
-		// also at least one of '\n' or '\r' (header fields)
-		noEncoding = false;
-	}
+	if (encodingNeeded == false)
+		encodingNeeded = wordEncoder::isEncodingNeeded(m_buffer, m_charset);
+	else if ((flags & text::FORCE_NO_ENCODING) != 0)
+		encodingNeeded = false;
 
 	// If possible and requested (with flag), quote the buffer (no folding is performed).
 	// Quoting is possible if and only if:
-	//  - the whole buffer is ASCII-only
+	//  - the buffer does not need to be encoded
 	//  - the buffer does not contain quoting character (")
 	//  - there is enough remaining space on the current line to hold the whole buffer
-	if (!noEncoding &&
+	if (!encodingNeeded &&
 	    (flags & text::QUOTE_IF_POSSIBLE) &&
-	    asciiCount == m_buffer.length() &&
+	    !encodingNeeded &&
 	    m_buffer.find('"') == string::npos &&
 	    (curLineLength + 2 /* 2 x " */ + m_buffer.length()) < maxLineLength)
 	{
@@ -367,7 +359,7 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
 		curLineLength += 2 + m_buffer.length();
 	}
 	// We will fold lines without encoding them.
-	else if (noEncoding)
+	else if (!encodingNeeded)
 	{
 		string::const_iterator lastWSpos = m_buffer.end(); // last white-space position
 		string::const_iterator curLineStart = m_buffer.begin(); // current line start
diff --git a/src/wordEncoder.cpp b/src/wordEncoder.cpp
index 154b4ef..cc8292f 100644
--- a/src/wordEncoder.cpp
+++ b/src/wordEncoder.cpp
@@ -260,17 +260,75 @@ wordEncoder::Encoding wordEncoder::getEncoding() const
 }
 
 
+// Explicitly force encoding for some charsets
+struct CharsetEncodingEntry
+{
+	CharsetEncodingEntry(const std::string& charset_, const wordEncoder::Encoding encoding_)
+		: charset(charset_), encoding(encoding_)
+	{
+	}
+
+	std::string charset;
+	wordEncoder::Encoding encoding;
+};
+
+CharsetEncodingEntry g_charsetEncodingMap[] =
+{
+	// Use QP encoding for ISO-8859-x charsets
+	CharsetEncodingEntry("iso-8859",     wordEncoder::ENCODING_QP),
+	CharsetEncodingEntry("iso8859",      wordEncoder::ENCODING_QP),
+
+	// RFC-1468 states:
+	//   " ISO-2022-JP may also be used in MIME Part 2 headers.  The "B"
+	//     encoding should be used with ISO-2022-JP text. "
+	// Use Base64 encoding for all ISO-2022 charsets.
+	CharsetEncodingEntry("iso-2022",     wordEncoder::ENCODING_B64),
+	CharsetEncodingEntry("iso2022",      wordEncoder::ENCODING_B64),
+
+	// Last entry is not used
+	CharsetEncodingEntry("", wordEncoder::ENCODING_AUTO)
+};
+
+
+// static
+bool wordEncoder::isEncodingNeeded(const string& buffer, const charset& charset)
+{
+	// Special treatment for some charsets
+	const string cset = utility::stringUtils::toLower(charset.getName());
+
+	for (unsigned int i = 0 ; i < (sizeof(g_charsetEncodingMap) / sizeof(g_charsetEncodingMap[0])) - 1 ; ++i)
+	{
+		if (cset.find(g_charsetEncodingMap[i].charset) != string::npos)
+		{
+			if (g_charsetEncodingMap[i].encoding != wordEncoder::ENCODING_AUTO)
+				return true;
+		}
+	}
+
+	// No encoding is needed if the buffer only contains ASCII chars
+	if (utility::stringUtils::findFirstNonASCIIchar(buffer.begin(), buffer.end()) != string::npos)
+		return true;
+
+	// Force encoding when there are only ASCII chars, but there is
+	// also at least one of '\n' or '\r' (header fields)
+	if (buffer.find_first_of("\n\r") != string::npos)
+		return true;
+
+	return false;
+}
+
+
 // static
 wordEncoder::Encoding wordEncoder::guessBestEncoding
 	(const string& buffer, const charset& charset)
 {
-	// If the charset is ISO-8859-x, set to QP encoding
+	// Special treatment for some charsets
 	const string cset = utility::stringUtils::toLower(charset.getName());
 
-	if (cset.find("iso-8859") != string::npos ||
-	    cset.find("iso8859") != string::npos)
+	for (unsigned int i = 0 ; i < (sizeof(g_charsetEncodingMap) / sizeof(g_charsetEncodingMap[0])) - 1 ; ++i)
 	{
-		return ENCODING_QP;
+		if (cset.find(g_charsetEncodingMap[i].charset) != string::npos)
+			return g_charsetEncodingMap[i].encoding;
 	}
 
 	// Use Base64 if more than 40% non-ASCII, or Quoted-Printable else (default)
diff --git a/tests/parser/textTest.cpp b/tests/parser/textTest.cpp
index 5c9b521..4a7e394 100644
--- a/tests/parser/textTest.cpp
+++ b/tests/parser/textTest.cpp
@@ -44,6 +44,8 @@ VMIME_TEST_SUITE_BEGIN
 		VMIME_TEST(testWordGenerateSpace)
 		VMIME_TEST(testWordGenerateSpace2)
 		VMIME_TEST(testWordGenerateMultiBytes)
+		VMIME_TEST(testWordGenerateQuote)
+		VMIME_TEST(testWordGenerateSpecialCharsets)
 	VMIME_TEST_LIST_END
 
 
@@ -335,9 +337,38 @@ VMIME_TEST_SUITE_BEGIN
 		VASSERT_EQ("1", "=?utf-8?Q?aaa?==?utf-8?Q?=C3=A9?==?utf-8?Q?zzz?=",
 			cleanGeneratedWords(vmime::word("aaa\xc3\xa9zzz", vmime::charset("utf-8")).generate(16)));
 
-		VASSERT_EQ("1", "=?utf-8?Q?aaa=C3=A9?==?utf-8?Q?zzz?=",
+		VASSERT_EQ("2", "=?utf-8?Q?aaa=C3=A9?==?utf-8?Q?zzz?=",
 			cleanGeneratedWords(vmime::word("aaa\xc3\xa9zzz", vmime::charset("utf-8")).generate(17)));
 	}
 
+	void testWordGenerateQuote()
+	{
+		std::string str;
+		vmime::utility::outputStreamStringAdapter os(str);
+
+		// ASCII-only text is quotable
+		str.clear();
+		vmime::word("Quoted text").generate(os, 1000, 0, NULL, vmime::text::QUOTE_IF_POSSIBLE, NULL);
+		VASSERT_EQ("1", "\"Quoted text\"", cleanGeneratedWords(str));
+
+		// Text with CR/LF is not quotable
+		str.clear();
+		vmime::word("Non-quotable\ntext", "us-ascii").generate(os, 1000, 0, NULL, vmime::text::QUOTE_IF_POSSIBLE, NULL);
+		VASSERT_EQ("2", "=?us-ascii?Q?Non-quotable=0Atext?=", cleanGeneratedWords(str));
+
+		// Text with non-ASCII chars is not quotable
+		str.clear();
+		vmime::word("Non-quotable text \xc3\xa9").generate(os, 1000, 0, NULL, vmime::text::QUOTE_IF_POSSIBLE, NULL);
+		VASSERT_EQ("3", "=?UTF-8?Q?Non-quotable_text_=C3=A9?=", cleanGeneratedWords(str));
+	}
+
+	void testWordGenerateSpecialCharsets()
+	{
+		// ISO-2022-JP only uses 7-bit chars but should be encoded in Base64
+		VASSERT_EQ("1", "=?iso-2022-jp?B?XlskQiVRITwlPSVKJWshJiU9JVUlSCUmJSclIl5bKEI=?=",
+			cleanGeneratedWords(vmime::word("^[$B%Q!<%=%J%k!&%=%U%H%&%'%\"^[(B",
+				vmime::charset("iso-2022-jp")).generate(100)));
+	}
+
 VMIME_TEST_SUITE_END
 
diff --git a/vmime/utility/stringUtils.hpp b/vmime/utility/stringUtils.hpp
index b6589db..a8270d3 100644
--- a/vmime/utility/stringUtils.hpp
+++ b/vmime/utility/stringUtils.hpp
@@ -104,6 +104,14 @@ public:
 	  */
 	static string::size_type countASCIIchars(const string::const_iterator begin, const string::const_iterator end);
 
+	/** Returns the position of the first non 7-bit US-ASCII character in a string.
+	  *
+	  * @param begin start position
+	  * @param end end position
+	  * @return position since begin, or string::npos
+	  */
+	static string::size_type findFirstNonASCIIchar(const string::const_iterator begin, const string::const_iterator end);
+
 	/** Convert the specified value to a string value.
 	  *
 	  * @param value to convert
diff --git a/vmime/wordEncoder.hpp b/vmime/wordEncoder.hpp
index 17ca808..1a492ea 100644
--- a/vmime/wordEncoder.hpp
+++ b/vmime/wordEncoder.hpp
@@ -73,12 +73,23 @@ public:
 	  */
 	Encoding getEncoding() const;
 
-private:
+	/** Test whether RFC-2047 encoding is needed.
+	  *
+	  * @param buffer buffer to analyze
+	  * @param charset charset of the buffer
+	  * @return true if encoding is needed, false otherwise.
+	  */
+	static bool isEncodingNeeded(const string& buffer, const charset& charset);
 
+	/** Guess the best RFC-2047 encoding to use for the specified buffer.
+	  *
+	  * @param buffer buffer to analyze
+	  * @param charset charset of the buffer
+	  * @return RFC-2047 encoding
+	  */
 	static Encoding guessBestEncoding(const string& buffer, const charset& charset);
 
-	void guessBestEncoding();
-
+private:
 
 	string m_buffer;
 	string::size_type m_pos;

commit 2c3a4bcc74a56df6362657cb8fad4ab21bde287c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Fri May 21 09:32:42 2010 +0000

    Rewritten doc.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@553 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/vmime/component.hpp b/vmime/component.hpp
index f30a76c..b38127f 100644
--- a/vmime/component.hpp
+++ b/vmime/component.hpp
@@ -32,8 +32,8 @@ namespace vmime
 {
 
 
-/** This abstract class is the base for all the classes in the library.
-  * It defines the methods for parsing and generating all the components.
+/** This abstract class is the base class for all the components of a message.
+  * It defines methods for parsing and generating a component.
   */
 
 class component : public object

commit 36aed261bed5604ce6ed4b39c3938db8712b2004
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun May 23 16:14:41 2010 +0000

    FileSystemFactory is now a ref.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@554 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/examples/example3.cpp b/examples/example3.cpp
index cb3e6ae..4fa482d 100644
--- a/examples/example3.cpp
+++ b/examples/example3.cpp
@@ -73,7 +73,7 @@ int main()
 
 		// -- embed an image (the returned "CID" (content identifier) is used to reference
 		// -- the image into HTML content).
-		vmime::utility::fileSystemFactory* fs =
+		vmime::ref <vmime::utility::fileSystemFactory> fs =
 			vmime::platform::getHandler()->getFileSystemFactory();
 
 		vmime::ref <vmime::utility::file> imageFile =

commit e959b4b3c3ff5228b33dc74c6f6305eeadc1f068
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sun May 23 16:18:00 2010 +0000

    Improved automatic encoding selection. Added helper functions on body for setting contents, type, charset and encoding.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@555 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/body.cpp b/src/body.cpp
index 3f5ff0f..13dff6b 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -213,8 +213,26 @@ void body::parse(const string& buffer, const string::size_type position,
 	// Treat the contents as 'simple' data
 	else
 	{
+		encoding enc;
+
+		try
+		{
+			const ref <const headerField> cef =
+				m_header.acquire()->findField(fields::CONTENT_TRANSFER_ENCODING);
+
+			enc = *cef->getValue().dynamicCast <const encoding>();
+		}
+		catch (exceptions::no_such_field&)
+		{
+			// Defaults to "7bit" (RFC-1521)
+			enc = vmime::encoding(encodingTypes::SEVEN_BIT);
+
+			// Set header field
+			m_header.acquire()->ContentTransferEncoding()->setValue(enc);
+		}
+
 		// Extract the (encoded) contents
-		m_contents = vmime::create <stringContentHandler>(buffer, position, end, getEncoding());
+		m_contents = vmime::create <stringContentHandler>(buffer, position, end, enc);
 	}
 
 	setParsedBounds(position, end);
@@ -406,6 +424,22 @@ bool body::isValidBoundary(const string& boundary)
 // Quick-access functions
 //
 
+
+void body::setContentType(const mediaType& type, const charset& chset)
+{
+	ref <contentTypeField> ctf = m_header.acquire()->ContentType().dynamicCast <contentTypeField>();
+
+	ctf->setValue(type);
+	ctf->setCharset(chset);
+}
+
+
+void body::setContentType(const mediaType& type)
+{
+	m_header.acquire()->ContentType()->setValue(type);
+}
+
+
 const mediaType body::getContentType() const
 {
 	try
@@ -423,6 +457,25 @@ const mediaType body::getContentType() const
 }
 
 
+void body::setCharset(const charset& chset)
+{
+	// If a Content-Type field exists, set charset
+	try
+	{
+		ref <contentTypeField> ctf =
+			m_header.acquire()->findField(fields::CONTENT_TYPE).dynamicCast <contentTypeField>();
+
+		ctf->setCharset(chset);
+	}
+	// Else, create a new Content-Type field of default type "text/plain"
+	// and set charset on it
+	catch (exceptions::no_such_field&)
+	{
+		setContentType(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN), chset);
+	}
+}
+
+
 const charset body::getCharset() const
 {
 	try
@@ -445,6 +498,12 @@ const charset body::getCharset() const
 }
 
 
+void body::setEncoding(const encoding& enc)
+{
+	m_header.acquire()->ContentTransferEncoding()->setValue(enc);
+}
+
+
 const encoding body::getEncoding() const
 {
 	try
@@ -456,8 +515,15 @@ const encoding body::getEncoding() const
 	}
 	catch (exceptions::no_such_field&)
 	{
-		// Defaults to "7bit" (RFC-1521)
-		return (vmime::encoding(encodingTypes::SEVEN_BIT));
+		if (m_contents->isEncoded())
+		{
+			return m_contents->getEncoding();
+		}
+		else
+		{
+			// Defaults to "7bit" (RFC-1521)
+			return vmime::encoding(encodingTypes::SEVEN_BIT);
+		}
 	}
 }
 
@@ -551,6 +617,32 @@ void body::setContents(ref <const contentHandler> contents)
 }
 
 
+void body::setContents(ref <const contentHandler> contents, const mediaType& type)
+{
+	m_contents = contents;
+
+	setContentType(type);
+}
+
+
+void body::setContents(ref <const contentHandler> contents, const mediaType& type, const charset& chset)
+{
+	m_contents = contents;
+
+	setContentType(type, chset);
+}
+
+
+void body::setContents(ref <const contentHandler> contents, const mediaType& type,
+	const charset& chset, const encoding& enc)
+{
+	m_contents = contents;
+
+	setContentType(type, chset);
+	setEncoding(enc);
+}
+
+
 void body::initNewPart(ref <bodyPart> part)
 {
 	part->m_parent = m_part;
diff --git a/src/charset.cpp b/src/charset.cpp
index e3c11da..e043186 100644
--- a/src/charset.cpp
+++ b/src/charset.cpp
@@ -24,6 +24,7 @@
 #include "vmime/charset.hpp"
 #include "vmime/exception.hpp"
 #include "vmime/platform.hpp"
+#include "vmime/encoding.hpp"
 
 #include "vmime/utility/stringUtils.hpp"
 
@@ -140,4 +141,53 @@ const std::vector <ref <const component> > charset::getChildComponents() const
 }
 
 
+
+// Explicitly force encoding for some charsets
+struct CharsetEncodingEntry
+{
+	CharsetEncodingEntry(const string& charset_, const string& encoding_)
+		: charset(charset_), encoding(encoding_)
+	{
+	}
+
+	const string charset;
+	const string encoding;
+};
+
+CharsetEncodingEntry g_charsetEncodingMap[] =
+{
+	// Use QP encoding for ISO-8859-x charsets
+	CharsetEncodingEntry("iso-8859",     encodingTypes::QUOTED_PRINTABLE),
+	CharsetEncodingEntry("iso8859",      encodingTypes::QUOTED_PRINTABLE),
+
+	// RFC-1468 states:
+	//   " ISO-2022-JP may also be used in MIME Part 2 headers.  The "B"
+	//     encoding should be used with ISO-2022-JP text. "
+	// Use Base64 encoding for all ISO-2022 charsets.
+	CharsetEncodingEntry("iso-2022",     encodingTypes::BASE64),
+	CharsetEncodingEntry("iso2022",      encodingTypes::BASE64),
+
+	// Last entry is not used
+	CharsetEncodingEntry("", "")
+};
+
+
+bool charset::getRecommendedEncoding(encoding& enc) const
+{
+	// Special treatment for some charsets
+	const string cset = utility::stringUtils::toLower(getName());
+
+	for (unsigned int i = 0 ; i < (sizeof(g_charsetEncodingMap) / sizeof(g_charsetEncodingMap[0])) - 1 ; ++i)
+	{
+		if (cset.find(g_charsetEncodingMap[i].charset) != string::npos)
+		{
+			enc = g_charsetEncodingMap[i].encoding;
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
 } // vmime
diff --git a/src/emptyContentHandler.cpp b/src/emptyContentHandler.cpp
index 5245341..48dc351 100644
--- a/src/emptyContentHandler.cpp
+++ b/src/emptyContentHandler.cpp
@@ -96,4 +96,10 @@ const vmime::encoding& emptyContentHandler::getEncoding() const
 }
 
 
+bool emptyContentHandler::isBuffered() const
+{
+	return true;
+}
+
+
 } // vmime
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 58ce71d..0919d44 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -110,7 +110,7 @@ bool encoding::operator!=(const encoding& value) const
 }
 
 
-const encoding encoding::decide
+const encoding encoding::decideImpl
 	(const string::const_iterator begin, const string::const_iterator end)
 {
 	const string::difference_type length = end - begin;
@@ -164,10 +164,40 @@ const encoding encoding::decide
 }
 
 
-const encoding encoding::decide(ref <const contentHandler> /* data */)
+const encoding encoding::decide
+	(ref <const contentHandler> data, const EncodingUsage usage)
 {
-	// TODO: a better solution to do that?
-	return (encoding(encodingTypes::BASE64));
+	if (usage == USAGE_TEXT && data->isBuffered() &&
+	    data->getLength() > 0 && data->getLength() < 32768)
+	{
+		// Extract data into temporary buffer
+		string buffer;
+		utility::outputStreamStringAdapter os(buffer);
+
+		data->extract(os);
+		os.flush();
+
+		return decideImpl(buffer.begin(), buffer.end());
+	}
+	else
+	{
+		return encoding(encodingTypes::BASE64);
+	}
+}
+
+
+const encoding encoding::decide(ref <const contentHandler> data,
+	const charset& chset, const EncodingUsage usage)
+{
+	if (usage == USAGE_TEXT)
+	{
+		encoding recEncoding;
+
+		if (chset.getRecommendedEncoding(recEncoding))
+			return recEncoding;
+	}
+
+	return decide(data, usage);
 }
 
 
diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp
index 7713034..c845b57 100644
--- a/src/htmlTextPart.cpp
+++ b/src/htmlTextPart.cpp
@@ -69,27 +69,20 @@ void htmlTextPart::generateIn(ref <bodyPart> /* message */, ref <bodyPart> paren
 		ref <bodyPart> part = vmime::create <bodyPart>();
 		parent->getBody()->appendPart(part);
 
-		// -- Set header fields
-		part->getHeader()->ContentType()->setValue
-			(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN));
-		part->getHeader()->ContentType().dynamicCast <contentTypeField>()->setCharset(m_charset);
-		part->getHeader()->ContentTransferEncoding()->setValue(encoding(encodingTypes::QUOTED_PRINTABLE));
-
 		// -- Set contents
-		part->getBody()->setContents(m_plainText);
+		part->getBody()->setContents(m_plainText,
+			mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN), m_charset,
+			encoding::decide(m_plainText, m_charset, encoding::USAGE_TEXT));
 	}
 
 	// HTML text
 	// -- Create a new part
 	ref <bodyPart> htmlPart = vmime::create <bodyPart>();
 
-	// -- Set header fields
-	htmlPart->getHeader()->ContentType()->setValue(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_HTML));
-	htmlPart->getHeader()->ContentType().dynamicCast <contentTypeField>()->setCharset(m_charset);
-	htmlPart->getHeader()->ContentTransferEncoding()->setValue(encoding(encodingTypes::QUOTED_PRINTABLE));
-
 	// -- Set contents
-	htmlPart->getBody()->setContents(m_text);
+	htmlPart->getBody()->setContents(m_text,
+		mediaType(mediaTypes::TEXT, mediaTypes::TEXT_HTML), m_charset,
+		encoding::decide(m_text, m_charset, encoding::USAGE_TEXT));
 
 	// Handle the case we have embedded objects
 	if (!m_objects.empty())
diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp
index a226b68..4e6ba97 100644
--- a/src/net/imap/IMAPMessagePartContentHandler.cpp
+++ b/src/net/imap/IMAPMessagePartContentHandler.cpp
@@ -173,6 +173,12 @@ bool IMAPMessagePartContentHandler::isEmpty() const
 }
 
 
+bool IMAPMessagePartContentHandler::isBuffered() const
+{
+	return true;
+}
+
+
 } // imap
 } // net
 } // vmime
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp
index 7a674e7..15bcb5e 100644
--- a/src/plainTextPart.cpp
+++ b/src/plainTextPart.cpp
@@ -63,13 +63,10 @@ void plainTextPart::generateIn(ref <bodyPart> /* message */, ref <bodyPart> pare
 	ref <bodyPart> part = vmime::create <bodyPart>();
 	parent->getBody()->appendPart(part);
 
-	// Set header fields
-	part->getHeader()->ContentType()->setValue(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN));
-	part->getHeader()->ContentType().dynamicCast <contentTypeField>()->setCharset(m_charset);
-	part->getHeader()->ContentTransferEncoding()->setValue(encoding(encodingTypes::QUOTED_PRINTABLE));
-
 	// Set contents
-	part->getBody()->setContents(m_text);
+	part->getBody()->setContents(m_text,
+		mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN), m_charset,
+		encoding::decide(m_text, m_charset, encoding::USAGE_TEXT));
 }
 
 
diff --git a/src/streamContentHandler.cpp b/src/streamContentHandler.cpp
index 9edf4aa..2ebd073 100644
--- a/src/streamContentHandler.cpp
+++ b/src/streamContentHandler.cpp
@@ -201,4 +201,11 @@ const vmime::encoding& streamContentHandler::getEncoding() const
 }
 
 
+bool streamContentHandler::isBuffered() const
+{
+	// FIXME: some streams can be resetted
+	return false;
+}
+
+
 } // vmime
diff --git a/src/stringContentHandler.cpp b/src/stringContentHandler.cpp
index 248fca4..4e85a6c 100644
--- a/src/stringContentHandler.cpp
+++ b/src/stringContentHandler.cpp
@@ -202,4 +202,10 @@ const vmime::encoding& stringContentHandler::getEncoding() const
 }
 
 
+bool stringContentHandler::isBuffered() const
+{
+	return true;
+}
+
+
 } // vmime
diff --git a/src/wordEncoder.cpp b/src/wordEncoder.cpp
index cc8292f..22994ed 100644
--- a/src/wordEncoder.cpp
+++ b/src/wordEncoder.cpp
@@ -26,6 +26,8 @@
 #include "vmime/exception.hpp"
 #include "vmime/charsetConverter.hpp"
 
+#include "vmime/encoding.hpp"
+
 #include "vmime/utility/encoder/b64Encoder.hpp"
 #include "vmime/utility/encoder/qpEncoder.hpp"
 
@@ -260,50 +262,14 @@ wordEncoder::Encoding wordEncoder::getEncoding() const
 }
 
 
-// Explicitly force encoding for some charsets
-struct CharsetEncodingEntry
-{
-	CharsetEncodingEntry(const std::string& charset_, const wordEncoder::Encoding encoding_)
-		: charset(charset_), encoding(encoding_)
-	{
-	}
-
-	std::string charset;
-	wordEncoder::Encoding encoding;
-};
-
-CharsetEncodingEntry g_charsetEncodingMap[] =
-{
-	// Use QP encoding for ISO-8859-x charsets
-	CharsetEncodingEntry("iso-8859",     wordEncoder::ENCODING_QP),
-	CharsetEncodingEntry("iso8859",      wordEncoder::ENCODING_QP),
-
-	// RFC-1468 states:
-	//   " ISO-2022-JP may also be used in MIME Part 2 headers.  The "B"
-	//     encoding should be used with ISO-2022-JP text. "
-	// Use Base64 encoding for all ISO-2022 charsets.
-	CharsetEncodingEntry("iso-2022",     wordEncoder::ENCODING_B64),
-	CharsetEncodingEntry("iso2022",      wordEncoder::ENCODING_B64),
-
-	// Last entry is not used
-	CharsetEncodingEntry("", wordEncoder::ENCODING_AUTO)
-};
-
-
 // static
 bool wordEncoder::isEncodingNeeded(const string& buffer, const charset& charset)
 {
-	// Special treatment for some charsets
-	const string cset = utility::stringUtils::toLower(charset.getName());
+	// Charset-specific encoding
+	encoding recEncoding;
 
-	for (unsigned int i = 0 ; i < (sizeof(g_charsetEncodingMap) / sizeof(g_charsetEncodingMap[0])) - 1 ; ++i)
-	{
-		if (cset.find(g_charsetEncodingMap[i].charset) != string::npos)
-		{
-			if (g_charsetEncodingMap[i].encoding != wordEncoder::ENCODING_AUTO)
-				return true;
-		}
-	}
+	if (charset.getRecommendedEncoding(recEncoding))
+		return true;
 
 	// No encoding is needed if the buffer only contains ASCII chars
 	if (utility::stringUtils::findFirstNonASCIIchar(buffer.begin(), buffer.end()) != string::npos)
@@ -322,13 +288,15 @@ bool wordEncoder::isEncodingNeeded(const string& buffer, const charset& charset)
 wordEncoder::Encoding wordEncoder::guessBestEncoding
 	(const string& buffer, const charset& charset)
 {
-	// Special treatment for some charsets
-	const string cset = utility::stringUtils::toLower(charset.getName());
+	// Charset-specific encoding
+	encoding recEncoding;
 
-	for (unsigned int i = 0 ; i < (sizeof(g_charsetEncodingMap) / sizeof(g_charsetEncodingMap[0])) - 1 ; ++i)
+	if (charset.getRecommendedEncoding(recEncoding))
 	{
-		if (cset.find(g_charsetEncodingMap[i].charset) != string::npos)
-			return g_charsetEncodingMap[i].encoding;
+		if (recEncoding == encoding(encodingTypes::QUOTED_PRINTABLE))
+			return ENCODING_QP;
+		else
+			return ENCODING_B64;
 	}
 
 	// Use Base64 if more than 40% non-ASCII, or Quoted-Printable else (default)
diff --git a/vmime/body.hpp b/vmime/body.hpp
index 80c1bb5..9e83d6b 100644
--- a/vmime/body.hpp
+++ b/vmime/body.hpp
@@ -184,6 +184,45 @@ public:
 	  */
 	void setContents(ref <const contentHandler> contents);
 
+	/** Set the body contents and type.
+	  *
+	  * @param contents new body contents
+	  * @param type type of contents
+	  */
+	void setContents(ref <const contentHandler> contents, const mediaType& type);
+
+	/** Set the body contents, type and charset.
+	  *
+	  * @param contents new body contents
+	  * @param type type of contents
+	  * @param charset charset of contents
+	  */
+	void setContents(ref <const contentHandler> contents, const mediaType& type, const charset& chset);
+
+	/** Set the body contents, type, charset and encoding.
+	  *
+	  * @param contents new body contents
+	  * @param type type of contents
+	  * @param charset charset of contents
+	  * @param encoding contents encoding
+	  */
+	void setContents(ref <const contentHandler> contents, const mediaType& type,
+		const charset& chset, const encoding& enc);
+
+	/** Set the MIME type and charset of contents.
+	  * If a charset is defined, it will not be modified.
+	  *
+	  * @param type MIME media type of contents
+	  * @param chset charset of contents
+	  */
+	void setContentType(const mediaType& type, const charset& chset);
+
+	/** Set the MIME type of contents.
+	  *
+	  * @param type MIME media type of contents
+	  */
+	void setContentType(const mediaType& type);
+
 	/** Return the media type of the data contained in the body contents.
 	  * This is a shortcut for getHeader()->ContentType()->getValue()
 	  * on the parent part.
@@ -192,6 +231,13 @@ public:
 	  */
 	const mediaType getContentType() const;
 
+	/** Set the charset of contents.
+	  * If the type is not set, it will be set to default "text/plain" type.
+	  *
+	  * @param chset charset of contents
+	  */
+	void setCharset(const charset& chset);
+
 	/** Return the charset of the data contained in the body contents.
 	  * This is a shortcut for getHeader()->ContentType()->getCharset()
 	  * on the parent part.
@@ -200,6 +246,13 @@ public:
 	  */
 	const charset getCharset() const;
 
+	/** Set the output encoding of contents.
+	  * Contents will be encoded (or re-encoded) when this node is being generated.
+	  *
+	  * @param enc encoding of contents
+	  */
+	void setEncoding(const encoding& enc);
+
 	/** Return the encoding used to encode the body contents.
 	  * This is a shortcut for getHeader()->ContentTransferEncoding()->getValue()
 	  * on the parent part.
diff --git a/vmime/charset.hpp b/vmime/charset.hpp
index 1d25b74..b2e241c 100644
--- a/vmime/charset.hpp
+++ b/vmime/charset.hpp
@@ -33,6 +33,9 @@ namespace vmime
 {
 
 
+class encoding;  // forward reference
+
+
 /** Charset description (basic type).
   */
 
@@ -59,6 +62,16 @@ public:
 
 	const std::vector <ref <const component> > getChildComponents() const;
 
+	/** Gets the recommended encoding for this charset.
+	  * Note: there may be no recommended encoding.
+	  *
+	  * @param enc output parameter that will hold recommended encoding
+	  * @return true if an encoding is recommended (the encoding is stored
+	  * in the enc parameter), false otherwise (in this case, the enc
+	  * parameter is not modified)
+	  */
+	bool getRecommendedEncoding(encoding& enc) const;
+
 	/** Returns the default charset used on the system.
 	  *
 	  * This function simply calls <code>platformHandler::getLocaleCharset()</code>
diff --git a/vmime/contentHandler.hpp b/vmime/contentHandler.hpp
index 38e4e24..0374cbe 100644
--- a/vmime/contentHandler.hpp
+++ b/vmime/contentHandler.hpp
@@ -111,6 +111,13 @@ public:
 	  * @return true if no data is managed by this object, false otherwise
 	  */
 	virtual bool isEmpty() const = 0;
+
+	/** Indicates whether the extract() method can be called multiple times.
+	  *
+	  * @return true if the data can be extracted multiple times, or false
+	  * if not (ie. streamed data from socket)
+	  */
+	virtual bool isBuffered() const = 0;
 };
 
 
diff --git a/vmime/emptyContentHandler.hpp b/vmime/emptyContentHandler.hpp
index 727c065..7b1e7eb 100644
--- a/vmime/emptyContentHandler.hpp
+++ b/vmime/emptyContentHandler.hpp
@@ -52,6 +52,8 @@ public:
 	const vmime::encoding& getEncoding() const;
 
 	bool isEmpty() const;
+
+	bool isBuffered() const;
 };
 
 
diff --git a/vmime/encoding.hpp b/vmime/encoding.hpp
index fa72dfb..ba78081 100644
--- a/vmime/encoding.hpp
+++ b/vmime/encoding.hpp
@@ -45,6 +45,13 @@ class encoding : public headerFieldValue
 {
 public:
 
+	enum EncodingUsage
+	{
+		USAGE_TEXT,         /**< Use for body text. */
+		USAGE_BINARY_DATA   /**< Use for attachment, image... */
+	};
+
+
 	encoding();
 	explicit encoding(const string& name);
 	encoding(const encoding& enc);
@@ -75,20 +82,21 @@ public:
 
 	/** Decide which encoding to use based on the specified data.
 	  *
-	  * \deprecated Use the new decide() method which takes a contentHandler parameter.
-	  *
-	  * @param begin start iterator in buffer
-	  * @param end end iterator in buffer
+	  * @param data data used to determine encoding
+	  * @param usage context of use of data
 	  * @return suitable encoding for specified data
 	  */
-	static const encoding decide(const string::const_iterator begin, const string::const_iterator end);
+	static const encoding decide(ref <const contentHandler> data, const EncodingUsage usage = USAGE_BINARY_DATA);
 
-	/** Decide which encoding to use based on the specified data.
+	/** Decide which encoding to use based on the specified data and charset.
 	  *
 	  * @param data data used to determine encoding
-	  * @return suitable encoding for specified data
+	  * @param charset charset of data
+	  * @param usage context of use of data
+	  * @return suitable encoding for specified data and charset
 	  */
-	static const encoding decide(ref <const contentHandler> data);
+	static const encoding decide(ref <const contentHandler> data, const charset& chset, const EncodingUsage usage = USAGE_BINARY_DATA);
+
 
 	ref <component> clone() const;
 	void copyFrom(const component& other);
@@ -106,6 +114,17 @@ private:
 
 	string m_name;
 
+	/** Decide which encoding to use based on the specified data.
+	  *
+	  * Please note: this will read the whole buffer, so it should be used only
+	  * for small amount of data (eg. text), and not large binary attachments.
+	  *
+	  * @param begin start iterator in buffer
+	  * @param end end iterator in buffer
+	  * @return suitable encoding for specified data
+	  */
+	static const encoding decideImpl(const string::const_iterator begin, const string::const_iterator end);
+
 public:
 
 	using component::parse;
diff --git a/vmime/net/imap/IMAPMessagePartContentHandler.hpp b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
index 0c4641e..75a03af 100644
--- a/vmime/net/imap/IMAPMessagePartContentHandler.hpp
+++ b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
@@ -55,6 +55,8 @@ public:
 
 	bool isEmpty() const;
 
+	bool isBuffered() const;
+
 private:
 
 	weak_ref <IMAPMessage> m_message;
diff --git a/vmime/streamContentHandler.hpp b/vmime/streamContentHandler.hpp
index aa62b2f..703fb72 100644
--- a/vmime/streamContentHandler.hpp
+++ b/vmime/streamContentHandler.hpp
@@ -62,6 +62,8 @@ public:
 
 	bool isEmpty() const;
 
+	bool isBuffered() const;
+
 private:
 
 	// Equals to NO_ENCODING if data is not encoded, otherwise this
diff --git a/vmime/stringContentHandler.hpp b/vmime/stringContentHandler.hpp
index 8d36889..a73ae67 100644
--- a/vmime/stringContentHandler.hpp
+++ b/vmime/stringContentHandler.hpp
@@ -80,6 +80,8 @@ public:
 
 	bool isEmpty() const;
 
+	bool isBuffered() const;
+
 private:
 
 	// Equals to NO_ENCODING if data is not encoded, otherwise this

commit 59511165232b856605940976978f977e439a476a
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Jun 23 20:42:25 2010 +0000

    Do not generate 7-bit value for parameter if RFC-2231 extended value is generated (thanks to Eugene A. Shatokhin).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@556 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/parameter.cpp b/src/parameter.cpp
index 6cd8d1f..53adaca 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -257,11 +257,23 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 
 	// For compatibility with implementations that do not understand RFC-2231,
 	// also generate a normal "7bit/us-ascii" parameter
+
+	// [By Eugene A. Shatokhin]
+	// Note that if both the normal "7bit/us-ascii" value and the extended
+	// value are present, the latter can be ignored by mail processing systems.
+	// This may lead to annoying problems, for example, with strange names of
+	// attachments with all but 7-bit ascii characters removed, etc. To avoid
+	// this, I would suggest not to create "7bit/us-ascii" value if the extended
+	// value is to be generated.
+
+	// A stream for a temporary storage
+	std::ostringstream sevenBitBuffer;
+
 	string::size_type pos = curLinePos;
 
 	if (pos + name.length() + 10 + value.length() > maxLineLength)
 	{
-		os << NEW_LINE_SEQUENCE;
+		sevenBitBuffer << NEW_LINE_SEQUENCE;
 		pos = NEW_LINE_SEQUENCE_LENGTH;
 	}
 
@@ -301,12 +313,12 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 
 	if (needQuoting)
 	{
-		os << name << "=\"";
+		sevenBitBuffer << name << "=\"";
 		pos += name.length() + 2;
 	}
 	else
 	{
-		os << name << "=";
+		sevenBitBuffer << name << "=";
 		pos += name.length() + 1;
 	}
 
@@ -318,12 +330,12 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 
 		if (/* needQuoting && */ (c == '"' || c == '\\'))  // 'needQuoting' is implicit
 		{
-			os << '\\' << value[i];  // escape 'x' with '\x'
+			sevenBitBuffer << '\\' << value[i];  // escape 'x' with '\x'
 			pos += 2;
 		}
 		else if (parserHelpers::isAscii(c))
 		{
-			os << value[i];
+			sevenBitBuffer << value[i];
 			++pos;
 		}
 		else
@@ -334,17 +346,31 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 
 	if (needQuoting)
 	{
-		os << '"';
+		sevenBitBuffer << '"';
 		++pos;
 	}
 
+#if VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+	os << sevenBitBuffer;
+#endif // !VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+
 	// Also generate an extended parameter if the value contains 8-bit characters
 	// or is too long for a single line
 	if (extended || cutValue)
 	{
+
+#if VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+
 		os << ';';
 		++pos;
 
+#else // !VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+
+		// The data output to 'sevenBitBuffer' will be discarded in this case
+		pos = curLinePos;
+
+#endif // VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+
 		/* RFC-2231
 		 * ========
 		 *
@@ -477,6 +503,17 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 			}
 		}
 	}
+#if !VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
+	else
+	{
+		// The value does not contain 8-bit characters and
+		// is short enough for a single line.
+		// "7bit/us-ascii" will suffice in this case.
+
+		// Output what has been stored in temporary buffer so far
+		os << sevenBitBuffer.str();
+	}
+#endif // !VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
 
 	if (newLinePos)
 		*newLinePos = pos;

commit 3ce1428c7f6d9704ddc0346b664e6fa9dc0aa0ff
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Sat Jul 17 07:00:49 2010 +0000

    Take account of charset recommended encoding (thanks to John van der Kamp, Zarafa).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@557 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/text.cpp b/src/text.cpp
index 89a541a..a2fe060 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -24,6 +24,7 @@
 #include "vmime/text.hpp"
 
 #include "vmime/parserHelpers.hpp"
+#include "vmime/encoding.hpp"
 
 
 namespace vmime
@@ -248,26 +249,36 @@ ref <text> text::newFromString(const string& in, const charset& ch)
 
 void text::createFromString(const string& in, const charset& ch)
 {
-	bool is8bit = false;     // is the current word 8-bit?
-	bool prevIs8bit = false; // is previous word 8-bit?
-	unsigned int count = 0;  // total number of words
+	string::size_type asciiCount = 0;
+	string::size_type asciiPercent = 0;
 
 	removeAllWords();
 
-	const string::size_type asciiCount =
-		utility::stringUtils::countASCIIchars(in.begin(), in.end());
+	// Check whether there is a recommended encoding for this charset.
+	// If so, the whole buffer will be encoded. Else, the number of
+	// 7-bit (ASCII) bytes in the input will be used to determine if
+	// we need to encode the whole buffer.
+	encoding recommendedEnc;
+	const bool alwaysEncode = ch.getRecommendedEncoding(recommendedEnc);
 
-	const string::size_type asciiPercent =
-		(in.length() == 0 ? 100 : (100 * asciiCount) / in.length());
+	if (!alwaysEncode)
+	{
+		asciiCount = utility::stringUtils::countASCIIchars(in.begin(), in.end());
+		asciiPercent = (in.length() == 0 ? 100 : (100 * asciiCount) / in.length());
+	}
 
 	// If there are "too much" non-ASCII chars, encode everything
-	if (asciiPercent < 60)  // less than 60% ASCII chars
+	if (alwaysEncode || asciiPercent < 60)  // less than 60% ASCII chars
 	{
 		appendWord(vmime::create <word>(in, ch));
 	}
 	// Else, only encode words which need it
 	else
 	{
+		bool is8bit = false;     // is the current word 8-bit?
+		bool prevIs8bit = false; // is previous word 8-bit?
+		unsigned int count = 0;  // total number of words
+
 		for (string::size_type end = in.size(), pos = 0, start = 0 ; ; )
 		{
 			if (pos == end || parserHelpers::isSpace(in[pos]))

commit fa4f3f1ce3a8e5105c205c039fe62ad0b2657fc5
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Wed Jul 21 12:21:07 2010 +0000

    Added section about deleting messages from store.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@558 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/doc/book/net.tex b/doc/book/net.tex
index 08b7df5..3056861 100644
--- a/doc/book/net.tex
+++ b/doc/book/net.tex
@@ -614,6 +614,27 @@ Suppose we have a message with the following structure:
 The previous example will extract the header and body of the \emph{image/jpeg}
 part.
 
+\subsection{Deleting messages} % ---------------------------------------------
+
+The following example will delete the second and the third message from the
+store.
+
+\begin{lstlisting}[caption={Deleting messages}]
+vmime::ref <vmime::net::folder> folder = store->getDefaultFolder();
+
+folder->deleteMessage(3);
+folder->deleteMessage(2);
+
+// This is equivalent
+std::vector <int> nums;
+nums.push_back(2);
+nums.push_back(3);
+folder->deleteMessages(nums);
+
+// This is also equivalent
+folder->deleteMessages(/* from */ 2, /* to */ 3);
+\end{lstlisting}
+
 \subsection{Events} % --------------------------------------------------------
 
 As a result of executing some operation (or from time to time, even if no

commit d6feb9c5503726f99d7aecaa8dedd359950c6e1c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Aug 5 10:30:22 2010 +0000

    Connection time out.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@559 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index 825a002..e2b60ed 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -99,7 +99,7 @@ void IMAPConnection::connect()
 		m_timeoutHandler = store->getTimeoutHandlerFactory()->create();
 
 	// Create and connect the socket
-	m_socket = store->getSocketFactory()->create();
+	m_socket = store->getSocketFactory()->create(m_timeoutHandler);
 
 #if VMIME_HAVE_TLS_SUPPORT
 	if (store->isIMAPS())  // dedicated port/IMAPS
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index e5e8ba7..9d554c6 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -138,7 +138,7 @@ void POP3Store::connect()
 		m_timeoutHandler = getTimeoutHandlerFactory()->create();
 
 	// Create and connect the socket
-	m_socket = getSocketFactory()->create();
+	m_socket = getSocketFactory()->create(m_timeoutHandler);
 
 #if VMIME_HAVE_TLS_SUPPORT
 	if (m_isPOP3S)  // dedicated port/POP3S
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 917a56c..71f166b 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -100,7 +100,7 @@ void SMTPTransport::connect()
 		m_timeoutHandler = getTimeoutHandlerFactory()->create();
 
 	// Create and connect the socket
-	m_socket = getSocketFactory()->create();
+	m_socket = getSocketFactory()->create(m_timeoutHandler);
 
 #if VMIME_HAVE_TLS_SUPPORT
 	if (m_isSMTPS)  // dedicated port/SMTPS
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index 807ec47..b8bb8b1 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -49,8 +49,8 @@ namespace posix {
 // posixSocket
 //
 
-posixSocket::posixSocket()
-	: m_desc(-1)
+posixSocket::posixSocket(ref <vmime::net::timeoutHandler> th)
+	: m_timeoutHandler(th), m_desc(-1)
 {
 }
 
@@ -105,11 +105,115 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port
 		if (sock < 0)
 			continue;  // try next
 
-		if (::connect(sock, res->ai_addr, res->ai_addrlen) < 0)
+		if (m_timeoutHandler != NULL)
 		{
-			::close(sock);
-			sock = -1;
-			continue;  // try next
+			::fcntl(sock, F_SETFL, ::fcntl(sock, F_GETFL) | O_NONBLOCK);
+
+			if (::connect(sock, res->ai_addr, res->ai_addrlen) < 0)
+			{
+				switch (errno)
+				{
+				case 0:
+				case EINPROGRESS:
+				case EINTR:
+#if defined(EAGAIN)
+				case EAGAIN:
+#endif // EAGAIN
+#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
+				case EWOULDBLOCK:
+#endif // EWOULDBLOCK
+
+					// Connection in progress
+					break;
+
+				default:
+
+					::close(sock);
+					sock = -1;
+					continue;  // try next
+				}
+
+				// Wait for socket to be connected.
+				// We will check for time out every second.
+				fd_set fds;
+				FD_ZERO(&fds);
+				FD_SET(sock, &fds);
+
+				fd_set fdsError;
+				FD_ZERO(&fdsError);
+				FD_SET(sock, &fdsError);
+
+				struct timeval tm;
+				tm.tv_sec = 1;
+				tm.tv_usec = 0;
+
+				m_timeoutHandler->resetTimeOut();
+
+				bool connected = false;
+
+				do
+				{
+					const int ret = select(sock + 1, NULL, &fds, &fdsError, &tm);
+
+					// Success
+					if (ret > 0)
+					{
+						connected = true;
+						break;
+					}
+					// Error
+					else if (ret < -1)
+					{
+						if (errno != EINTR)
+						{
+							// Cancel connection
+							break;
+						}
+					}
+					// 1-second timeout
+					else if (ret == 0)
+					{
+						if (m_timeoutHandler->isTimeOut())
+						{
+							if (!m_timeoutHandler->handleTimeOut())
+							{
+								// Cancel connection
+								break;
+							}
+							else
+							{
+								// Reset timeout and keep waiting for connection
+								m_timeoutHandler->resetTimeOut();
+							}
+						}
+						else
+						{
+							// Keep waiting for connection
+						}
+					}
+
+					::sched_yield();
+
+				} while (true);
+
+				if (!connected)
+				{
+					::close(sock);
+					sock = -1;
+					continue;  // try next
+				}
+
+				break;
+			}
+		}
+		else
+		{
+			if (::connect(sock, res->ai_addr, res->ai_addrlen) < 0)
+			{
+				::close(sock);
+				sock = -1;
+				continue;  // try next
+			}
 		}
 	}
 
@@ -325,7 +429,14 @@ void posixSocket::throwSocketError(const int err)
 
 ref <vmime::net::socket> posixSocketFactory::create()
 {
-	return vmime::create <posixSocket>();
+	ref <vmime::net::timeoutHandler> th = NULL;
+	return vmime::create <posixSocket>(th);
+}
+
+
+ref <vmime::net::socket> posixSocketFactory::create(ref <vmime::net::timeoutHandler> th)
+{
+	return vmime::create <posixSocket>(th);
 }
 
 
diff --git a/tests/testUtils.hpp b/tests/testUtils.hpp
index 9aee153..aee50dc 100644
--- a/tests/testUtils.hpp
+++ b/tests/testUtils.hpp
@@ -260,6 +260,11 @@ public:
 	{
 		return vmime::create <T>();
 	}
+
+	vmime::ref <vmime::net::socket> create(vmime::ref <vmime::net::timeoutHandler> /* th */)
+	{
+		return vmime::create <T>();
+	}
 };
 
 
diff --git a/vmime/net/socket.hpp b/vmime/net/socket.hpp
index ec6a9d3..b394649 100644
--- a/vmime/net/socket.hpp
+++ b/vmime/net/socket.hpp
@@ -27,6 +27,8 @@
 
 #include "vmime/base.hpp"
 
+#include "vmime/net/timeoutHandler.hpp"
+
 
 namespace vmime {
 namespace net {
@@ -117,7 +119,18 @@ public:
 
 	virtual ~socketFactory() { }
 
+	/** Creates a socket without timeout handler.
+	  *
+	  * @return a new socket
+	  */
 	virtual ref <socket> create() = 0;
+
+	/** Creates a socket with the specified timeout handler.
+	  *
+	  * @param th timeout handler
+	  * @return a new socket
+	  */
+	virtual ref <socket> create(ref <timeoutHandler> th) = 0;
 };
 
 
diff --git a/vmime/platforms/posix/posixSocket.hpp b/vmime/platforms/posix/posixSocket.hpp
index 9cd49d4..7e0c2d3 100644
--- a/vmime/platforms/posix/posixSocket.hpp
+++ b/vmime/platforms/posix/posixSocket.hpp
@@ -40,7 +40,7 @@ class posixSocket : public vmime::net::socket
 {
 public:
 
-	posixSocket();
+	posixSocket(ref <vmime::net::timeoutHandler> th);
 	~posixSocket();
 
 	void connect(const vmime::string& address, const vmime::port_t port);
@@ -61,6 +61,8 @@ protected:
 
 private:
 
+	ref <vmime::net::timeoutHandler> m_timeoutHandler;
+
 	char m_buffer[65536];
 	int m_desc;
 };
@@ -72,6 +74,7 @@ class posixSocketFactory : public vmime::net::socketFactory
 public:
 
 	ref <vmime::net::socket> create();
+	ref <vmime::net::socket> create(ref <vmime::net::timeoutHandler> th);
 };
 
 

commit 5bd1361b6024c687f06318af32cab5c7502bbc55
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Aug 16 10:21:03 2010 +0000

    Added stubs for timeout handler (#3045770).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@560 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 3ff9ad5..430c8ea 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -38,8 +38,8 @@ namespace windows {
 // posixSocket
 //
 
-windowsSocket::windowsSocket()
-	: m_desc(-1)
+windowsSocket::windowsSocket(ref <vmime::net::timeoutHandler> th)
+	: m_timeoutHandler(th), m_desc(-1)
 {
 	WSAData wsaData;
 	WSAStartup(MAKEWORD(1, 1), &wsaData);
@@ -179,9 +179,14 @@ void windowsSocket::sendRaw(const char* buffer, const size_type count)
 
 ref <vmime::net::socket> windowsSocketFactory::create()
 {
-	return vmime::create <windowsSocket>();
+	ref <vmime::net::timeoutHandler> th = NULL;
+	return vmime::create <windowsSocket>(th);
 }
 
+ref <vmime::net::socket> windowsSocketFactory::create(ref <vmime::net::timeoutHandler> th)
+{
+    return vmime::create <windowsSocket>(th);
+}
 
 } // posix
 } // platforms
diff --git a/vmime/platforms/windows/windowsSocket.hpp b/vmime/platforms/windows/windowsSocket.hpp
index 2940157..1c89aeb 100644
--- a/vmime/platforms/windows/windowsSocket.hpp
+++ b/vmime/platforms/windows/windowsSocket.hpp
@@ -41,6 +41,7 @@ class windowsSocket : public vmime::net::socket
 {
 public:
 	windowsSocket();
+	windowsSocket(ref <vmime::net::timeoutHandler> th);
 	~windowsSocket();
 
 public:
@@ -59,6 +60,8 @@ public:
 
 private:
 
+	ref <vmime::net::timeoutHandler> m_timeoutHandler;
+
 	char m_buffer[65536];
 	SOCKET m_desc;
 };
@@ -70,6 +73,7 @@ class windowsSocketFactory : public vmime::net::socketFactory
 public:
 
 	ref <vmime::net::socket> create();
+	ref <vmime::net::socket> create(ref <vmime::net::timeoutHandler> th);
 };
 
 

commit e2f160f70bdc0298609007ea451d2b19e8938a0c
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Aug 17 21:47:25 2010 +0000

    Encode TSpecials in RFC-2231 encoded chunks.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@561 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/parameter.cpp b/src/parameter.cpp
index 53adaca..d923e68 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -432,9 +432,21 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 			case '\t':
 			case '\r':
 			case '\n':
+			case '%':
 			case '"':
 			case ';':
 			case ',':
+			case '(':
+			case ')':
+			case '<':
+			case '>':
+			case '@':
+			case ':':
+			case '/':
+			case '[':
+			case ']':
+			case '?':
+			case '=':
 
 				encode = true;
 				break;
diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp
index 803bb59..72f9e9b 100644
--- a/tests/parser/parameterTest.cpp
+++ b/tests/parser/parameterTest.cpp
@@ -37,6 +37,8 @@ VMIME_TEST_SUITE_BEGIN
 		VMIME_TEST(testGenerateRFC2231)
 		VMIME_TEST(testNonStandardEncodedParam)
 		VMIME_TEST(testParseNonSignificantWS)
+		VMIME_TEST(testEncodeTSpecials)
+		VMIME_TEST(testEncodeTSpecialsInRFC2231)
 	VMIME_TEST_LIST_END
 
 
@@ -222,7 +224,11 @@ VMIME_TEST_SUITE_BEGIN
 		p1.appendParameter(vmime::create <vmime::parameter>("param1",
 			vmime::word("value 1\xe9", vmime::charset("charset"))));
 
+#if VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
 		VASSERT_EQ("1", "F: X; param1=\"value 1\";param1*=charset''value%201%E9", p1.generate());
+#else
+		VASSERT_EQ("1", "F: X; param1*=charset''value%201%E9", p1.generate());
+#endif
 
 		// Value that spans on multiple lines
 		parameterizedHeaderField p2;
@@ -230,6 +236,7 @@ VMIME_TEST_SUITE_BEGIN
 			vmime::word("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
 				    vmime::charset("charset"))));
 
+#if VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
 		VASSERT_EQ("2", "F: X; \r\n "
 			"param1=abcdefghijklm;\r\n "
 			"param1*0*=charset''abc;\r\n "
@@ -239,6 +246,16 @@ VMIME_TEST_SUITE_BEGIN
 			"param1*4*=EFGHIJKLM;\r\n "
 			"param1*5*=NOPQRSTUV;\r\n "
 			"param1*6*=WXYZ", p2.generate(25));  // max line length = 25
+#else
+		VASSERT_EQ("2", "F: X; \r\n "
+			"param1*0*=charset''abc;\r\n "
+			"param1*1*=defghijkl;\r\n "
+			"param1*2*=mnopqrstu;\r\n "
+			"param1*3*=vwxyzABCD;\r\n "
+			"param1*4*=EFGHIJKLM;\r\n "
+			"param1*5*=NOPQRSTUV;\r\n "
+			"param1*6*=WXYZ", p2.generate(25));  // max line length = 25
+#endif
 
 		// Non-ASCII parameter value
 		parameterizedHeaderField p3;
@@ -246,6 +263,7 @@ VMIME_TEST_SUITE_BEGIN
 			vmime::word("δσσσσσσσσσσσσσσσσσσσσδσδα δσαδσδσαδσαδασδασ δσαδασδσα δσαδασδσα δασδασδασ δασαχφδδσα 2008.doc",
 				vmime::charset("utf-8"))));
 
+#if VMIME_ALWAYS_GENERATE_7BIT_PARAMETER
 		VASSERT_EQ("3", "F: X; \r\n "
 			"param1=\"      2008.doc\";param1*0*=utf-8''%CE%B4%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
 			"param1*1*=%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
@@ -255,6 +273,16 @@ VMIME_TEST_SUITE_BEGIN
 			"param1*5*=%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CF%83%CE%B1%20%CE%B4%CE%B1%CF%83;\r\n "
 			"param1*6*=%CE%B4%CE%B1%CF%83%CE%B4%CE%B1%CF%83%20%CE%B4%CE%B1%CF%83%CE%B1%CF;\r\n "
 			"param1*7*=%87%CF%86%CE%B4%CE%B4%CF%83%CE%B1%202008.doc", p3.generate(80));
+#else
+		VASSERT_EQ("3", "F: X; param1*0*=utf-8''%CE%B4%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
+			"param1*1*=%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83%CF%83;\r\n "
+			"param1*2*=%CE%B4%CF%83%CE%B4%CE%B1%20%CE%B4%CF%83%CE%B1%CE%B4%CF%83%CE%B4%CF;\r\n "
+			"param1*3*=%83%CE%B1%CE%B4%CF%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CE%B1%CF%83%20;\r\n "
+			"param1*4*=%CE%B4%CF%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CF%83%CE%B1%20%CE%B4%CF;\r\n "
+			"param1*5*=%83%CE%B1%CE%B4%CE%B1%CF%83%CE%B4%CF%83%CE%B1%20%CE%B4%CE%B1%CF%83;\r\n "
+			"param1*6*=%CE%B4%CE%B1%CF%83%CE%B4%CE%B1%CF%83%20%CE%B4%CE%B1%CF%83%CE%B1%CF;\r\n "
+			"param1*7*=%87%CF%86%CE%B4%CE%B4%CF%83%CE%B1%202008.doc", p3.generate(80));
+#endif
 	}
 
 	void testNonStandardEncodedParam()
@@ -297,5 +325,32 @@ VMIME_TEST_SUITE_BEGIN
 		VASSERT_EQ("2.4", "value1", PARAM_VALUE(p2, 0));
 	}
 
+	// Encode "tspecials"
+	void testEncodeTSpecials()
+	{
+		VASSERT_EQ(" 1", "p=\"val(ue\"",  vmime::create <vmime::parameter>("p", "val(ue")->generate());
+		VASSERT_EQ(" 2", "p=\"val)ue\"",  vmime::create <vmime::parameter>("p", "val)ue")->generate());
+		VASSERT_EQ(" 3", "p=\"val<ue\"",  vmime::create <vmime::parameter>("p", "val<ue")->generate());
+		VASSERT_EQ(" 4", "p=\"val>ue\"",  vmime::create <vmime::parameter>("p", "val>ue")->generate());
+		VASSERT_EQ(" 5", "p=\"val@ue\"",  vmime::create <vmime::parameter>("p", "val@ue")->generate());
+		VASSERT_EQ(" 6", "p=\"val,ue\"",  vmime::create <vmime::parameter>("p", "val,ue")->generate());
+		VASSERT_EQ(" 7", "p=\"val;ue\"",  vmime::create <vmime::parameter>("p", "val;ue")->generate());
+		VASSERT_EQ(" 8", "p=\"val:ue\"",  vmime::create <vmime::parameter>("p", "val:ue")->generate());
+		VASSERT_EQ(" 9", "p=\"val/ue\"",  vmime::create <vmime::parameter>("p", "val/ue")->generate());
+		VASSERT_EQ("10", "p=\"val[ue\"",  vmime::create <vmime::parameter>("p", "val[ue")->generate());
+		VASSERT_EQ("11", "p=\"val]ue\"",  vmime::create <vmime::parameter>("p", "val]ue")->generate());
+		VASSERT_EQ("12", "p=\"val?ue\"",  vmime::create <vmime::parameter>("p", "val?ue")->generate());
+		VASSERT_EQ("13", "p=\"val=ue\"",  vmime::create <vmime::parameter>("p", "val=ue")->generate());
+		VASSERT_EQ("14", "p=\"val ue\"",  vmime::create <vmime::parameter>("p", "val ue")->generate());
+		VASSERT_EQ("15", "p=\"val\tue\"", vmime::create <vmime::parameter>("p", "val\tue")->generate());
+	}
+
+	// http://sourceforge.net/projects/vmime/forums/forum/237356/topic/3812278
+	void testEncodeTSpecialsInRFC2231()
+	{
+		VASSERT_EQ("1", "filename*=UTF-8''my_file_name_%C3%B6%C3%A4%C3%BC_%281%29.txt",
+			vmime::create <vmime::parameter>("filename", "my_file_name_\xc3\xb6\xc3\xa4\xc3\xbc_(1).txt")->generate());
+	}
+
 VMIME_TEST_SUITE_END
 

commit 593591674556159fa2ff19b9c421254770a6e8ac
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Thu Aug 19 07:50:15 2010 +0000

    Fixed pointer-type argument for gnutls_credentials_set (thanks to Mike Smellie).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@562 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index cb5351a..010c007 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -199,10 +199,10 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
 
 	// Initialize credentials
 	gnutls_credentials_set(*m_gnutlsSession,
-		GNUTLS_CRD_ANON, &g_gnutlsGlobal.anonCred);
+		GNUTLS_CRD_ANON, g_gnutlsGlobal.anonCred);
 
 	gnutls_credentials_set(*m_gnutlsSession,
-		GNUTLS_CRD_CERTIFICATE, &g_gnutlsGlobal.certCred);
+		GNUTLS_CRD_CERTIFICATE, g_gnutlsGlobal.certCred);
 }
 
 

commit b7ec3accd3fa1b6dc7d7724aab968f860fe1930b
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Mon Sep 6 20:20:45 2010 +0000

    Fixed extraction of root part body.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@563 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index adfef01..bbdba69 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -273,9 +273,12 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
 	if (peek) command << ".PEEK";
 	command << "[";
 
-	if (section.str().empty() && headerOnly)
+	if (section.str().empty())
 	{
-		command << "HEADER";
+		if (headerOnly)
+			command << "HEADER";
+		else
+			command << "TEXT";
 	}
 	else
 	{

commit 98843499d10a458f7029b054ceb3cda944e52e88
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Sep 7 07:44:15 2010 +0000

    Support filenames with charset (thanks to John van der Kamp, Zarafa).
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@564 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/parameter.cpp b/src/parameter.cpp
index d923e68..91a7e5c 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -25,6 +25,7 @@
 #include "vmime/parserHelpers.hpp"
 
 #include "vmime/text.hpp"
+#include "vmime/encoding.hpp"
 
 
 namespace vmime
@@ -322,7 +323,13 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 		pos += name.length() + 1;
 	}
 
-	bool extended = false;
+	// Check whether there is a recommended encoding for this charset.
+	// If so, the whole buffer will be encoded. Else, the number of
+	// 7-bit (ASCII) bytes in the input will be used to determine if
+	// we need to encode the whole buffer.
+	encoding recommendedEnc;
+	const bool alwaysEncode = m_value.getCharset().getRecommendedEncoding(recommendedEnc);
+	bool extended = alwaysEncode;
 
 	for (string::size_type i = 0 ; (i < value.length()) && (pos < maxLineLength - 4) ; ++i)
 	{
@@ -454,7 +461,8 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL
 			default:
 
 				encode = (!parserHelpers::isPrint(c) ||
-				          !parserHelpers::isAscii(c));
+				          !parserHelpers::isAscii(c) ||
+				          alwaysEncode);
 
 				break;
 			}

commit a5a7e03fd144e6c46e5418f8bdd0e3f754bd980f
Author: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
Date:   Tue Sep 7 10:46:24 2010 +0000

    Added an option to recognize inline objects as attachments.
    
    git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@565 5301114d-f842-0410-bbdd-996ee0417009

diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp
index 65e8c88..c23ee95 100644
--- a/src/attachmentHelper.cpp
+++ b/src/attachmentHelper.cpp
@@ -36,7 +36,8 @@ namespace vmime
 
 
 // static
-bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
+bool attachmentHelper::isBodyPartAnAttachment
+	(ref <const bodyPart> part, const unsigned int options)
 {
 	try
 	{
@@ -49,54 +50,63 @@ bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
 		if (disp.getName() != contentDispositionTypes::INLINE)
 			return true;
 
-		// If the Content-Disposition is 'inline' and there is no
-		// Content-Id or Content-Location field, it may be an attachment
-		if (!part->getHeader()->hasField(vmime::fields::CONTENT_ID) &&
-		    !part->getHeader()->hasField(vmime::fields::CONTENT_LOCATION))
+		if ((options & INLINE_OBJECTS) == 0)
 		{
-			// If this is the root part, it might not be an attachment
-			if (part->getParentPart() == NULL)
-				return false;
+			// If the Content-Disposition is 'inline' and there is no
+			// Content-Id or Content-Location field, it may be an attachment
+			if (!part->getHeader()->hasField(vmime::fields::CONTENT_ID) &&
+			    !part->getHeader()->hasField(vmime::fields::CONTENT_LOCATION))
+			{
+				// If this is the root part, it might not be an attachment
+				if (part->getParentPart() == NULL)
+					return false;
 
-			return true;
+				return true;
+			}
+
+			return false;
 		}
 	}
 	catch (exceptions::no_such_field&)
 	{
-		// No "Content-disposition" field: assume "attachment" if
-		// type is not "text/..." or "multipart/...".
-		mediaType type;
+		// Will try using Content-Type
+	}
 
-		try
-		{
-			const contentTypeField& ctf = dynamic_cast<contentTypeField&>
-				(*part->getHeader()->findField(fields::CONTENT_TYPE));
+	// Assume "attachment" if type is not "text/..." or "multipart/...".
+	mediaType type;
 
-			type = *ctf.getValue().dynamicCast <const mediaType>();
-		}
-		catch (exceptions::no_such_field&)
-		{
-			// If this is the root part and no Content-Type field is present,
-			// then this may not be a MIME message, so do not assume it is
-			// an attachment
-			if (part->getParentPart() == NULL)
-				return false;
+	try
+	{
+		const contentTypeField& ctf = dynamic_cast<contentTypeField&>
+			(*part->getHeader()->findField(fields::CONTENT_TYPE));
 
-			// No "Content-type" field: assume "application/octet-stream".
-			type = mediaType(mediaTypes::APPLICATION,
-			                 mediaTypes::APPLICATION_OCTET_STREAM);
-		}
+		type = *ctf.getValue().dynamicCast <const mediaType>();
+	}
+	catch (exceptions::no_such_field&)
+	{
+		// If this is the root part and no Content-Type field is present,
+		// then this may not be a MIME message, so do not assume it is
+		// an attachment
+		if (part->getParentPart() == NULL)
+			return false;
+
+		// No "Content-type" field: assume "application/octet-stream".
+		type = mediaType(mediaTypes::APPLICATION,
+				     mediaTypes::APPLICATION_OCTET_STREAM);
+	}
 
-		if (type.getType() != mediaTypes::TEXT &&
-		    type.getType() != mediaTypes::MULTIPART)
+	if (type.getType() != mediaTypes::TEXT &&
+	    type.getType() != mediaTypes::MULTIPART)
+	{
+		if ((options & INLINE_OBJECTS) == 0)
 		{
 			// If a "Content-Id" field is present, it might be an
 			// embedded object (MHTML messages)
 			if (part->getHeader()->hasField(vmime::fields::CONTENT_ID))
 				return false;
-
-			return true;
 		}
+
+		return true;
 	}
 
 	return false;
@@ -104,10 +114,10 @@ bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
 
 
 // static
-ref <const attachment>
-	attachmentHelper::getBodyPartAttachment(ref <const bodyPart> part)
+ref <const attachment> attachmentHelper::getBodyPartAttachment
+	(ref <const bodyPart> part, const unsigned int options)
 {
-	if (!isBodyPartAnAttachment(part))
+	if (!isBodyPartAnAttachment(part, options))
 		return NULL;
 
 	mediaType type;
@@ -140,22 +150,24 @@ ref <const attachment>
 
 // static
 const std::vector <ref <const attachment> >
-	attachmentHelper::findAttachmentsInMessage(ref <const message> msg)
+	attachmentHelper::findAttachmentsInMessage
+		(ref <const message> msg, const unsigned int options)
 {
-	return findAttachmentsInBodyPart(msg);
+	return findAttachmentsInBodyPart(msg, options);
 }
 
 
 // static
 const std::vector <ref <const attachment> >
-	attachmentHelper::findAttachmentsInBodyPart(ref <const bodyPart> part)
+	attachmentHelper::findAttachmentsInBodyPart
+		(ref <const bodyPart> part, const unsigned int options)
 {
 	std::vector <ref <const attachment> > atts;
 
 	// Test this part
-	if (isBodyPartAnAttachment(part))
+	if (isBodyPartAnAttachment(part, options))
 	{
-		atts.push_back(getBodyPartAttachment(part));
+		atts.push_back(getBodyPartAttachment(part, options));
 	}
 	// Find in sub-parts
 	else
@@ -165,7 +177,7 @@ const std::vector <ref <const attachment> >
 		for (int i = 0 ; i < bdy->getPartCount() ; ++i)
 		{
 			std::vector <ref <const attachment> > partAtts =
-				findAttachmentsInBodyPart(bdy->getPartAt(i));
+				findAttachmentsInBodyPart(bdy->getPartAt(i), options);
 
 			std::copy(partAtts.begin(), partAtts.end(), std::back_inserter(atts));
 		}
diff --git a/vmime/attachmentHelper.hpp b/vmime/attachmentHelper.hpp
index 3ce86c8..a383367 100644
--- a/vmime/attachmentHelper.hpp
+++ b/vmime/attachmentHelper.hpp
@@ -30,10 +30,6 @@
 #include "vmime/attachment.hpp"
 #include "vmime/message.hpp"
 
-#if VMIME_HAVE_MESSAGING_FEATURES
-	#include "vmime/net/message.hpp"
-#endif
-
 
 namespace vmime
 {
@@ -45,31 +41,57 @@ class attachmentHelper
 {
 public:
 
+	/** Options for use with the following functions:
+	  *     findAttachmentsInMessage,
+	  *     getBodyPartAttachment,
+	  * and isBodyPartAnAttachment.
+	  */
+	enum FindOptions
+	{
+		INLINE_OBJECTS = (1 << 0)        /**< Recognize and return inline objects. The aim is to
+		                                      consider MHTML objects (parts with a "Content-Id" or
+		                                      a "Content-Location", such as inline images) as attachments. */
+	};
+
 	/** Test whether a body part is an attachment.
 	  *
 	  * @param part message part to test
+	  * @param options search options (see FindOptions)
 	  * @return true if the part is an attachment, false otherwise
 	  */
-	static bool isBodyPartAnAttachment(ref <const bodyPart> part);
+	static bool isBodyPartAnAttachment(ref <const bodyPart> part, const unsigned int options = 0);
 
 	/** Return attachment information in the specified body part.
 	  * If the specified body part does not contain attachment
 	  * information (ie. is not an attachment), NULL is returned.
 	  *
 	  * @param part message part in which to search
+	  * @param options search options (see FindOptions)
 	  * @return attachment found in the part, or NULL
 	  */
 	static ref <const attachment>
-		getBodyPartAttachment(ref <const bodyPart> part);
+		getBodyPartAttachment(ref <const bodyPart> part, const unsigned int options = 0);
+
+	/** Find all attachments contained in the specified part
+	  * and all its children parts.
+	  * This is simply a recursive call to getBodyPartAttachment().
+	  *
+	  * @param part part in which to search
+	  * @param options search options (see FindOptions)
+	  * @return a list of attachments found
+	  */
+	static const std::vector <ref <const attachment> >
+		findAttachmentsInBodyPart(ref <const bodyPart> part, const unsigned int options = 0);
 
 	/** Find all attachments contained in the specified message.
 	  * This is simply a recursive call to getBodyPartAttachment().
 	  *
 	  * @param msg message in which to search
+	  * @param options search options (see FindOptions)
 	  * @return a list of attachments found
 	  */
 	static const std::vector <ref <const attachment> >
-		findAttachmentsInMessage(ref <const message> msg);
+		findAttachmentsInMessage(ref <const message> msg, const unsigned int options = 0);
 
 	/** Add an attachment to the specified message.
 	  *
@@ -87,9 +109,6 @@ public:
 
 protected:
 
-	static const std::vector <ref <const attachment> >
-		findAttachmentsInBodyPart(ref <const bodyPart> part);
-
 	static ref <bodyPart> findBodyPart
 		(ref <bodyPart> part, const mediaType& type);
 };