File: ChangeLog

package info (click to toggle)
mailfromd 9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,512 kB
  • sloc: ansic: 56,882; sh: 22,979; yacc: 4,130; lex: 1,428; makefile: 928; lisp: 488; awk: 393; perl: 319; sed: 25
file content (15933 lines) | stat: -rw-r--r-- 578,154 bytes parent folder | download
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
2025-12-11  Sergey Poznyakoff  <gray@gnu.org>

        Version 9.1


2025-12-11  Sergey Poznyakoff  <gray@gnu.org>

        Upgrade copyright years


2025-11-22  Sergey Poznyakoff  <gray@gnu.org>

        Two new debugging functions

          string stack_trace_format(string fmt)
         string stack_trace_top(string fmt)

        * src/builtin/debug.bi: Implement stack_trace_format and 
        stack_trace_top.
        * src/builtin/snarf.m4 (MF_OBSTACK_LENGTH): New macro.
        * src/drivers.c (code_type_result): Mark locus at the entry.
        * src/mailfromd.h (mfd_stack_framer_t): New data type.
        (env_stack_trace): New proto.
        * src/prog.c (env_stack_trace): New function.
        (runtime_stack_trace): Rewrite using it.
        (heap_obstack_length): New function.
        * src/prog.h (heap_obstack_length): New proto.

        * tests/stracefmt.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Add new test.
        * tests/strace.at: Fix typo in keywords.

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.

2025-11-19  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix


2025-11-18  Sergey Poznyakoff  <gray@gnu.org>

        Fix in the testsuite.

        * tests/progdup.at: Ignore site-wide configuration files.

2025-11-18  Sergey Poznyakoff  <gray@gnu.org>

        Add missing typecasts.


2025-11-18  Sergey Poznyakoff  <gray@gnu.org>

        Pass source location as arguments to prog action

        * src/drivers.c (code_type_result): Pass source location to the
        action.
        * src/gram.y (state_parms): Update smtp_state_action definition.
        * tests/hook.at: Test for correctness of the action locus.
        * NEWS: Document changes.
        * doc/mailfromd.texi: Document changes.

2025-11-08  Sergey Poznyakoff  <gray@gnu.org>

        Add INTLLIBS to loader flags everywhere


2025-11-07  Sergey Poznyakoff  <gray@gnu.org>

        Fix installing *.elc files.


2025-10-10  Sergey Poznyakoff  <gray@gnu.org>

        Minor changes


2025-09-20  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/engine.c (mlfi_negotiate): Register "i" for
        smtp_state_connect, instead of for the first state for which a
        prog is declared.  This fixes a bug introduced by 5ffc17f7e6. 
        Since that commit, xxfi_connect field of smfilter is always
        initialized, so the first_used_state variable and the logic
        associated with it loses its sense.  The first entered handler
        is mlfi_connect, and it is the handler which triggers invocation 
        of prog begin, if such is defined.  Now, "i" should be available
        in all handlers, hence it must be registered for
        smtp_state_connect.

2024-09-04  Sergey Poznyakoff  <gray@gnu.org>

        Remove the 'published by' clause


2024-09-01  Sergey Poznyakoff  <gray@gnu.org>

        Fix the clamav function to work with clamav version 0.104

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * doc/mailfromd.texi: Likewise.
        * configure.ac: Version 9.0.90
        * src/builtin/sa.bi (clamav_stream_max_length): New MFL global
        variable.
        (spamd_send_stream): Fix buffer tuning.
        (spamd_connect): Take the crlf argument indicating whether the
        returned stream should implement CRLF filtering,
        (open_connection): Likewise.
        (spamc): Request CRLF filtering,
        (clamav_send_stream): New function.
        (clamav): Rewrite using the INSTREAM command.

2024-08-26  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/drivers.c (optimize_type_sedcomp): Don't install NULL
        pointer into transform table to avoid segfaulting during further
        optimizations.

2024-06-25  Sergey Poznyakoff  <gray@gnu.org>

        callout: return the "less critical" answer if no MX gives a
        definite one.

        E.g., if among three MXs one returns mf_timeout, another one
        mf_temp_failure and yet another one mf_failure, the result of
        callout_mx will be mf_temp_failure.

        * src/callout.c (callout_mx): Assign weights for various status 
        codes. Unless some of the MXs returns a definite answer, the
        status code with numerically smaller weight gains.

2024-06-25  Sergey Poznyakoff  <gray@gnu.org>

        Accept DNS replies containing forbidden characters.

        * lib/dns.c (DEFAULT_QFLAGS): Add adns_qf_quoteok_anshost bit.

2024-05-20  Sergey Poznyakoff  <gray@gnu.org>

        Fix typo in documentation.


2023-12-06  Sergey Poznyakoff  <roland@spinnaker.de>

        Little typo in the word "message".


2024-01-05  Sergey Poznyakoff  <gray@gnu.org>

        Version 9.0


2024-01-05  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright years


2023-11-13  Sergey Poznyakoff  <gray@gnu.org>

        callout: use TLS if the server fails with 530 after RCPT TO

        Some servers claim that TLS is required after RCPT TO command. 
        Reported by Jan in
        <alpine.LNX.2.00.2311030012150.22092@cedric.unob.cz>

        * src/callout.c (callout_mode): New enum.
        (callout_io): Additional callout_mode argument instructs the 
        function how to handle the callout. The function calls itself 
        recursively as needed. Maximum recursion depth is 2, so that's 
        not much of a problem. All uses changed.

2023-11-13  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * lib/srvman.c (set_signal_handlers, restore_signal_handlers):
        Signal numbering starts at 1.

2023-09-26  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * mflib/cdb.mfl (cdb_check): Fix the 'mx' case: accept email
        address as argument.

2023-09-26  Sergey Poznyakoff  <gray@gnu.org>

        Use sigaction(2). Remove legacy signal(2) use.


2023-08-30  Sergey Poznyakoff  <gray@gnu.org>

        Revise the docs for primitive_resolve


2023-07-30  Sergey Poznyakoff  <gray@gnu.org>

        Proof-read the docs


2023-07-26  Sergey Poznyakoff  <gray@gnu.org>

        Separate IPv4 and IPv6 tests.


2023-07-26  Sergey Poznyakoff  <gray@gnu.org>

        Remove unused e_noresolve exception

        The exception is not in use since commit 368a705fe (version 8.3)

        * doc/mailfromd.texi: Update.
        * mflib/status.mfl (e_noresolve): Replace with e_too_many.

2023-07-26  Sergey Poznyakoff  <gray@gnu.org>

        Introduce the e_too_many exception.

        * doc/functions.texi: Document exceptions raised by
        ptr_validate.
        * doc/mailfromd.texi: Document the e_too_many exception.
        * lib/dns.c (dns_to_mf_status): Translate dns_too_many as well.
        * lib/dns.h: Add comment to dns_status constants.
        * mflib/status.mfl (e_too_many): New exception.

2023-07-20  Sergey Poznyakoff  <gray@gnu.org>

        Update POTFILES.in


2023-07-20  Sergey Poznyakoff  <gray@gnu.org>

        Define Sendmail macros in run mode.

        * NEWS: Document changes.
        * doc/mailfromd.texi: Likewise.
        * src/gram.y (mailfromd_run): New arguments: macc and macv
        (number and vector of Sendmail macro definitions.
        * src/mailfromd.h (mailfromd_run): Change prototype.
        * src/main.c (argv_split): New function.
        (main): Use argv_split to preprocess command line arguments.

2023-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Fix handling of positional parameters.

        The check for positional parameters usage introduced in 20cdf6a2 
        used wrong lexical context and caught otherwise legitimate use 
        cases. This was aggravated by the fact that positional
        parameters in quoted strings were handled by another code, and
        all available tests were using positionals in strings, due to
        which they were unable to catch the bug.

        Reported by Jan Rafaj.

        * src/gram.y (arg production): Move all checks to
        create_node_arg, which use.
        (T_ARGX): Fix the use of context.
        (funcarglist): Accept single argv. This makes it possible to
        pass $@ as single argument.
        (node_type): Return dtype_any for node_type_noop.
        (create_node_arg): Check for proper usage. Adjust argument
        number for variadic functions.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.
        * tests/catch03.at: New test.
        * tests/vapass.at: Check the x($@) case.

2023-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Revert "Bugfix"

        This reverts commit 6f97112dde184819de19ce8f792bee59041248a9.

2023-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/gram.y: Rely on inner context to check positional argument
        usage.

2023-07-17  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes in pmult

        * configure.ac: Reflect the change in default meta1 library
        location.
        * pmult/pmult.c (pmult_priv_data): Change types of nrcpt and 
        nbadrcpts to unsigned long.
        (_cb_define): Return error indication.
        (pmult_connect): Use mu_sys_sockaddr_format instead of 
        mu_sockaddr_to_astr.

2023-07-15  Sergey Poznyakoff  <gray@gnu.org>

        New functions: dc and sq.

        * NEWS: Document changes.
        * doc/functions.texi: Document changes.
        * src/builtin/tr.bi (sq,dc): New funtions.
        (tr): Rewrite using a generator function.
        * tests/dc.at: New test.
        * tests/sq.at: New test.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Likewise.

2023-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Minor consistency fix


2023-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Implement character classes in tr.  Rewrite tests.

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * doc/mailfromd.texi: Likewise.
        * src/builtin/.gitignore (BI_FILES): Add tr.c
        * src/builtin/Makefile.am: Add tr.bi
        * src/builtin/snarf.m4 (MF_STASH, MF_UNSTASH): New macros.
        * src/builtin/string.bi: Remove tr code.
        * src/builtin/tr.bi: New file.
        * tests/tr.at: New file.
        * tests/Makefile.am: Add tr.at
        * tests/testsuite.at: Include tr.at
        * tests/strings.at: Remove tr tests.

2023-07-12  Sergey Poznyakoff  <gray@gnu.org>

        Remove backward compatible syntax for begin and end handlers.

        Reword some error messages.

2023-07-11  Sergey Poznyakoff  <gray@gnu.org>

        Remove deprecated and useless feature (nameless formal
        parameters).


2023-07-08  Sergey Poznyakoff  <gray@gnu.org>

        Fix typo (missing call to test) in etc/Makefile.am


2023-07-08  Sergey Poznyakoff  <gray@gnu.org>

        Document #error and #warning

        * doc/mailfromd.texi: Document #error and #warning. Change
        sectioning a bit.
        * src/lex.l: Unescape backslash and double quote in argument to
        #warning and #error.

2023-07-08  Sergey Poznyakoff  <gray@gnu.org>

        Withdraw compatibility features: .mf suffix and using include
        path for module search


2023-07-08  Sergey Poznyakoff  <gray@gnu.org>

        Implement the tr function.

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * src/builtin/string.bi (tr): New function.
        * tests/strings.at: Test the tr function.

2023-07-07  Sergey Poznyakoff  <gray@gnu.org>

        Merge branch 'ip6'


2023-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Add dnsbl test


2023-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Rework exception testsuite


2023-07-05  Sergey Poznyakoff  <gray@gnu.org>

        Fix distcheck


2023-07-05  Sergey Poznyakoff  <gray@gnu.org>

        New IP manipulation functions.  Improve docs.

        * NEWS: Document changes.
        * doc/functions.texi: Document changes.
        * doc/mailfromd.texi: Likewise.
        * doc/upgrade.texi: Likewise.
        * configure.ac: Version 8.17.90
        * lib/Makefile.am (AM_CPPFLAGS): Add top_srcdir (needed for 
        mflib/status.h)
        * mtasim/Makefile.am: Likewise.
        * tests/Makefile.am: Likewise.
        * mflib/Makefile.am (DEPRECATED_MFL): List deprecated modules
        here. Provide special rule (.mfl.lintw) for linting them.
        * mflib/heloarg_test.mfl: Use is_ipstr instead of is_ip
        * mflib/is_ip.mfl: Explicitly mark as deprecated.
        (is_ip): Rewrite using is_ip4str.
        * mflib/match_cidr.mfl: Explicitly mark as deprecated.
        (match_cidr): Remove.
        * mflib/match_dnsbl.mfl: Remove require match_cidr.
        * mflib/match_rhsbl.mfl: Likewise.
        * mflib/revip.mfl: Explicitly mark as deprecated.
        * src/builtin/dns.bi (dns_reverse_ip): Remove.
        * src/builtin/ipaddr.bi (reverse_ipstr)
        (is_ipstr, is_ip4str, is_ip6str, match_cidr): New functions.
        * src/lex.l: New preprocessor statement: #warning. The #error
        statement requires argument in double-quotes.
        * tests/catch.at: Don't use deprecated modules and functions.
        * tests/catch01.at: Likewise.
        * tests/cidr.at: Likewise.
        * tests/invcidr.at: Likewise.
        * tests/invcidr2.at: Likewise.
        * tests/invip.at: Likewise.
        * tests/invip2.at: Likewise.

2023-07-04  Sergey Poznyakoff  <gray@gnu.org>

        Improvements in DNS-related functions

        * NEWS: Document changes.
        * doc/functions.texi: Document changes.
        * lib/dns.c (soa_check,dns_resolve_hostname)
        (resolve_hostname): Additional argument: address family to use
        (dns_reply_resolve): Change semantics of the last argument.
        (ptr_validate): Remove the family argument. It is deduced from
        the ipstr.
        * lib/dns.h: Include mflib/status.h
        (resolve_none,resolve_ip4,resolve_ip6): Keep in sync with MFL
        constants.
        * lib/libmf.h (dns_resolve_hostname,ptr_validate): Change
        signatures.
        (resolve_hostname): Remove.
        * mflib/dns.mf4 (resolve): New optional argument: family.
        * mflib/status.mfl (RESOLVE_NONE, RESOLVE_DFL)
        (RESOLVE_IP4,RESOLVE_IP6): New constants.
        * src/builtin/dns.bi (primitive_resolve): New optional argument:
        resolve_family.
        (dns_query): Change semantics of the resolve argument.
        * src/mailfromd.h (resolve_hostname): Change signature.
        * src/spf.c: Fix calls to ptr_validate.

        * tests/resolv.c (reply_print): Add missing break.
        (res_soa): Remove options.
        (res_aaaa): New function.
        (res_ns): New function.
        (res_ip): Handle the -ip & -ip6 options.
        (mode): New modes: "aaaa" and "ns".

        * tests/testsuite.at (MFT_REQUIRE_IPV6): New macro.
        * tests/connect03.at: Use MFT_REQUIRE_IPV6
        * tests/dns_query.at: Test IPv4 and IPv6.
        * tests/ismx.at: Likewise.
        * tests/resolv_a.at: Test IPv6.
        * tests/resolv_ptr.at: Test IPv6.
        * tests/resolv_ptr_val.at: Test IPv6.
        * tests/resolve.at: Test IPv6.

2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        primitive_resolve: Rewrite two-argument version

        * lib/dns.c (dns_resolve_ipstr,resolve_ipstr): Remove the domain 
        argument.  All callers changed.
        (dns_reverse_name): New function.
        (ptr_lookup): Restore function (signature changed).
        * lib/dns.h (dns_reverse_name): New proto.
        (dns_resolve_ipstr): Change signature.
        (ptr_lookup): Restore function (signature changed).
        * src/builtin/dns.bi (primitive_resolve): Rewrite handling of
        the domain argument.
        * tests/resolv.c: Reflect changes.

2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        New built-in function: dns_reverse_ip

        * lib/dns.c (dns_reverse_ipstr): Rewrite to support IPv6. Take
        buffer size as third argument.
        * lib/dns.h (dns_reverse_ipstr): Change prototype.
        * src/builtin/dns.bi (dns_reverse_ip): New built-in function.

2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        Fix reverse representation of IP addresses.

        * lib/dns.c (cidr_format_reverse): Rewrite.
        * lib/dns.h (IPV4_DOTTED_BUFSIZE, IPV6_DOTTED_BUFSIZE): Fix
        definitions.
        (IPV4_BYTE_FMT, IPV6_BYTE_FMT): Remove.

2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        test SPF ip6 method


2023-07-01  Sergey Poznyakoff  <gray@gnu.org>

        Use uint32_t instead of gacopyz_uint32_t


2023-07-01  Sergey Poznyakoff  <gray@gnu.org>

        Initialize address family in evaluation environment

        * src/gram.y (mailfromd_test): Use client_addr sendmail macro to 
        deduce the connection protocol in test mode.
        * src/prog.c (create_environment): Assume AF_INET address family 
        by default.

2023-07-01  Sergey Poznyakoff  <gray@gnu.org>

        SPF: Implement IPv6 support

        * lib/dns.c (dns_resolve_ipstr): Change signature: take struct
        dns_reply * as third argument.  Return all results. All callers
        changed.
        (ptr_lookup): Removed. Use dns_resolve_ipstr instead.
        (ptr_validate): Support for IPv6.
        (resolve_ipstr_domain): Rewrite using dns_resolve_ipstr.
        * lib/dns.h (dns_resolve_ipstr): Change prototype.
        (ptr_lookup): Remove prototype.
        * src/builtin/dns.bi (dns_query): Use dns_resolve_ipstr instead 
        if ptr_lookup.
        * src/spf.c (mech_ptr): Support for IPv6.
        (mech_ip4,mech_ip6): Combine into single function: mech_ip.
        * tests/resolv.c: Use dns_resolve_ipstr instead if ptr_lookup.

2023-07-01  Sergey Poznyakoff  <gray@gnu.org>

        IPv6 support in DNS functions.

        * lib/dns.c (dns_reply_elsize): Remove static qualifier. Handle
        IPv6.
        (dns_reply_ip6_push): New function.
        (dns_reply_str_push): Minor fix.
        (dns_reply_push): Handle IPv6.
        (dns_str_is_ipv6): New function.
        (dns_reply_resolve): Take second argument specifying whether and
        how to resolve symbolic names. Handle IPv6.
        (cidr_format_reverse,cidr_to_arpa): New functions.
        (dns_resolve_ipstr): Handle IPv6.
        (aaaa_lookup): New function.
        * lib/dns.h (dns_reply_ip6): New reply type.
        (dns_reply): Keep IPv4 addresses as struct in_addr. All uses
        changed. New field:ip6.
        (resolve_none, resolve_ip4, resolve_ip6): New constants.
        (IPV4_INADDR_DOMAIN,IPV4_DOTTED_BUFSIZE)
        (IPV4_INADDR_BUFSIZE,IPV6_INADDR_DOMAIN)
        (IPV6_DOTTED_BUFSIZE,IPV6_INADDR_BUFSIZE)
        (IPV4_BYTE_FMT,IPV6_BYTE_FMT)
        (IPMAX_DOTTED_BUFSIZE,IPMAX_INADDR_BUFSIZE): New defines.
        (dns_reply_elsize, dns_str_is_ipv6)
        (aaaa_lookup): New functions.
        * mflib/dns.mf4 (DNS_TYPE_AAAA): New constant.
        * src/builtin/dns.bi (resolve_host): Take address family as
        argument.
        (dns_replies_intersect): Handle all reply types.
        (dns_reply_string): Handle IPv6.
        (dns_reply_ip): Fix return type.
        (dns_query): Resolve symbolic names according to the connection
        address family.
        * src/builtin/snarf.m4 (MF_SOCKET_FAMILY): New macro.
        * src/engine.c (mlfi_connect): Save address family in env.
        (smfilter): Always use mlfi_connect.
        * src/prog.c (eval_environ): New field: conn_family.
        (env_save_socket_family, env_socket_family): New functions.
        * src/prog.h (env_save_socket_family, env_socket_family): New
        protos.
        * src/spf.c (mech_a): Handle IPv6.
        * tests/resolv.c: Likewise.

2023-06-29  Sergey Poznyakoff  <gray@gnu.org>

        Prepare for IPv6 support in SPF.

        * src/spf.c (spf_data): Use struct mu_cidr to represent
        originator IP. All uses changed. (spf_data): Use struct mu_cidr
        to represent originator IP.
        (spf_expand_do): Support IPv6 in %{i} and %{c}.

2023-07-07  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.17


2023-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Fix implicit registering of the $i macro

        The macro is used in diagnostic messages and is therefore always 
        requested. This was broken in 4b12de188, which changed the
        initial value of a variable that holds the index of the first
        milter state for which a handler is registered.

        * src/engine.c (milter_enable_state): Set first_used_state if it 
        is smtp_state_none (its initial value since 4b12de188).

2023-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Change format of the cdb diagnostic messages


2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        Quote dollar signs in third (default value) argument to
        AC_PATH_PROG


2023-07-02  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        * src/builtin/db.bi (dbmap_lookup): Fix typecast.
        * src/gram.y (apply_deferred_init): Print source location before 
        the warning.
        * src/savsrv.c (addq): Fix "starttls" handling.

2023-06-30  Sergey Poznyakoff  <gray@gnu.org>

        cdb: support the "continue" action


2023-06-29  Sergey Poznyakoff  <gray@gnu.org>

        SPF tests

        * src/builtin/spf.bi (spf_macro_expand): New function.
        * src/spf.c (scanforw): New function.
        (scanback, spf_reverse, spf_truncates, pf_repl): Accept multiple 
        delimiters.
        (spf_transform): Handle multiple delimiters.
        (spf_test_macro_expand): New function.
        * src/spf.h (spf_test_macro_expand): New proto.
        * tests/Makefile.am: Add new files.
        * tests/testsuite.at: Include new files.
        * tests/spf.at: New file.
        * tests/spfexp.at: New file.

2023-06-28  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.16.93


2023-06-28  Sergey Poznyakoff  <gray@gnu.org>

        Add missing file to tests/.gitignore


2023-06-28  Sergey Poznyakoff  <gray@gnu.org>

        Minor changes

        * mfmod/mfmod.m4 (AC_MFL_EXTRACT_PATH): Compatibility change in
        sed invocation
        * mfmod/mfmodnew.c: Fix copyright year.

2023-06-28  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.16.92


2023-06-28  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * am/proctitle.m4 (MF_PROCTITLE): Fix reverted condition. 
        Introduced by b7354a715a

2023-06-27  Sergey Poznyakoff  <gray@gnu.org>

        Disable IPv6 tests if IPv6 is disabled

        * tests/ipv6on.c: New auxiliary program.
        * tests/Makefile.am: Build ipv6on.
        * tests/connect03.at: Skip test if IPv6 is disabled.

2023-06-25  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.16.91

        * configure.ac: Raise version number.
        * NEWS: Document changes.
        * doc/functions.texi: Document changes.
        * src/builtin/db.bi (dbnext): Fix improper freeing.
        (dbnext): New function.

2023-06-24  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/builtin/mfmod.bi (dlcall): Fix arguments to
        MF_DCL_CLEANUP.

2023-06-23  Sergey Poznyakoff  <gray@gnu.org>

        Always build with IPv6 support


2023-06-23  Sergey Poznyakoff  <gray@gnu.org>

        Minor doc changes


2023-06-19  Sergey Poznyakoff  <gray@gnu.org>

        Minor change


2023-06-19  Sergey Poznyakoff  <gray@gnu.org>

        Reorder tests


2023-06-19  Sergey Poznyakoff  <gray@gnu.org>

        New module: cdb

        * doc/mailfromd.texi: Document changes.
        * doc/functions.texi: Likewise.
        * doc/mtasim.texi: Likewise.
        * NEWS: Likewise.

        * mflib/Makefile.am: Add cdb.mfl
        * mflib/cdb.mfl: New module.
        * mflib/milter.mfl: Add missing "module" statement.
        * mtasim/mtasim.c: New port option: --port dir:NAME
        * tests/Makefile.am: Add cdb.at
        * tests/atlocal.in (DEFAULT_DB_TYPE): New variable.
        * tests/cdb.at: New file.
        * tests/testsuite.at (MFT_MTASIM): Select the format of the -X 
        option to use depending on whether the statedir (defined by the 
        STATEDIR variable) exists. Include cdb.at

2023-06-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix source location tracking after emitted action hook call

        See also 5133ed34.

2023-06-14  Sergey Poznyakoff  <gray@gnu.org>

        Introduce action hooks

        Action hook is a special prog handler which, if defined, is
        implicitly invoked before each reply action (such as accept,
        reject, etc.) It is passed the action code, basic and extended
        SMTP codes and textual message string as its arguments.  Action
        hooks provide a convenient way for logging and accounting of
        executed actions.

        This commit also fixes several bugs found while developing the
        new feature.

        * configure.ac: Version 8.16.90
        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * doc/mailfromd.texi: Likewise.

        * gacopyz/context.c (format_message): Fix line counting in case
        of empty message. This makes sure code and xcode are honored
        even without explicit message.
        * gacopyz/gacopyz.c (parse_state_arg): Minor change.
        * gacopyz/server.c (format_argv): Don't output extra \0 at the
        end of the list.
        * global.def (DEFAULT_REJECT_CODE)
        (DEFAULT_TEMPFAIL_CODE): New constants.
        (MAX_E_EXCEPTIONS): Fix definition.

        * mflib/milter.mfl: New file.
        * mflib/Makefile.am (MFL_FILES): Add email.mfl and milter.mfl.
        (noinst_HEADERS): Add milter.h
        * mflib/mfh.awk: Handle multiline "const" blocks.

        * mtasim/mtasim.c (set_expected_regex): New function.
        (check_expected_code): Check if the expected regex matches.
        (send_body): Flush remaining text in the buffer.
        (shell): Parse optional regex after \E.
        (smtp): Allow doubly-quoted strings as command arguments.

        * src/builtin/other.bi (milter_state_name, milter_state_code)
        (milter_action_name, milter_action_code): New built-ins.
        * src/builtin/vars.bi (milter_state): New variable.
        (set_milter_state): New function.
        * src/drivers.c (code_type_result): call action hook, if
        defined.
        (optimize_type_builtin): Fix improper optimization look. A
        single call to optimize suffices.
        (optimize_type_call): Call optimize_node instead of optimize.

        * src/engine.c (xeval): Call set_milter_state.
        * src/gram.y: Include global.h
        (action_hook_pc): New static variable.
        (state_parms): Define parameters for smtp_state_action.
        (parmtype_function): Return proper type for typed variadic 
        parameters.
        (grammar): Allow for multiple definitions of handlers. Fix type
        tracking for variadic parameters. Use default codes for reject
        and tempfail, when called without arguments.
        (arg production): Fix up argument index to address variadic 
        arguments.
        (parse_program): Call define_action_ids.
        (action_hook_fixup): New function.
        (compile_tree): Fix up action hook calls.
        (sfsistat_tab): New field: constname.
        (sfsistat_code): New function.
        (define_action_ids): New function.
        (statenames): Define name for smtp_state_action.
        (state_to_string): Don't abort on invalid input.
        (xstate_to_string): New function.
        (node_type): Return actual type for node_type_argx.
        (create_node_arg): Fix type handling and addressing for variadic 
        arguments.
        * src/mailfromd.h: Include mflib/milter.h
        (smtp_state): Define smtp_state_count.
        (argx_node): New field: dtype.
        (sfsistat_code,xstate_to_string,set_milter_state): New proto.
        * src/prog.c (runtime_warning): Bugfix: use mu_diag_cont_vprintf 
        instead of mu_diag_cont_printf.
        * src/prog.h (create_node_string): New proto.

        * tests/bodyargs.at: New file.
        * tests/connargs.at: New file.
        * tests/eohargs.at: New file.
        * tests/eomargs.at: New file.
        * tests/hdrargs.at: New file.
        * tests/heloargs.at: New file.
        * tests/hook.at: New file.
        * tests/vararg.at: New file.
        * tests/Makefile.am: Add new files.
        * tests/arg.at: Rewrite.
        * tests/fromargs.at: Rewrite.
        * tests/invip2.at: Fix expected output.
        * tests/numrcpt.at: Fix regexp.
        * tests/progdup.at: Change expected output.
        * tests/rcptargs.at: Add more tests.
        * tests/reject.at: Add more tests.
        * tests/tempfail.at: Add more tests.
        * tests/testsuite.at (MFT_MTASIM): Catch exit code mismatch. 
        Include new tests.

2023-05-24  Sergey Poznyakoff  <gray@gnu.org>

        Fix source location tracking

        * src/drivers.c: Force emission of LOCUS instruction after
        function calls.

2023-05-24  Sergey Poznyakoff  <gray@gnu.org>

        Fix preprocessor selection in configure.ac

        * configure.ac: Properly quote string argument to expr.

2023-05-23  Sergey Poznyakoff  <gray@gnu.org>

        Update mailfromd_copyright_year


2023-05-16  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/spf.c: Lift unnecessary length limit.

2023-05-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix the leftover AC_HELP_STRING in mfmod/mfmod.m4


2023-05-01  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.16


2023-04-25  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.15.91

        Upgrade to autoconf 2.71

2023-04-25  Sergey Poznyakoff  <gray@gnu.org>

        Support for PKCS#8 keyfile format

        * src/dkim.c: Support for PKCS#8
        * src/builtin/dkim.bi (dkim_read_priv_key): New function (for 
        debugging purposes).
        * doc/functions.texi: Update.
        * NEWS: Update.

2023-03-29  Sergey Poznyakoff  <gray@gnu.org>

        Fix error in the manual

        * doc/functions.texi: fix description of the safedbmap function.

2023-03-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix quoted string handling in smmsg

        * lib/smmsg.c (scan_next): Disable special handling for
        delimiters in quoted strings.
        * tests/commaize.at: Add new test.

2023-03-02  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.15.90


2023-03-02  Sergey Poznyakoff  <gray@gnu.org>

        Fix uninitialized variable in dkim_verify

        * src/dkim.c (dkim_sig_verify): Initialize result.

2023-02-14  Sergey Poznyakoff  <gray@gnu.org>

        Fix error handling in cname chain resolver.

        * lib/dns.c (dns_query): Break the loop if unhandled error is 
        encountered.
        * tests/resolv_cnamechain.at: Check resolution of a cname loop 
        that ends with nxdomain.

2023-01-22  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright years


2023-01-07  Sergey Poznyakoff  <gray@gnu.org>

        Fix %o in sprintf builtin


2022-12-13  Sergey Poznyakoff  <gray@gnu.org>

        Fix MFL stack trace

        * src/prog.c (stack_find_locus): Fix type casts for symbol
        offset and line number.

2022-12-11  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.15


2022-11-04  Sergey Poznyakoff  <gray@gnu.org>

        Improve variadic function declaration; Change mfmod interface

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * doc/mailfromd.texi: Likewise.
        * src/builtin/mfmod.bi (modinfo): Remove fields: symname and
        retval.
        (dlcall): Return type changed to ANY.  Push return value on
        stack.
        (dlresult_string,dlresult_number,dlresult_message): Removed.
        * src/builtin/snarf.m4 (__mf_argtype): Support for ANY.
        * src/drivers.c (optimize_type_cast): Bug fix (string ->
        number).
        (code_cast): Support dtype_any.
        * src/gram.y (cast_arg_list): Take data_type_t as the last
        argument. All uses changed. Accept type spec before ellipsis in
        variadic declaration. Special type cast void().
        * src/lex.l: New keyword "void".
        * src/mailfromd.h (dtype_any): New data type.
        (function): New field "vartype".
        * src/symbols.c (function_install): New argument: vartype.  Set
        up type promotion for variable arguments depending on it.
        * tests/mfmod01.at: Return the value returned by dlcall. Use
        void() when necessary.
        * tests/mfmod02.at: Likewise.
        * tests/mfmod03.at: Likewise.  Use explicit type specification
        in variadic function declaration.

2022-10-31  Sergey Poznyakoff  <gray@gnu.org>

        Reindent lex.l


2022-10-30  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        To ensure proper order of shutdown routines, don't use onexit.

        * lib/libmf.h (mf_server_shutdown_hook): New extern.
        * lib/server.c (mf_server_start): Call mf_server_shutdown_hook 
        before exiting.
        * src/main.c (close_strecho): Remove.
        (main): Install mf_server_shutdown_hook before calling 
        mf_server_start, call run_shutdown when appropriate.
        * src/prog.c (run_shutdown): Change signature.
        (run_startup): Don't use mu_onexit.
        * src/prog.h (run_shutdown): New proto.
        * tests/progord.at: Fix expected output.

2022-10-30  Sergey Poznyakoff  <gray@gnu.org>

        New option to redirect the "echo" output

        * NEWS: Document changes.
        * doc/mailfromd.texi: Document changes.
        * src/main.c (mailfromd_options): New option: --echo[=FILE].
        (open_strecho): Use the new option.

2022-10-30  Sergey Poznyakoff  <gray@gnu.org>

        Use logging.print-severity to control message severity output

        * lib/libmf.h (logger_set_print_severity): New proto.
        * lib/logger.c (logger_open): Don't force MU_LOGMODE_SEVERITY on
        the standard error stream.
        (logger_set_print_severity): New function.
        * src/calloutd.c (main): Enable printing message severity by 
        default.
        * src/main.c: Likewise.

2022-10-29  Sergey Poznyakoff  <gray@gnu.org>

        Update NEWS


2022-10-27  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes in the docs


2022-10-22  Sergey Poznyakoff  <gray@gnu.org>

        Preserve variable assignments done in startup handler

        * src/engine.c (xeval): Remove special handling for
        smtp_state_begin.
        (xeval_begin): New function to replace xeval(X,
        smtp_state_begin). All uses updated.
        * src/mailfromd.h (xeval_begin): New proto.
        * src/prog.c (run_startup): Run final gc and update datasize to 
        the new value of toh after it, in order to preserve assignments 
        done in startup handler.
        * tests/startup.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.

2022-10-22  Sergey Poznyakoff  <gray@gnu.org>

        Change reference to the doc section


2022-10-21  Sergey Poznyakoff  <gray@gnu.org>

        Fix the docs: a DBM URL must have // after colon


2022-10-20  Sergey Poznyakoff  <gray@gnu.org>

        Describe the --show-default option in detail.


2022-10-20  Sergey Poznyakoff  <gray@gnu.org>

        Accept scheme prefix in database file names (database.file
        statement)

        * lib/namefixup.c (mf_file_name_ptr_fixup): Take into account
        optional scheme prefix.
        * doc/mailfromd.texi: Document the changes.
        * NEWS: Likewise.

2022-10-19  Sergey Poznyakoff  <gray@gnu.org>

        spf: fix in A mechanism

        * src/spf.c (mech_a): Fix netmask handling.

2022-10-14  Sergey Poznyakoff  <gray@gnu.org>

        Two new debugging functions


2022-10-14  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/prog.c (instr_saveex): Don't use cached exception table
        address, as it can change due to dataseg expansion.

2022-10-10  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        * doc/mailfromd.texi: Minor changes.
        * mfmod/template.mfl (libname,libh): Mark internal variables as
        static.
        * src/builtin/mfmod.bi (dlcall): Initialize varargs.

2022-10-06  Sergey Poznyakoff  <gray@gnu.org>

        Improve dlcall interface

        * doc/mailfromd.texi: Document changes.
        * src/builtin/mfmod.bi (dlcall): Last symbol in the type string 
        can be '+' or '*', indicating optional arguments.
        * src/prog.c (env_final_gc): Fix memory leak.
        * tests/mfmod_echo.c (sum): New function.
        * tests/mfmod03.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.

2022-10-04  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        * elisp/mfl-mode.el (mfl-keywords): Add dclex.
        * src/builtin/io.bi (open_program_stream_ioe): Run the command
        via
        $SHELL -c.
        * src/prog.c (run_startup): Fix size calculation.

2022-10-03  Sergey Poznyakoff  <gray@gnu.org>

        Fix typos in diagnostic messages


2022-10-03  Sergey Poznyakoff  <gray@gnu.org>

        Update docs


2022-09-30  Sergey Poznyakoff  <gray@gnu.org>

        mfmod: export functions for checking argument counts and types

        * Makefile.am [MFMOD_COND] (mfmod): Include conditionally.
        * doc/mailfromd.texi: Document new functions and macros.
        * mfmod/Makefile.am (pkginclude_HEADERS): Install mfmod.h
        * src/mfmod.h: move to mfmod/mfmod.h
        (mfmod_data_type_str,mfmod_error)
        (mfmod_error_argtype): New protos.
        (ASSERT_ARGCOUNT,ASSERT_ARGTYPE): New macros.
        * mfmod/template.c: Use new macros. Improve docs.
        * src/Makefile.am [MFMOD_COND] (mailfromd_LDFLAGS): Use
        -export-dynamic
        * src/builtin/mfmod.bi (mfmod_data_type_str,mfmod_error)
        (mfmod_error_argtype): New functions.
        * tests/mfmod_echo.c: Use new macros.
        * tests/mfmod02.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Likewise.
        * mfmod/template.mfl: Use new syntax (prog startup).

2022-09-30  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix in lex scanner

        * src/lex.l: Check for eventual errors during numeric
        conversions.
        * src/Makefile.am: Remove reference to unused variable.

2022-09-28  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.14.94


2022-09-28  Sergey Poznyakoff  <gray@gnu.org>

        New syntax for special handlers

        Special handlers are defined using the "prog" keyword, as the 
        rest of handlers.  This fixes, in particular, a name clash
        between the 'shutdown' handler and eponymous function.

        This commit also restores handling of identifiers after
        'require' and initial 'from' keywords, which was inadvertently
        lost long ago
        (commit bd6d33fe0).  Perhaps it wasn't needed so much, but for
        the time being let it be.

        * NEWS: Document changes.
        * doc/mailfromd.texi: Likewise.
        * doc/upgrade.texi: Likewise.

        * etc/Makefile.am: Fix the lint rule.
        * mflib/callout.mf4: Use new syntax for "begin".
        * src/gram.y: Support new syntax for special handler
        definitions/ Remove tokens: T_BEGIN, T_STARTUP, T_SHUTDOWN,
        T_END. Correctly report state handler duplications.
        * src/lex.l: Swich to XIDENT state after 'prog', 'require' and 
        initial 'from'. Remove unneeded tokens. Use strtol instead of
        strtoul to parse numeric constants.

        * tests/progdup.at: New test.
        * tests/progobs.at: New test.
        * tests/progord.at: New test.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Run new tests.

2022-09-27  Sergey Poznyakoff  <gray@gnu.org>

        Fix conditional compilation

        * configure.ac: Define WITH_MAILUTILS_GNUTLS to 1 or 0, 
        depending on whether TLS is supported or no.

2022-09-26  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix in docs


2022-09-26  Sergey Poznyakoff  <gray@gnu.org>

        Fix running startup handlers in daemon mode.

        * lib/libmf.h (mf_epriv_setup): Remove proto.
        (mf_server_startup_hook): New extern.
        * lib/server.c (mf_server_startup_hook): New global.
        (mf_server_start): Call mf_server_startup_hook after switching 
        to user privileges and eventually daemonizing.
        * lib/userprivs.c (mf_epriv_setup): Remove unused function.
        * src/main.c: In daemon mode, make sure run_startup is run as 
        mf_server_startup_hook.

2022-09-25  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.14.93


2022-09-25  Sergey Poznyakoff  <gray@gnu.org>

        New special handlers: startup and shutdown

        * NEWS: Document changes
        * doc/mailfromd.texi: Document changes

        * elisp/mfl-mode.el: Support for the "startup" and "shutdown"
        keyword.
        * mfmod/template.mfl: Load the library in the startup handler.
        * src/builtin/mfmod.bi: Use static variable for keeping modinfo 
        of the loaded modules.  This allows for using dlopen in startup 
        handlers.
        * src/gram.y: Support for startup and shutdown handlers.
        (print_syntax_tree): Print special handlers as well.
        (state_parms): Update.
        (string_to_state,state_to_string): Rewrite.
        * src/lex.l (startup): New keyword.
        * src/mailfromd.h (smtp_state_startup)
        (smtp_state_shutdown): New states.
        (smtp_state_first): Redefine.  All uses changed.
        (smtp_state_last): New state marker. States between 
        smtp_state_first and smtp_state_last (both inclusive) are proper
        SMTP states, as distinguished from "special" states
        (startup, shutdown, begin, end).
        (struct function) <refstart>: New field.  Start of the entry 
        point reference chain.
        (struct progdecl) <tree>: Change type to stmtlist. Keep both 
        head and tail of the list to facilitate merging special
        handlers.
        * src/main.c (main): Run startup handlers.
        * src/prog.c (run_startup): New function.
        (print_code): Print special handlers as well.
        * src/prog.h (run_startup): New proto.
        * src/drivers.c (code_type_call): If func->entry is NULL, the 
        function has not been compiled yet.  Keep a list of entry point 
        references in func->refstart.
        (code_type_funcdecl): Resolve function entrypoint references.
        (code_type_progdecl): Don't check for redefinition here, it is
        done in the progspecial production now.
        * src/engine.c (first_used_state): Initialize to
        smtp_state_none.

        * lib/srvman.c (server_run): Cleanup mailutils onexit list in 
        child.

2022-09-23  Sergey Poznyakoff  <gray@gnu.org>

        Revise the building process of the online documentation


2022-09-22  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * src/engine.c: Include prog.h (for declaration of adjust_stack)

2022-09-21  Sergey Poznyakoff  <gray@gnu.org>

        Unify prog and func code generation.  Fix stack trace
        generation.

        * doc/mailfromd.texi: Document $3 in catch handlers.
        * src/drivers.c (code_type_try): Mark the locus of the "catch" 
        statement.
        * src/engine.c (xeval): Create a proper frame before evaluating 
        the starting point.
        (mlfi_connect, mlfi_helo, mlfi_envfrom)
        (mlfi_envrcpt, mlfi_data, mlfi_header)
        (mlfi_eoh, mlfi_body, mlfi_eom): Remove calls to toe
        env_make_frame/env_leave_frame.  Use adjust_stack to clean-up
        the stack space.
        * src/gram.y (parmcount_catch): Change returned argument count.
        (parmtype_catch): Handle third argument.
        (codegen): Remove the finalize parameter.  The code for each
        handler follows normal layout for functions.
        (mailfromd_test,mailfromd_run): Add missing calls to env_init. 
        Remove calls to env_make_frame/env_leave_frame.
        (create_node_arg): Return NULL node on error.
        * src/prog.c (stack_trace_entry): Rewrite.
        (instr_throw): Don't adjust pc before calling env_throw_0.
        (instr_retcatch): Clean up three arguments.
        (env_throw_0): Pass original pc (where the exception occurred)
        as third argument to handler.

        * tests/strace.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Likewise.

2022-09-20  Sergey Poznyakoff  <gray@gnu.org>

        Preserve initial pc when running begin handler in the "run"
        mode.

        This fixes bug introduced in 18ca63bd5a.

        * src/gram.y (mailfromd_run): Run smtp_state_begin in its own 
        frame.
        * src/prog.c (env_make_frame): Push pc without incrementing it.
        (instr_return): Don't adjust pc after env_leave_frame.

2022-09-19  Sergey Poznyakoff  <gray@gnu.org>

        Change default MFL source suffix to .mfl; introduce separate
        module path

        * NEWS: Document changes.
        * doc/mailfromd.texi: Document changes.

        * mfmod/Makefile.am: Rename template.mf to template.mfl
        * mfmod/mfmodnew.c: Likewise.
        * mfmod/mfmod.m4: Define MFMODDIR to the installation directory
        for MFL interface module files.
        * mfmod/template.ac: Remove AC_CONFIG_COMMANDS
        * mfmod/template.am: Use .mfl suffix for the interface module.
        * mfmod/template.mf: Rename to mfmod/template.mfl

        Change include and module path ordering

        * src/pp.c (include_path, module_path): Move version-specific 
        directory to the last place in the path.

        Revise the preprocessor configuration.

        * src/lex.l: Use preprocessor.enabled.
        * src/mailfromd.h (ext_pp): Remove extern.
        (preprocessor): New struct and extern.
        (preprocessor_cfg_init,string_preprocessor)
        (preprocessor_finalize): New protos.
        (alloc_ext_pp): Remove.
        * src/main.c (ext_pp): Remove glabal.
        (opt_clear_ext_pp): Rename to opt_disable_preprocessor & 
        rewrite,
        (opt_preprocessor): New callback.
        (opt_define,opt_undefine): Take into account
        preprocessor.pass_defines setting.
        (--preprocess option): Argument is optional.  The use without
        argument is intended to override the preprocessor.enabled
        setting. New configuration statements: "module-path" and
        "preprocessor".
        (string_preprocessor): Remove the static qualifier.
        * src/pp.c (preprocessor): New global.
        (preprocessor_cfg_init): New function.
        (alloc_ext_pp): Remove
        (preprocessor_finalize): New function.
        (stderr_redirector): Run preprocessor via sh -c

        Introduce separate module search path

        * Makefile.am (distuninstallcheck_listfiles): Ignore
        mailfromd.mfl
        (complements 0fca940acc).
        * mflib/Makefile.am (moddir): New directory.
        (mod_DATA): Add $(MFL_FILES).
        (EXTRA_DIST): Add $(mod_DATA)
        (MFL_LINT_0): Use -M option instead of -I.
        * src/Makefile.am (AM_CPPFLAGS): Define DEFAULT_MODDIR and 
        DEFAULT_VERSION_MODDIR instead of DEFAULT_INCLUDE_DIR and 
        DEFAULT_VERSION_INCLUDE_DIR.
        * src/mailfromd.h (pathbuf): New struct.
        (PATHBUF_INITIALIZER): New macro.
        (pathbuf_add): New proto.
        (include_path,module_path): New externs.
        (print_include_path,add_include_dir): Remove.
        * src/main.c (opt_include_dir): Remove.
        (opt_path_add): New function.
        (mailfromd_options): New option: --module (-M)
        (cb_include_path): Removed.
        (cb_pathbuf_add): New function.
        (string_values): Change definition of "include path". Add
        "module path".
        * src/pp.c (pathbuf_add): New function.
        (include_path, module_path): New variables.
        (try_file): Take pointer to struct pathbuf as third argument. 
        All uses updated.
        (require_module): Look for the module in module search path
        first. If not found, try include path and issue a warning.
        (add_include_dir,print_include_path): Remove.
        * tests/atlocal.in (MFOPTS): Use -M instead of -I.
        * tests/testsuite.at (MAILFROMD_OPTIONS): Likewise.

        Fix the output of mailfromd --show-defaults

        * src/mailfromd.h (print_include_path): New proto.
        * src/main.c (string_value): New field: data.s_print, a callback 
        for printing the data directly to the output stream.
        (string_values): New entries: "script file search path" and
        "include path".
        (print_string_values): Use s_print for STRING_FUNCTION type.
        (mailfromd_show_defaults): Disable wordwrap stream for mailutils 
        versions prior to 3.16
        * src/pp.c (print_include_path): New function.

2022-09-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix scanning of multiline replies in callout

        * src/callout.c (smtp_io_data): New fields: last_sent and
        last_recv
        (smtp_io_state_restore): Clear the last_* fields.
        (smtp_io_free): Free the new fields.
        (smtp_send): Clear the last_* fields.
        (smtp_recvline): Coalesce memory region before returning. Fix
        starting address and size calculation for the case when the
        reply was obtained in several iterations.
        (first_line_of): Return allocated copy of the string,
        (smtp_last_sent,smtp_last_received): Cache allocated copy.

2022-09-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix eventual access to freed memory region in gethostbyname


2022-09-13  Sergey Poznyakoff  <gray@gnu.org>

        Change TLS priorities default value; document TLS configuration

        * doc/mailfromd.texi: Document the tls configuration section
        * src/srvcfg.c (tls_conf.priorities): Change default.

2022-09-13  Sergey Poznyakoff  <gray@gnu.org>

        Update top-level gitignore list


2022-09-13  Sergey Poznyakoff  <gray@gnu.org>

        Restart callout connection if STARTTLS fails.

        * src/callout.c (smtp_io_reopen): New function.
        (callout_io): Abort current connection if STARTTLS fails.  If in 
        tls_always mode, attempt to restart it afterwards.

2022-09-13  Sergey Poznyakoff  <gray@gnu.org>

        Configurable TLS for callout

        * src/callout.c (callout_io): Pass tls_conf to mu_starttls.
        * src/srvcfg.c (tls_conf): New global.
        (srv_cfg_param): New configuration statement "tls".
        (mf_srvcfg_init): Call mu_tls_cfg_init()
        * src/srvcfg.h (tls_conf): New extern.

2022-09-12  Sergey Poznyakoff  <gray@gnu.org>

        Add an auxiliary file


2022-09-12  Sergey Poznyakoff  <gray@gnu.org>

        Support for STARTTLS in callout.

        * NEWS: Document changes.
        * doc/calloutd.texi: Likewise.
        * doc/functions.texi: Likewise.

        * configure.ac: Check if libmailutils supports GnuTLS.
        * mflib/callout.mf4 (callout_setvars): Pass STARTTLS
        * src/builtin/callout.bi (callout_starttls): New function.
        * src/builtin/debug.bi (callout_transcript): Move to callout.bi.
        * src/callout.c (smtp_io_state): Remove the "start" field.
        (smtp_io_data): Remove "esmtp_capa". Add "tls" and "capa";
        (smtp_io_setup_callout): Take additional argument specifying how 
        and when to use STARTTLS command.
        (smtp_recvline): Append the line to the string being
        constructed. Return it and its length in memory locations
        supplied by the arguments. All callers updated.
        (callout_io): Collect ESMTP capabilities.  Support STARTTLS.
        * src/callout.h (smtp_starttls_t): New typedef.
        (smtp_use_tls): New external variable.
        (smtp_str_to_starttls,smtp_starttls_to_str): New functions.
        * src/savsrv.c (addq,cmd_set): Support for the STARTTLS
        variable.
        * src/srvcfg.c (smtp_use_tls): New global.
        (srv_cfg_param): New statement: smtp-starttls

2022-09-11  Sergey Poznyakoff  <gray@gnu.org>

        RSET during callout shouldn't affect the result of the check.

        * src/callout.c (smtp_io_state): New struct.
        (smtp_io_data): Pack send/recv related fields into smtp_io_data. 
        All uses changed.
        (reset): Preserve original state no matter what the reply of
        RSET.

2022-09-07  Sergey Poznyakoff  <gray@gnu.org>

        Fix discrepancy between normal operation and "run" mode.

        In run mode, main was called with the return pc value 0 in the 
        calling frame.  This means that stopping the program relied on 
        two unsigned wraparounds: first when decrementing the return pc 
        in instr_return, and second when incrementing it again in the 
        eval_environment loop.  As a side effect, this made
        runtime_stack_trace go astray and coredump when used in run
        mode.

        This commit reserves the slot at pc 1 as return point for "main" 
        in run mode and thus fixes the discrepancy.

        NB: Another way to fix it would be to rewrite the loop in 
        eval_environment.  But that doesn't seem to be worth the 
        candles.

        * src/gram.y (parse_program): Remove call to code_immediate - 
        out of place here.
        (compile_tree): Reserve two pc slots: 0 as emergency return
        point and 1 as return point for the "main" function.
        (mailfromd_run): Call env_make_frame instead of env_make_frame0.
        * src/mailfromd.h (env_make_frame0): Remove prototype.
        * src/prog.c (env_make_frame0): Remove function.

2022-09-07  Sergey Poznyakoff  <gray@gnu.org>

        Fix coredump when printing tree for ARGV

        * src/drivers.c (print_type_argv): Check if node is not NULL 
        before attempting to descend into it.

2022-09-06  Sergey Poznyakoff  <gray@gnu.org>

        Improve the docs


2022-09-06  Sergey Poznyakoff  <gray@gnu.org>

        Improve the mfmod interface

        * mflib/.gitignore: Ignore exceptions.h
        * mflib/Makefile.am (status.ex): Removed.
        (exceptions.h): Installable target.
        * mflib/mfex.awk: Produce a valid include file.
        * mflib/status.mf (e_inval): New exception code.
        * mfmod/mfmodnew.c: Check if the proposed module name is valid.
        * src/builtin/mfmod.bi: Support for mfmod_message dtat type.
        (dlcall): The library function is allowed to return arbitrary 
        mailfromd exception number.  retval->string can in this case be 
        used to supply the descriptive string.
        (dlresult_message): New function.
        * src/mailfromd.h: Include mflib/exceptions.h
        * src/mfmod.h (mfmod_message): New data type.
        (mfmod_param): New union field: message

2022-09-03  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.14.91: New utility for creating mfmods


2022-09-01  Sergey Poznyakoff  <gray@gnu.org>

        Honor begin and end sections when called with --run as well.

        * src/gram.y (mailfromd_run): Run begin and end sections.

2022-09-01  Sergey Poznyakoff  <gray@gnu.org>

        Document mfmod.h


2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/drivers.c (code_type_builtin): Restore argument count
        correction accidentally lost in previous commits.

2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Fix typo in configure.ac


2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Fix stack adjustment when return from a function is ignored

        * src/drivers.c (code_type_builtin): Adjust stack if
        node->value_ignored is set.
        (code_type_call): Don't call pushreg if node->value_ignored is
        set.
        * src/gram.y: Set value_ignored to 1 if return value from a
        function was ignored.
        (alloc_node): Set value_ignored to 0.
        * src/mailfromd.h (node): New field: value_ignored.
        * tests/ignoreret.at: New test.
        * tests/numck.c: New option -c (set comment starter).
        * tests/testsuite.at: Include new test.

2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Fix passing argument list with $@(N) at the end.

        The corner case covered by this commit is when the argument list
        is passed to a function with at least one mandatory argument,
        and that argument is given as a result of another function call.

        * src/drivers.c (code_args_shifted): New function.
        (code_type_builtin, code_type_call): Use it.
        * tests/shiftadj.at: New test.
        * tests/Makefile.am: Include new test.
        * tests/testsuite.at: Likewise.

2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Minor optimization

        * src/drivers.c (code_type_builtin, code_type_call):
        node_type_argv can appear only at the head of the reversed
        argument list.

2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Fix stack adjustment after function calls.

        * src/drivers.c (code_type_call): Pass formal parameter count as 
        inline argument to adjustx.
        * src/opcodes (ADJUSTX): Expect one argument.
        * src/prog.c (instr_adjustx): Take formal parameter count as 
        inline argument.  Use it if the actual number of arguments is
        less than that.
        * tests/Makefile.am (TESTSUITE_AT): Add stkadj.at
        (noinst_PROGRAMS): Build numck.
        * tests/numck.c: New program.
        * tests/testsuite.at: Include stkadj.at
        * tests/trycatch05.at: Use numck.
        * tests/trycatch06.at: Likewise.
        * tests/trycatch07.at: Likewise.
        * tests/trycatch08.at: Likewise.
        * tests/trycatch09.at: Likewise.
        * tests/trycatch10.at: Likewise.
        * tests/trycatch11.at: Likewise.
        * tests/trycatch12.at: Likewise.
        * tests/trycatch13.at: Likewise.
        * tests/trycatch14.at: Likewise.
        * tests/trycatch15.at: Likewise.
        * tests/trycatch16.at: Likewise.

2022-08-31  Sergey Poznyakoff  <gray@gnu.org>

        Fix stack adjustment after a call to a variadic function

        * src/drivers.c (code_type_call): Code adjustx instruction after 
        variadic function or function with optional arguments.
        * src/opcodes (ADJUSTX): New instruction.
        * src/prog.c (instr_adjustx): New function.

2022-08-30  Sergey Poznyakoff  <gray@gnu.org>

        Fix improper wordsplit usage

        * src/builtin/mfmod.bi: MU_WRDSF_DELIM alone can't be used, it 
        also needs WRDSF_NOCMD|WRDSF_NOVAR (unless command anv variable 
        handlers are provided).
        * src/builtin/geoip2.bi: Likewise.

2022-08-30  Sergey Poznyakoff  <gray@gnu.org>

        Look up mfmod files in a predefined set of directories

        * src/builtin/Makefile.am (AM_CPPFLAGS): Define MFMODDIR
        * src/builtin/mfmod.bi (mfmod_path): New variable.
        (mfmod-path): New configuration statement.
        (dlopen): Look up the library in mfmod_path.
        * src/mailfromd.h (mfmod_path): New extern.
        * src/main.c (string_values): New entry: "mfmod path".
        (mailfromd_show_defaults): Don't use wordwrap stream if piping 
        or redirecting the output.

2022-08-30  Sergey Poznyakoff  <gray@gnu.org>

        Implement shifted $@

        * NEWS: Document changes.
        * doc/mailfromd.texi: Document changes.
        * src/drivers.c (code_type_builtin, code_type_call)
        (code_type_argv): Generate code for shifts.
        * src/gram.y: new construct: $@(N) - shift N arguments and pass
        remaining to the argument list.
        * src/mailfromd.h (argv_node): New member: node.
        * src/opcodes: Restore DUP.
        * src/prog.c (instr_dup): New instruction.
        (instr_dupn): Count is signed. Throw a runtime error if it is
        negative.
        * tests/vapass.at: New tests.

2022-08-30  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/drivers.c (code_type_builtin): Adjust passed number of 
        parameters.

2022-08-29  Sergey Poznyakoff  <gray@gnu.org>

        Implement the $@ operator

        * NEWS: Document $@
        * doc/mailfromd.texi: Document $@
        * src/drivers.c: New data type: argv ($@)
        (code_type_call): Take into account eventual $@.
        * src/gram.y: Support for $@
        * src/lex.l: New token: $@
        * src/mailfromd.h (struct argv_node): New data type.
        (struct node): Add struct argv_node member.
        * src/opcodes (DUP): Remove unused opcode.
        (DUPN): New opcode.
        * src/prog.c (instr_dup): Remove,
        (instr_dupn): New instruction.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.
        * tests/vapass.at: New test.

        * tests/atlocal.in: Fix typo.

2022-08-28  Sergey Poznyakoff  <gray@gnu.org>

        Support for dynamically loaded modules

        * NEWS: Update.
        * configure.ac: Check for dlopen. New option: --enable-mfmod.
        * global.def (MAX_MFMODS): New constant.
        * src/Makefile.am (mailfromd_LDADD): Add libraries needed for
        dlopen.
        (pkginclude_HEADERS): Add mfmod.h
        * src/builtin/.gitignore: Update.
        * src/builtin/Makefile.am: Add mfmod.bi
        * src/builtin/mfmod.bi: New file.
        * src/main.c (mailfromd_show_defaults): Reflect mfmod status.
        * src/mfmod.h: New file.
        * tests/mfmod01.at: New file.
        * tests/mfmod_echo.c: New file.
        * tests/testsuite.at: Include new test.
        * tests/Makefile.am: Build mfmod_echo.la Add new test.
        * tests/atlocal.in (MFMOD_SUPPORT): New variable.

2022-08-25  Sergey Poznyakoff  <gray@gnu.org>

        Fix definitions of defined and printf m4 macros

        * mflib/pp-setup (defined): Expand to the literal string unless
        used with exactly one argument.
        (printf): Expand to the literal string if used without
        arguments.

2022-08-23  Sergey Poznyakoff  <gray@gnu.org>

        Minor change


2022-08-23  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/builtin/dns.bi (dns_reply_entry_ok): New function. 
        Replace all uses of dns_reply_entry_unused with calls to
        dns_reply_entry_ok.

2022-08-19  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in sed() scanner

        * lib/transform.c: Fix handling of escaped characters.

2022-08-17  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * src/dkim.c (dkim_result_trans): Add translation for
        DKIM_EXPL_BAD_KEY_TYPE.

2022-08-14  Sergey Poznyakoff  <gray@gnu.org>

        Remove deprecated configuration statements: lock-retry-count and
        lock-retry-timeout

        Use the "locking" configuration statement instead:
        <https://mailutils.org/manual/html_node/locking-statement.html>

2022-08-14  Sergey Poznyakoff  <gray@gnu.org>

        Remove obsolete features: legacy GeoIP and DSPAM


2022-08-13  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.14


2022-08-11  Sergey Poznyakoff  <gray@gnu.org>

        Remove unused configuration variables

        * NEWS: Update.
        * configure.ac (DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL)
        (DEFAULT_EXPIRE_RATES_INTERVAL): Remove. Reflect DKIM support in
        the status output.
        * doc/mailfromd.texi: Update.
        * po/POTFILES.in: Update.

2022-08-11  Sergey Poznyakoff  <gray@gnu.org>

        New DKIM explanation code: DKIM_EXPL_BAD_KEY_TYPE

        * NEWS: Document changes.
        * doc/functions.texi: Document changes.
        * mflib/status.mf: Implement new explanation code.
        * src/dkim.c: Likewise.
        * src/dkim.h: Likewise.

2022-08-11  Sergey Poznyakoff  <jr-tools@cedric.unob.z>

        Case, spelling and comment fixes.


2022-08-11  Sergey Poznyakoff  <gray@gnu.org>

        Upgrade docs


2022-08-10  Sergey Poznyakoff  <gray@gnu.org>

        Support for CNAME chains (RFC 1034, section 3.6.2)

        * NEWS: Document changes.
        * doc/mailfromd.texi: Likewise.
        * lib/dns.c (dnsbase_finish): Reset state to NULL.
        (dnsbase_real_init): Install dnsbase_finish to be called on
        exit.
        (dns_max_cname_chain): New global.
        (dns_query): New function.
        (all functions: Use dns_query instead of adns_synchronous.
        (dnsbase_init): Install the "resolver" canned section.
        * lib/libmf.h (dns_max_cname_chain): New extern.
        * src/calloutd.c: Add the "resolver" configuration section.
        * src/main.c: Likewise.
        * tests/resolv.c: New option -c sets dns_max_cname_chain.
        * tests/resolv_cnamechain.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Add new test.

2022-08-09  Sergey Poznyakoff  <gray@gnu.org>

        Support for rsa-sha1 in DKIM

        * NEWS: Document changes.
        * src/builtin/dkim.bi (dkim_sign): New optional argument: algo.
        (dkim_signing_algorithm): New global variable.
        (dkim_verify): Initialize dkim_signing_algorithm.
        * src/dkim.c (dkim_ctx): New struct
        (dkim_ctx_init,dkim_ctx_digest)
        (dkim_ctx_update,dkim_ctx_sign,dkim_ctx_verify): New static
        functions to manage dkim_ctx. All functions: use dkim_ctx
        instead of the algorithm-specific context.
        (dkim_algo): New function.
        (mfd_dkim_verify): Take third argument: return storage for the 
        algorithm name.
        * src/dkim.h (dkim_algorithm): New enum.
        (DKIM_ALGO_DEFAULT): New define.
        (DKIM_ALGORITHM): Remove.
        (dkim_algo_str): New extern.
        (dkim_algo): New proto.
        (dkim_signature) <algo>: New field.
        (mfd_dkim_verify): Change signature.

2022-08-09  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * lib/smmsg.c (outbuffer_append_ml): Preserve newlines.

2022-08-09  Sergey Poznyakoff  <gray@gnu.org>

        Minor change


2022-08-04  Sergey Poznyakoff  <jr-tools@cedric.unob.cz>

        Spelling and omission fixes.

        Signed-off-by: Jan Rafaj <jr-tools@cedric.unob.cz>

2022-08-04  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * lib/smmsg.c: Fix swapped arguments to memchr.

2022-08-04  Sergey Poznyakoff  <gray@gnu.org>

        Fix inconsistency in checking stream validity

        * src/builtin/io.bi (io_stream_is_avail): New static function.
        (io_find_avail, io_get_open_stream): Use io_stream_is_avail.
        (tempfile): Initialize ios->name.
        * tests/tempfile.at: New test file.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.

2022-08-03  Sergey Poznyakoff  <gray@gnu.org>

        Fixes in the spawn built-in


2022-08-02  Sergey Poznyakoff  <gray@gnu.org>

        Major rewrite of the I/O code.

        * src/prog.h (cleanup_when): New enum.
        (env_cleanup_list_append,env_function_cleanup_del)
        (env_function_cleanup_flush): Change signature.
        * src/prog.c (environ_cleanup_closure) <when>: New field.
        (eval_environ) <environ_cleanup_list>: Remove.
        (_cleanup_compare): Compare both when and data.
        (env_cleanup_list_append): Take additional 'when' argument.
        (env_function_cleanup_del): Likewise.
        (env_function_cleanup_flush): Rewrite.
        (env_throw_0): Call env_function_cleanup_flush with
        when=CLEANUP_THROW.
        * src/builtin/snarf.m4 (MF_DCL_CLEANUP): Takes two to three
        arguments.
        (MF_CLR_CLEANUP): Takes two arguments.
        (MF_CLEANUP): Removed.
        * src/builtin/io.bi: Major rewrite.
        (struct io_stream): fd[2] replaced with fd. New field strout
        points to the output stream for program streams. Revise error
        handling.  Make sure current stream gets properly cleaned up if
        an attempt to open it fails with an exception.
        (get_output): New MFL function,  Returns the descriptor of the 
        output stream, if there's any, or -1 otherwise.
        * src/builtin/burst.bi: Use new versions of CLEANUP macros.
        * src/builtin/dspam.bi: Likewise.
        * src/builtin/filter.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/builtin/sa.bi: Likewise.
        * src/builtin/sieve.bi: Likewise.

2022-08-02  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in primitive_has* functions

        * src/builtin/dns.bi (primitive_hasmx)
        (primitive_hasns): Free the reply only if it has been actually 
        allocated.

2022-08-01  Sergey Poznyakoff  <gray@gnu.org>

        Buffered I/O in MFL

        * mflib/status.mf (BUFFER_NONE,BUFFER_LINE,BUFFER_FULL): New
        constants.
        * src/builtin/io.bi (io_stream) <bufsize>: Remove.
        (buf_type,buf_size,buf_len,buf_pos,buf_dirty): New fields.
        (flush_stream): Return mfe_ error code. All uses changed.
        (close_stream): Likewise.
        (close_stream): Reinitialize new fields.
        (io_buffering, io_buffer_size): New MFL variables.
        (io_set_buffer, io_buffer_avail, io_buffer_data)
        (io_write, io_read, io_getc): New internal functions.
        (setbuf, getbuftype, getbufsize): New MFL functions.
        (open, spawn): Set default bufferization.
        (write, read, getline, getdelim): Use new I/O functions.
        * src/builtin/snarf.m4 (MF_OBSTACK_RECLAIM): Bugfix. Use
        heap_obstack_reclaim.
        * src/prog.c (eval_environ) <temp_active>: New field.
        (heap_obstack_begin): Set temp_active.
        (heap_obstack_cancel): Do something only if temp_active is set.
        Clear it afterwards.
        (heap_obstack_finish): Clear temp_active.
        (env_throw_bi): Call heap_obstack_cancel.

        * tests/eof.at: Removed.`
        * NEWS: Document changes.
        * doc/functions.texi: Likewise.
        * doc/upgrade.texi: Likewise.
        * tests/getdelim.at: New test.
        * tests/getline.at: New test.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Include new tests.

2022-07-30  Sergey Poznyakoff  <gray@gnu.org>

        Remove unused automatic variables (left-over from cdfba5cd41)


2022-07-30  Sergey Poznyakoff  <gray@gnu.org>

        Normalize address headers before signing the message.

        This aims to ensure that dkim_sign sees exactly the same message 
        as the one sendmail will send to the remote SMTP.

        * lib/Makefile.am: Add smmsg.c
        * lib/libmf.h (sendmail_address_normalize): New proto.
        * lib/smmsg.c: New file.
        * src/builtin/dkim.bi (dkim_sendmail_commaize): New variable.
        (dkim_sign): If sendmail_commaize is set, use
        sendmail_address_normalize to prepare message for signing.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.
        * tests/commaize.at: New test.
        * tests/smmsg.c: New test program.

        * NEWS: Document the change
        * doc/functions.texi: Likewise.
        * doc/upgrade.texi: New appendix "813-814".

2022-07-24  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in mtasim

        * mtasim/mtasim.c (opt_milter_version)
        (opt_milter_timeout,strtotv): Improve error checking.

2022-07-24  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in mtasim

        * mtasim/mtasim.c (strtotv): Don't return error if encountering 
        a weird character after timespec.
        (opt_milter_timeout): Skip past equal sign.

2022-07-20  Sergey Poznyakoff  <gray@gnu.org>

        Major testsuite cleanup

        Fix namespace usage: prefix all macros with MFT_ instead of AT_

        Rename: MF_RUN_TEXT -> MF_RUN
               MF_CHECK_TEXT -> MFT_TEST
               MF_RUN_TEXT -> MFT_RUN
               AT_MTA_TEST -> MFT_MTASIM Remove: MF_CHECK_PROG,
        MTASIM_DEFS

        Remove unneeded test macros

        Inline all filter programs and scripts into testsuites.

        * configure.ac: Don't create tests/etc/Makefile.
        * tests/Makefile.am: Remove SUBDIRS

        * mtasim/mtasim.c (strtotv): New function.
        (opt_milter_timeout): Use strtotv
        (shell_help): Document new escapes.
        (shell): New escapes: \# - comment, and \Wn - wait n seconds.
        * tests/atlocal.in (TESTDIR): Remove.
        (mailfromd_start,mailfromd_stop): Remove.
        * tests/testsuite.at (MF_CHECK_PREREQ): New macro.
        (MF_CHECK_TEXT,MF_RUN_TEXT): Use MF_CHECK_PREREQ.
        (AT_MTA_TEST_X): Remove.
        (AT_MTA_TEST): Set TESTDIR.
        (AT_MTA_TEST_FILTER_SCRIPT): Fix quoting.
        (cond03.at,cond05.at): Remove.

        * tests/cond03.at: Remove.
        * tests/cond05.at: Remove.
        * tests/etc: Remove.

        * tests/*at: Inline filter and mta scripts.

2022-07-19  Sergey Poznyakoff  <gray@gnu.org>

        A follow-up to cdfd7cef

        * mflib/dns.mf4 (hasmx): primitive_hasmx returns number, so
        there's no need for extra conversion.

2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Use MF_OBSTACK instead of MF_ALLOC_HEAP where possible


2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.13.90


2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Reclaim unneeded memory in the read built-in

        * src/builtin/io.bi (read): Use MF_OBSTACK macros.  Reclaim 
        unneeded memory.
        * src/builtin/snarf.m4 (MF_OBSTACK_RECLAIM)
        (MF_OBSTACK_TRUNCATE): New macros.
        * src/prog.c (heap_obstack_reclaim)
        (heap_obstack_truncate): New functions.
        * src/prog.h (heap_obstack_reclaim)
        (heap_obstack_truncate): New protos.

2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Improve read and write interfaces

        * doc/functions.texi: Document changes.
        * src/builtin/io.bi (write): Write until all data are written or 
        an error is detected.  Signal e_eof on short writes.
        (read): Don't bail out if less than the requested amount (but
        not 0) is read.
        * tests/read.at: New testcase.
        * tests/write.at: New testcase.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Add new tests.

2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Fix sorting in dns_query built-in

        * src/builtin/dns.bi (dns_quiery): Use MF_OPTVAL on the optional 
        sort parameter.

2022-07-18  Sergey Poznyakoff  <gray@gnu.org>

        Fix a typo in msg.bi

        The bug provoked infinite recursion for mailutils version >3.13

2022-07-15  Sergey Poznyakoff  <gray@gnu.org>

        Fix definition of DKIM_CANON_STRING_MAX


2022-07-14  Sergey Poznyakoff  <gray@gnu.org>

        Avoid dereferencing undefined optional arguments in built-ins

        * src/builtin/snarf.m4 (__mf_c_arginit_list): New argument OPT. 
        Indicates whether optional arguments are being processed. For
        optional arguments, protect the call the corresponding get_*_arg 
        function by a conditional, checking if that argument is actually 
        supplied.
        (mf_c_arglist): Call __mf_c_arginit_list and __mf_c_argdcl_list 
        separately.
        (__mf_c_arglist): Remove.

2022-07-14  Sergey Poznyakoff  <gray@gnu.org>

        Add $(MAILUTILS_INCLUDES) to CPPFLAGS in subdirs


2022-07-12  Sergey Poznyakoff  <gray@gnu.org>

        Spell-checking and style fixes.

        Suggested by Jan Rafaj.

2022-07-12  Sergey Poznyakoff  <gray@gnu.org>

        Implicitly declared automatic variables are initialized to null.

        * NEWS: Document changes.
        * doc/mailfromd.texi: Likewise.
        * src/prog.c (instr_stkalloc): Initialize allocated stack slots
        to 0.

2022-07-12  Sergey Poznyakoff  <gray@gnu.org>

        Fix return value of hasmx function


2022-04-06  Sergey Poznyakoff  <gray@gnu.org>

        Fix header handling in send_text, create_dsn and send_dsn
        built-ins

        * src/builtin/mail.bi (add_headers): Seek to position -1 in the 
        header stream.

2022-01-12  Sergey Poznyakoff  <gray@gnu.org>

        Fix EOF check for flex >= 2.6.1


2022-01-02  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.13


2022-01-02  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright year


2021-12-07  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes

        * src/pp.c (pp_extrn_start): Don't close stderr.
        * tests/portprobe.c: Add missing include.

2021-11-23  Sergey Poznyakoff  <gray@gnu.org>

        Define YYLTYPE

        This is to compile with the mailutils commit 9792d313e4

        * NEWS: Update.
        * configure.ac: Test for bison and flex.
        * src/Makefile.am: Explicit rules for building grammar and
        lexer.
        * src/gram.y: Add code requires block.

2021-09-23  Sergey Poznyakoff  <gray@gnu.org>

        Return PermError in case of multiple SPF records

        * lib/dns.c (spf_lookup): Return dns_too_many if multiple SPF
        records are found.
        * lib/dns.h (dns_too_many): New return code.
        * src/spf.c: Handle dns_too_many.
        * tests/resolv.c: Likewise.

2021-09-23  Sergey Poznyakoff  <gray@gnu.org>

        SPF: return None if more than one record is published

        * lib/dns.c (spf_lookup): return dns_not_found in case of
        multiple SPF records.
        * src/spf.c (spf_check_host_internal): Fix description of
        spf_none.

2021-08-28  Sergey Poznyakoff  <gray@gnu.org>

        transform: fix regular expression scanner

        * lib/transform.c (parse_transform_expr): Use simple recursive
        scanner to correctly parse eventual character classes.
        * tests/sed.at: Add new testcase.

2021-08-28  Sergey Poznyakoff  <gray@gnu.org>

        sed: fix replacement of a particular pattern instance

        * lib/transform.c (run_single_transform): Avoid duplicating
        initial prefix if replace is not needed.
        * tests/sed.at: Add new testcases.

2021-08-09  Sergey Poznyakoff  <gray@gnu.org>

        Fix arguments to MF_THROW


2021-08-06  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.12


2021-08-06  Sergey Poznyakoff  <gray@gnu.org>

        Improve docs


2021-08-06  Sergey Poznyakoff  <gray@gnu.org>

        Housekeeping changes

        * Makefile.am (ChangeLog): Rebuild using git alone.
        * git2chg.awk: Remove.

2021-07-23  Sergey Poznyakoff  <gray@gnu.org>

        New filtering functions: filter_string and filter_fd

        * src/builtin/filter.bi: New source.
        * src/builtin/Makefile.am: Add filter.bi
        * src/builtin/msg.bi: Remove unnecessary calls to
        MF_CLR_CLEANUP.
        * NEWS: Document changes.
        * doc/functions.texi: Describe new functions.  Reorder the
        material.
        * doc/mailfromd.texi: Move filter descriptions to a subsection
        of
        "Filtering functions".

2021-07-23  Sergey Poznyakoff  <gray@gnu.org>

        Minor changes


2021-07-23  Sergey Poznyakoff  <gray@gnu.org>

        Document new functions and filter pipes


2021-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * lib/fltpipe.c (context_error): Fix end position

2021-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Document the $n and $(n) constructs


2021-07-19  Sergey Poznyakoff  <gray@gnu.org>

        Fix optimization of $(n) construct

        The $(n) construct would not work with optimization enabled. 
        This is fixed.

        * src/drivers.c (optimize_type_argx): Fix computation.

2021-07-17  Sergey Poznyakoff  <gray@gnu.org>

        Rewrite filter support in message_body_to_stream and related
        functions

        * lib/Makefile.am: Add new file.
        * lib/fltpipe.c: New file.
        * lib/libmf.h (mfl_filter_pipe_create): New proto.
        * mflib/.gitignore: Update.
        * mflib/Makefile.am: Build mime.mf
        * mflib/mime.mf: Rename to mflib/mime.mf4
        * mflib/mime.mf4 (message_body_decode)
        (message_part_decode): Take two optional arguments: charset and 
        charset_fallback.
        * src/builtin/.gitignore: Update.
        * src/builtin/msg.bi (charset, charset_fallback): Remove
        globals.
        (mime_decode_filter): Move charset-related part to a separate 
        function.
        (mime_charset_filter): New function.
        (message_body_to_stream): Use mfl_filter_pipe_create to handle 
        the fltchain argument.

2021-07-22  Sergey Poznyakoff  <gray@gnu.org>

        Make sure callout defaults are sent each time address
        verification is requested

        * mflib/callout.mf4 (callout_setvars): New function.
        (callout_open): Use callout_setvars.
        (__callout_open_default): If socket descriptor is already open, 
        call callout_setvars to send the relevant SET statements.

2021-07-22  Sergey Poznyakoff  <gray@gnu.org>

        Improve callout interface to SET command

        * mflib/callout.mf4 (setvar): Quote the value.
        (callout_open): Remove the superfluous try-catch.

2021-07-22  Sergey Poznyakoff  <gray@gnu.org>

        Fix coredump in MFL stack trace. Improve trace.

        * src/prog.c (stack_trace_entry): New function.  Print
        instr_builtin names as well.
        (runtime_stack_trace): Use stack_trace_entry.
        (env_init): Initialize pc to 0.

2021-07-22  Sergey Poznyakoff  <gray@gnu.org>

        Implement the "SET" command in the callout protocol.

        * mflib/callout.mf4 (callout_open): Emit the "set" commands. For
        backward compatibility, don't bail out if the server refuses 
        them.
        * src/savsrv.c (cmd_set): New function.
        (callout_command_tab): New command: "SET"

2021-07-17  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes

        * doc/mailfromd.texi: Fix @cindex formatting.
        * src/prog.c: Remove unused function.

2021-07-15  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in getlne() built-in

        * src/builtin/io.bi (read_stream_delim): Gracefully handle
        missing delimiter.

2021-07-15  Sergey Poznyakoff  <gray@gnu.org>

        Several improvements to MIME decoding mechanism

        * mflib/status.mf (e_ilseq): New exception.
        * src/builtin/msg.bi (charset_fallback): New variable.
        (charset): Initialize to empty string (meaning "no conversion").
        (mfl_filter_chain_create): Provide a workaround for 
        mu_filter_chain_create.
        (charset_setup): Take empty charset value as "no conversion
        needed". Take into account the charset_fallback variable.
        * doc/functions.texi: Detailed description of charset recoding
        process.
        * doc/mailfromd.texi: Document the charset_fallback variable and 
        e_ilseq runtime exception.

2021-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Functions for decoding MIME messages

        * configure.ac: Version 8.11.90
        * NEWS: Document changes.
        * doc/functions.texi: Document new functions.
        * doc/mailfromd.texi: Document the "charset" variable.

        * src/gram.y (ensure_initialized_variable): Remove.
        (ds_init_variable): New function.
        * src/prog.h (ensure_initialized_variable): Remove.
        (ds_init_variable): New proto.
        * src/builtin/msg.bi (message_body_to_stream): If the first word 
        in fltchain is "mimedecode", decode the MIME part.
        (message_content_type): New function.
        * src/builtin/burst.bi: Use ds_init_variable.
        * src/builtin/callout.bi: Likewise.
        * src/builtin/getopt.bi: Likewise.

        * mflib/Makefile.am: Add mime.mf
        * mflib/mime.mf: New file.

2021-05-26  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.11


2021-05-25  Sergey Poznyakoff  <gray@gnu.org>

        Fix operation on big-endian architectures (tested on s390x)

        * NEWS: Version 8.10.90
        * configure.ac: Version 8.10.90

        * lib/dns.c (ptr_lookup): Don't assume little-endianness.
        * src/drivers.c: Make sure retrieved member of STKVAL.c_value 
        has the same width as the stored one.
        * src/gram.y: Likewise.
        * src/prog.c: Likewise.

        Skip callout tests if port 25 on test SMTP server is not
        reachable.

        * tests/portprobe.c: New file.
        * tests/.gitignore: Add portprobe.
        * tests/Makefile.am: Build portprobe.
        * tests/testsuite.at (AT_REQUIRE_SMTP): New macro.
        * tests/poll.at: Use AT_REQUIRE_SMTP.
        * tests/poll01.at: Likewise.
        * tests/poll02.at: Likewise.
        * tests/poll03.at: Likewise.

        Minor fixes.

        * src/builtin/io.bi (io_stream): Remove unused member.
        * src/main.c: Fix the "relayed-domain-file" configuration
        statement.

2021-05-23  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes


2021-02-23  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.10


2021-02-15  Sergey Poznyakoff  <gray@gnu.org>

        Warn about uninitialized variables; meaningful use of string
        variables in boolean context

        * src/mailfromd.h (variable) <initialized>: New member.
        (variable_check_initialized): New proto.
        * src/symbols.c (init_variable): Set initialized to 0.
        * src/gram.y: Convert the use of string variable in boolean
        context to s != ''.
        (create_asgn_node): Set var->initialized  to 1.
        (create_node_variable): Check if the variable is initialized.
        (variable_check_initialized): New function.
        * src/lex.l (variable_or_const): Check if the variable is 
        initialized.

        * mflib/dns.mf4 (dns_getname, dns_getaddr)
        (getns,getmx): Initialize result.

        * tests/arginit.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Include new test.

        * doc/mailfromd.texi: Elaborate on default values of variables.

        * NEWS: Version 8.9.90
        * configure.ac: Likewise.

2021-02-08  Sergey Poznyakoff  <gray@gnu.org>

        Fix minimal mailutils requirement in README


2021-01-06  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright years


2020-12-29  Sergey Poznyakoff  <gray@gnu.org>

        Fix typos in NEWS


2020-12-29  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.9

        * NEWS: Update.
        * configure.ac: Update.
        * doc/functions.texi (dkim_verified_signature_tag): Add missing 
        type declaration.
        * tests/hdr-cap.at: Ignore X-* headers.
        * tests/hdr-mul.at: Likewise.

2020-11-19  Sergey Poznyakoff  <gray@gnu.org>

        Remove old code.

        * src/builtin/mbox.bi (mailbox_open): Remove a left-over
        workaround, not needed since mailutils commit d7a596df78.

2020-11-08  Sergey Poznyakoff  <gray@gnu.org>

        Remove obsolete ifdefs


2020-11-08  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.8.92


2020-11-08  Sergey Poznyakoff  <gray@gnu.org>

        New builtin function: geoip2_get_json

        * src/builtin/geoip2.bi (geoip2_get): Throw e_range if the
        lookup path does not exist in the returned data. Return empty
        string if there is no data in the entry.
        (geoip2_get_json): New function.
        * src/prog.c (heap_obstack_vsprintf): Don't overwrite previously 
        written data.
        * doc/functions.texi: Describe the geoip2 functions.
        * NEWS: Update.

2020-11-06  Sergey Poznyakoff  <gray@gnu.org>

        geoip2 support

        * configure.ac: Check for libmaxminddb.
        * src/Makefile.am (mailfromd_LDADD): Add GEOIP2_LIBS.
        * src/builtin/Makefile.am: Add geoip2.bi
        * src/builtin/geoip2.bi: New file.
        * src/main.c (mailfromd_show_defaults): Reflect the status of
        geoip2 support.

2020-11-06  Sergey Poznyakoff  <gray@gnu.org>

        New functions for printf-style operations on the heap temporary
        space.

        * src/builtin/snarf.m4 (MF_OBSTACK_PRINTF): New macro.
        * src/prog.c (heap_obstack_size, heap_obstack_vsprintf)
        (heap_obstack_sprintf): New functions.
        (env_vsprintf): Create copy of the va_list prior to using it and 
        dispose of it afterwards.
        * src/prog.h (heap_obstack_vsprintf, heap_obstack_sprintf): New
        protos.

2020-11-05  Sergey Poznyakoff  <gray@gnu.org>

        Improve numeric overflow checking during stack/data reallocation

        * src/gram.y (strtosize): Improve numeric overflow checking.
        * src/prog.c (expand_dataseg): Change signature.  Improve 
        reallocation strategy and overflow checking.  Don't throw
        exception on error, that's the responsibility of the caller. All
        uses changed.
        * src/prog.h (expand_dataseg): Change signature.
        * src/builtin/debug.bi (_expand_dataseg): Update call to
        expand_dataseg.

2020-11-04  Sergey Poznyakoff  <gray@gnu.org>

        Reimplement several DNS functions in pure MFL

        * NEWS: Update.
        * doc/functions.texi: Update.
        * mflib/dns.mf4 (dns_getname, dns_getaddr)
        (getns, getmx): New functions.
        * src/builtin/dns.bi (dns_getname, dns_getaddr)
        (getns, getmx): Remove.

2020-11-04  Sergey Poznyakoff  <gray@gnu.org>

        Add tests fir dns_query

        * tests/dns_query.at: New file.
        * tests/Makefile.am: Add dns_query.at
        * tests/testsuite.at: Likewise.
        * tests/atlocal.in (MFOPTS): Change order of the include
        directories.

2020-11-04  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.8.91


2020-11-04  Sergey Poznyakoff  <gray@gnu.org>

        dns_query: remove the arbitrary limit on the number of replies

        * src/builtin/dns.bi: Use the module private storage for reply
        table.

2020-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Implement the dns_query function: a generalized API for DNS
        queries

        * mflib/dns.mf4 (DNS_TYPE_A, DNS_TYPE_NS)
        (DNS_TYPE_PTR, DNS_TYPE_MX, DNS_TYPE_TXT): New constants.
        * src/builtin/dns.bi (dns_query): New function.
        (dns_reply_release,dns_reply_count)
        (dns_reply_string,dns_reply_ip): New functions.
        * src/prog.c (eval_environ): Rename cleanup_list to
        function_cleanup_list. New member environ_cleanup_list.
        (env_environ_cleanup_add): New function.
        * src/prog.h (env_environ_cleanup_add): New proto.
        * doc/functions.texi: Document the dns_query function.
        * NEWS: Likewise.

2020-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Doc: Remove references to non-existing DNS cache


2020-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Expect 15 shift/reduce in grammar


2020-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Don't assume smallbook in docs.


2020-11-02  Sergey Poznyakoff  <gray@gnu.org>

        Fix typo


2020-11-02  Sergey Poznyakoff  <gray@gnu.org>

        Document the sed construct.  Implement the qr() builtin.

        * doc/Makefile.am: Remove sexp.texi.
        * doc/sexp.texi: Remove.
        * doc/functions.texi: Document the sed function.
        * doc/mailfromd.texi: Update.
        * src/builtin/snarf.m4 (__MF_DEFUN_FLAGS__): New macro.
        (__mf_add_defun_flag)
        (__mf_mfl_type,__mf_arglist_init): New macros.
        (__mf_defun): Use __mf_arglist_init to initialize __MF_ARGLIST__
        and the defun flags.
        (__MF_NEEDS_CAPTURE__): Remove.
        (MF_CAPTURE): Set MFD_BUILTIN_CAPTURE directly, instead of
        setting
        __MF_NEEDS_CAPTURE__.
        * src/builtin/string.bi (qr): New function.
        * src/gram.y (funcall: T_BUILTIN): Special handling for builtins 
        with MFD_BUILTIN_REGEX_FLAGS flag set.
        * src/mailfromd.h (MFD_BUILTIN_REGEX_FLAGS): New flag.
        * tests/sed.at: Rename qr to myqr to avoid name clash with the 
        builtin.

        * configure.ac: Version 8.8.90
        * NEWS: Document the sed and qr functions.

2020-11-01  Sergey Poznyakoff  <gray@gnu.org>

        MFL: New built-in function "sed".

        The "sed" function (actually, a statement) transforms its first
        argument using the sed expressions given in its subsequent
        arguments and returns the result:

          set res sed(input, 's/foo/bar/g', 's/bar/Baz/')

        * lib/libmf.h (transform_append_t)
        (transform_reduce_t): Remove typedefs.
        (transform_string): Change signature.
        * lib/transform.c (parse_transform_expr): Fix parsing of the 
        regexp part.
        (transform_string): Rewrite.  No additional callbacks needed.
        * src/drivers.c: New node types: 'sedcomp', to compile the sed 
        transformation expression, and 'sed', to apply it.
        * src/gram.y: New production for sed(arg, expr).
        * src/lex.l (sed): New keyword.
        * src/mailfromd.h (sedcomp_node, sed_node): New structs.
        (node): Add new sedcomp_node and sed_node parts to the union.
        * src/opcodes (SEDCOMP, SED): New opcodes.
        * src/prog.c (next_transform_index)
        (install_transform,get_transform): New functions.
        (instr_sedcomp, instr_sed): New instruction handlers.
        * src/symbols.c (import_rules_eval): Simplify transform
        expression handling.

        * tests/sed.at: New file.
        * tests/Makefile.am: Add sed.at
        * tests/testsuite.at: Include sed.at

2020-10-31  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix in the mfl-mode

        * elisp/mfl-mode.el (mfl-next-line-indentation): Handle the
        beginning of buffer case.

2020-07-26  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.8


2020-07-24  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright years


2020-07-24  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.7.92


2020-07-23  Sergey Poznyakoff  <gray@gnu.org>

        Fix compilation without libnettle

        * NEWS: Version 8.7.91
        * configure.ac: Likewise. Define WITH_DKIM.
        * mflib/Makefile.am [NETTLE_COND]: Add dkim.mf conditionally.
        * src/Makefile.am [NETTLE_COND]: Remove appending to
        AM_CPPFLAGS: symbol defined in config.h
        * src/builtin/Makefile.am (BI_FILES): Add dkim.bi
        unconditionally.
        * src/builtin/dkim.bi: Mark source with MF_COND(WITH_DKIM)

2020-07-22  Sergey Poznyakoff  <gray@gnu.org>

        Fix compilation with gcc 10

        * gacopyz/gacopyz_priv.h (__gacopyz_log_printer): Mark as
        extern.
        * lib/mfdb.h (cache_format, rate_format)
        (tbf_rate_format,greylist_format): Mark as extern.
        (predict_rate,predict_next_option): New externs.
        * src/dkim.c (dkim_signature_parse): Fix improper use of
        unprefixed WRDSF_ constant.
        * src/mfdbtool.c (predict_rate,predict_next_option): Remove
        variable declarations.
        * src/savsrv.c (writeout): Use memcpy instead of strncpy to shut 
        up the gcc warning.
        * src/srvcfg.c (negative_expire_interval): Remove declaration.

2020-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Fix the use of deprecated CPPFunction* in mtasim


2020-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Implement enumerations in MFL

        * src/gram.y: Implement enumerated constant definitions.
        * src/mailfromd.h (define_constant): Remove const from the 
        return type.
        * src/symbols.c: Likewise.

        * tests/enum.at: New test.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Likewise.

        * NEWS: Mention new features.
        * doc/mailfromd.texi: Document new features.

2020-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * src/lex.l (lex_new_source_0): Initialize yylloc early.  This
        makes sure that eventual syntax errors occurring at the first
        token are printed with detailed location
        (filename:line.start-end)

2020-07-13  Sergey Poznyakoff  <gray@gnu.org>

        Fix compilation without external preprocessor


2020-07-11  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix in the docs


2020-07-11  Sergey Poznyakoff  <gray@gnu.org>

        Provide DKIM_EXPL_ codes for use in MFL

        * doc/functions.texi: Document changes
        * mflib/status.mf: Define DKIM_EXPL_ constants
        * src/dkim.c (dkim_explanation_str): Change the wording of 
        DKIM_EXPL_BAD_BASE64 error string.
        * src/dkim.h: Define DKIM_EXPL_ using _MFL_DKIM_EXPL_ ones

2020-07-10  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix


2020-07-10  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes

        * src/builtin/dkim.bi (dkim_sign): Insert DKIM-Signature at
        position 0.
        * src/dkim.c (dkim_signature_format): Don't request
        MU_STREAM_STAT_OUTLN

2020-07-10  Sergey Poznyakoff  <gray@gnu.org>

        Provide additonal data upon successful return from
        mfd_dkim_verify

        * doc/functions.texi: Document new functions and variables.
        * mflib/Makefile.am: Add dkim..mf
        * mflib/dkim.mf: New function.
        * src/builtin/dkim.bi (dkim_verified_signature): New MFL
        variable.
        (dkim_verify): Set dkim_verified_signature upon return.
        * src/dkim.c (mfd_dkim_verify): Return normalized DKIM signature 
        value in the memory location pointed to by the second argument.
        * src/dkim.h (mfd_dkim_verify): Change signature.

2020-07-10  Sergey Poznyakoff  <gray@gnu.org>

        Rewrite DKIM parser and formatter


2020-07-10  Sergey Poznyakoff  <gray@gnu.org>

        DKIM: implement l= tag


2020-07-09  Sergey Poznyakoff  <gray@gnu.org>

        DKIM: Minor change

        * src/dkim.c (dkim_hash): Use dkim_header_list_first/ 
        dkim_header_list_first/dkim_header_list_end instead of
        mu_wordsplit to iterate over the list of headers.

2020-07-09  Sergey Poznyakoff  <gray@gnu.org>

        Implement DKIM-Signature wrapping. Fix DKIM interaction with
        header_replace

        * src/builtin/dkim.bi (do_msgmod): When processing
        header_replace, first check if the requested header is already
        present.  If it is, proceed with header insert.  Otherwise do
        mu_header_append.  This mimics the Sendmail behaviour.
        * src/dkim.c (dkim_header_list_end, dkim_header_list_next)
        (dkim_header_list_first): New functions.
        (dkim_signature_format): Rewrite.  Take additional argument
        crlf. When set, insert CRLF instead of LF when wrapping.

2020-07-09  Sergey Poznyakoff  <gray@gnu.org>

        DKIM: Fix verification in case of wrapped DKIM-Signature

        * src/dkim.c: tranlsate lf->crlf before hashing

2020-07-09  Sergey Poznyakoff  <gray@gnu.org>

        Fix DKIM record parsing to comply to RFC 6376

        * src/dkim.c (dkim_signature_parse,dnsrec_parse): Allow for FWS 
        as per RFC 6376, section 3.2

2020-07-07  Sergey Poznyakoff  <gray@gnu.org>

        Fixes in DKIM code

        * lib/dns.c (dkim_lookup): The v= tag is optional.
        * src/builtin/dkim.bi (dkim_sign): Insert the created header at 
        the beginning.
        (dkim_verify): Mark with MF_DSEXP.
        * src/dkim-canonicalize.c (dkim_canonicalizer): Fix relaxed body 
        canonicalization: ignore whitespace at the end of the line
        (before CRLF).
        * src/dkim.c (dkim_str_to_canon_type): Take two arguments. 
        Return the pointer to the first character after the spec in
        *endp. All uses changed.
        (dkim_signature_parse): Fix typo (missing else). Fix c= tag
        parsing.
        (dkim_sig_validate): The q= tag is optional. Fix verification of
        the i= tag.
        (pubkey_validate): Validate v= tag, if supplied. Fix validation
        of the key type and algorithm.
        * src/dkim.h (DKIM_KEYRECORD_VERSION): New constant.

2020-07-07  Sergey Poznyakoff  <gray@gnu.org>

        Remove mudefs.h


2020-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Move mu_stream_shift to GNU mailutils

        This partially reverts 7049008599.  The function itself, which
        had been introduced in anticipation of its possible use in DKIM
        module, was never actually used.

2020-07-06  Sergey Poznyakoff  <gray@gnu.org>

        Implement DKIM verification

        * lib/dns.c (dkim_lookup): New function.
        * lib/dns.h (dkim_lookup): New proto.
        * mflib/status.mf (DKIM_VERIFY_OK, DKIM_VERIFY_PERMFAIL)
        (DKIM_VERIFY_TEMPFAIL): New constants.
        * src/builtin/dkim.bi (msgmod_data) <h_list>: New member.
        (do_msgmod): Ignore modification commands that affect headers 
        not listed in h=.
        (dkim_sign): Initialize v, a, and q members of struct
        dkim_signature.
        (dkim_explanation_code, dkim_explanation): New MFL variables.
        (dkim_verify): New function.
        * src/dkim.c (pubkey_from_base64): New function.
        (dkim_header_list_match): New function.
        (dkim_signature_format): Format new members of the struct
        dkim_signature.
        (dkim_signature_free): New function.
        (dkim_signature_parse): New function.
        (dkim_hash): New function.
        (mfd_dkim_sign): Rewrite using dkim_hash.
        (dkim_explanation_str)
        (dkim_result_trans): New globals.
        (mfd_dkim_verify): New function.
        * src/dkim.h (dkim_header_list_match): New proto.
        (mfd_dkim_verify): New proto.
        (DKIM_VERSION,DKIM_SIGNATURE_HEADER)
        (DKIM_QUERY_METHOD,DKIM_ALGORITHM): New constants.
        (dkim_signature) <a,q,v>: New members.
        (DKIM_EXPL_*): New constants.
        (DKIM_VERIFY_*): New constants.
        (dkim_explanation_str, dkim_result_trans): New externs.

        * NEWS: Document changes.
        * doc/functions.texi: Likewise.

2020-07-04  Sergey Poznyakoff  <gray@gnu.org>

        dkim: take into account changes applied by MMQ

        * mflib/status.mf (e_badmmq): New exception: MMQ incompatible
        with the signing function (currently for dkim_sign).
        * src/builtin/dkim.bi (dkim_sign): Apply MMQ to the temporary
        message prior to calling mfd_dkim_sign.
        * src/mailfromd.h (env_msgmod_apply): Change the return type.
        * src/prog.c (env_msgmod_apply): Return int code from
        mu_list_foreach.
        * src/dkim.c (mfd_dkim_sign): Fix the type of the c auto.

2020-07-03  Sergey Poznyakoff  <gray@gnu.org>

        Move MMQ from milter context to program evaluation environment.

        * src/engine.c: (message_data): Remove mmq.  Use env_msgmod
        functions to access it.  All uses updated.
        (ctx_msgmod): Removed.
        (priv_store_msgmod_closure): Removed.
        (mlfi_eom): Use env_msgmod_count to check the size of the
        message modification queue and env_msgmod_apply to apply it.
        * src/mailfromd.h (env_msgmod): Rename to env_msgmod_append.
        (env_clear_msgmod): Rename to env_msgmod_clear.
        (env_msgmod_apply): New proto.
        * src/prog.c (ENVF_MSGMOD): Remove.
        (eval_environ) <flags,mmq>: Remove.
        (instr_result): Use env_msgmod_count to chech for mmq size.
        (env_clear_msgmod): Rewrite and rename to env_msgmod_clear.
        (env_msgmod): Rewrite and rename to env_msgmod_append.
        (env_msgmod_count): New function.
        (destroy_environment): Destroy env->mmq

2020-07-02  Sergey Poznyakoff  <gray@gnu.org>

        Remove header_delete_nth and header_replace_nth.

        Both functions were unable to do their work properly, due to the 
        deficiences of the Milter API.

        Rewrite header_rename, header_prefix_all and
        header_prefix_pattern.

        * NEWS: Update.
        * doc/functions.texi: Update discussion of header modification 
        functions.
        * mflib/header_rename.mf4: Rewrite.
        * src/builtin/header.bi (header_delete_nth)
        (header_replace_nth): Remove.
        * src/builtin/vars.bi (sendmail_header_count): Remove.
        (get_sendmail_header_count,set_sendmail_header_count): Remove.
        * src/engine.c (message_data): Remove members: hdrtrans,
        hdrcount. All uses changed.
        (md_hdrtrans_fill,md_hdrtrans): Remove.
        * src/mailfromd.h (header_delete_nth,header_replace_nth):
        Remove. All uses changed.

2020-06-30  Sergey Poznyakoff  <gray@gnu.org>

        Fix typos


2020-05-29  Sergey Poznyakoff  <gray@gnu.org>

        New function: mfd_temp_stream_shift

        Shifts the contents of temporary stream between two offsets.

        * lib/Makefile.am: Add new sources.
        * lib/libmf.h (mfd_temp_stream_shift): New proto.
        * lib/mudefs.h (MUREF): Remove. Define _MFD_USE_STREAM_SHIFT
        depending on mailutils version.
        * lib/mustrmshift.c: New file.
        * lib/streamshift.c: New file.

        * src/Makefile.am (AM_CPPFLAGS) [NETTLE_COND]: Define WITH_DKIM.
        * src/main.c (mailfromd_show_defaults): Reveal whether DKIM is
        supported.

        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Likewise.
        * tests/resolv.c: Fix formatting.
        * tests/streamshift.at: New file.
        * tests/streamshift.c: New file.
        * tests/.gitignore: Update.

2020-05-26  Sergey Poznyakoff  <gray@gnu.org>

        Implementation of DKIM signing

        * configure.ac: Detect presence of nettle libraries.
        * src/Makefile.am: Add new sources.
        * src/dkim-canonicalize.c: New file.
        * src/dkim.c: New file.
        * src/dkim.h: New file.
        * src/builtin/Makefile.am: Add new sources.
        * src/builtin/body.bi (current_message): Rewrite as a simple 
        wrapper over bi_get_current_message.
        * src/builtin/dkim.bi: New file.
        * src/builtin/msg.bi (bi_get_current_message): Optionally return 
        the message itself.
        * src/builtin/msg.h (bi_get_current_message(: Change signature.
        * src/builtin/snarf.m4 (env_get_stream): Fix quoting.

        * NEWS: Document changes.
        * doc/functions.texi: Document the dkim_sign function
        * doc/mailfromd.texi: Minor changes.

2019-09-07  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes

        * src/main.c (mf_cfg_param): Remove the surplus "database" 
        section: it is already included in srvcfg.c
        * src/prog.c (env_register_auto): Use mu_diag_cont_printf to 
        continue diagnostic message without inserting unnecessary
        <> directives (perhaps should be fixed in mailutils).

2019-06-18  Sergey Poznyakoff  <gray@gnu.org>

        Don't accept database types not supported by mailutils

        For details, see the last paragraph in:

        http://mail.gnu.org.ua/mailman/listarchive/bug-mailfromd/2019-06/msg00001.html

        * configure.ac (db_type_to_feature): Make sure empty string is
        never returned.

2019-01-29  Sergey Poznyakoff  <gray@gnu.org>

        Fixes in runtime memory management

        * src/builtin/sprintf.bi: Don't use pointer to format: the
        latter might be reallocated during stack expansions, and the
        pointer would end up pointing to freed memory area. Another way
        to fix it would be to make env_register_auto and env_pop_auto
        global and to mark the address of pointer with env_register_auto
        so it would be reallocated together with format. However, I
        wouldn't like to expose too much of the internals of prog.c.
        * src/prog.c (env_get_locus)
        (heap_obstack_grow,pushs): Fix argument to env_register_auto.
        (env_register_auto): Check if the argument points to a memory 
        location within data segment + stack. This is necessary, because 
        heap_obstack_grow registers its argument, which at least in one
        case is a pointer to an automatic variable (see MF_OBSTACK_1GROW
        in builtin/snarf.m4).
        (env_pop_auto,env_unregister_autos)
        (env_fixup_autos): Make static.

2019-01-29  Sergey Poznyakoff  <gray@gnu.org>

        Fix in callout

        * src/callout.c (reset): Send \r\n after RSET.

2019-01-24  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes.

        * doc/mtasim.texi: Fix description of the milter timeout
        letters.
        * mtasim/Makefile.am (mtasim_DEPENDENCIES): Depend on libmf and 
        libgacopyz

2019-01-03  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.7

        * NEWS: Update.
        * configure.ac: Raise minor version.
        * doc/functions.texi: Document new functions

        Include the implementation of the NS resolving MFL functions, as 
        proposed by Jan Rafaj

        * lib/dns.c (ns_lookup): New function.
        * lib/dns.h (ns_lookup): New proto.
        * mflib/dns.mf4 (hasns): New function.
        * src/builtin/dns.bi (primitive_hasns, getns): New functions.

2019-01-03  Sergey Poznyakoff  <gray@gnu.org>

        Update copyright years


2018-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Document debug categories. Fix improper use of decimal constants
        instead of MU_DEBUG_TRACE identifiers


2018-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Fix docstring for the "debug" statement in the config-help
        output.


2018-11-08  Sergey Poznyakoff  <gray@gnu.org>

        mtasim: don't clobber existing callout socket when used with
        -Xauto

        * doc/mailfromd.texi: Document the --callout-socket option.
        * mtasim/mtasim.c (start_mailfromd): Supply the --callout-socket
        option.
        * src/main.c: New option --callout-socket

2018-11-08  Sergey Poznyakoff  <gray@gnu.org>

        Silently ignore non-existing keys in dbdel

        * src/builtin/db.bi (dbdel): Treat MU_ERR_NOENT as success.

2018-11-07  Sergey Poznyakoff  <gray@gnu.org>

        Fix the functionality of the mailfromd --mtasim option

        This option must discard the effect of the server.listen
        statement This also fixes mtasim -Xauto

        * src/main.c (mailfromd_options): Process the --mtasim option
        immediately.

2018-11-05  Sergey Poznyakoff  <gray@gnu.org>

        Change generation of debug names for built-in modules

        * src/builtin/Makefile.am (.bi.c): Don't define SOURCE
        * src/builtin/snarf.m4 (MF_SOURCE_DEBUG_NAME): Remove.
        (MF_MODULE_DEBUG_NAME): New macro.
        (_init_builtin): Use MF_MODULE_DEBUG_NAME

2018-11-05  Sergey Poznyakoff  <gray@gnu.org>

        Partially revert "Fix indentation of the generated sources"

        GNU indent reformats the sources. As a result, preprocessor
        #line directives become misleading.

2018-11-04  Sergey Poznyakoff  <gray@gnu.org>

        Fix indentation of the generated sources

        * NEWS: Version 8.6.90
        * configure.ac: Version 8.6.90 Check for GNU indent
        * am/indent.m4: New file.
        * src/builtin/Makefile.am (EXTRA_DIST): Add indent.pro
        (.bi.c, .def.h): Use GNU indent if available.
        * src/builtin/indent.pro: New file.
        * src/builtin/snarf.m4: Minor change.

2018-11-02  Sergey Poznyakoff  <gray@gnu.org>

        Revise preprocessor macros for builtin functions.

        * doc/mailfromd.texi: Minor change.
        * src/builtin/Makefile.am (builtin.h): Depend pn init.m4
        (.bi.c): Don't eliminate first #line
        * src/builtin/snarf.m4 (MF_BUILTIN_MODULE): New macro.
        (MF_INIT): Rewrite. Revise comments.
        * src/builtin/init.m4 (MF_BUILTIN_MODULE): New macro.
        (MF_INIT): Remove.

        * src/builtin/body.bi: Use MF_BUILTIN_MODULE statement.
        * src/builtin/burst.bi: Likewise.
        * src/builtin/callout.bi: Likewise.
        * src/builtin/ctype.bi: Likewise.
        * src/builtin/curhdr.bi: Likewise.
        * src/builtin/db.bi: Likewise.
        * src/builtin/debug.bi: Likewise.
        * src/builtin/dns.bi: Likewise.
        * src/builtin/dspam.bi: Likewise.
        * src/builtin/email.bi: Likewise.
        * src/builtin/from.bi: Likewise.
        * src/builtin/geoip.bi: Likewise.
        * src/builtin/gethostname.bi: Likewise.
        * src/builtin/getopt.bi: Likewise.
        * src/builtin/getpw.bi: Likewise.
        * src/builtin/gettext.bi: Likewise.
        * src/builtin/header.bi: Likewise.
        * src/builtin/io.bi: Likewise.
        * src/builtin/ipaddr.bi: Likewise.
        * src/builtin/macro.bi: Likewise.
        * src/builtin/mail.bi: Likewise.
        * src/builtin/mbox.bi: Likewise.
        * src/builtin/mmq.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/builtin/other.bi: Likewise.
        * src/builtin/prereq.bi: Likewise.
        * src/builtin/progress.bi: Likewise.
        * src/builtin/qrnt.bi: Likewise.
        * src/builtin/rate.bi: Likewise.
        * src/builtin/rcpt.bi: Likewise.
        * src/builtin/sa.bi: Likewise.
        * src/builtin/sieve.bi: Likewise.
        * src/builtin/spf.bi: Likewise.
        * src/builtin/sprintf.bi: Likewise.
        * src/builtin/string.bi: Likewise.
        * src/builtin/syslog.bi: Likewise.
        * src/builtin/system.bi: Likewise.
        * src/builtin/vars.bi: Likewise.

2018-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Minor change

        * mflib/callout.mf4 (callout_do): Return true for null return
        address.

2018-11-01  Sergey Poznyakoff  <gray@gnu.org>

        Quote arguments in the callout transactions in poll


2018-11-01  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes in the docs


2018-11-01  Sergey Poznyakoff  <gray@gnu.org>

        Avoid spurious warnings from libadns

        * tests/resolv_a.at: Always pass -f option to resolv to prevent
        eventual "unknown option" messages from libadns.

2018-10-26  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * lib/dns.c (dns_str_is_ipv4): Don't tolerate whitespace and 
        extra dots.

2018-07-24  Sergey Poznyakoff  <gray@gnu.org>

        configure: accept any DBM type supported by mailutils as the
        default implementation

        * NEWS: Version 8.6
        * configure.ac: New configure option --with-dbm
        * doc/mailfromd.texi: Update.
        * doc/upgrade.texi: Update.

2018-07-23  Sergey Poznyakoff  <gray@gnu.org>

        Reword copyright statement in accordance with the GFDL addendum

        This pacifies lintian.

2018-07-23  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        * elisp/mfl-mode.el: Fix byte-compilation.
        * git2chg.awk: Ignore git-svn-id:
        * src/pp.c (pp_extrn_shutdown): Report errors.

2018-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 8.5


2018-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update copyright years


2018-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Ensure proper integer promotion in vm.

        * src/prog.c (pushn): New function. Use pushn wherever a numeric
        or boolean return type is required.
        * src/prog.h (mf_c_cast): Minor change.

2018-03-23  Sergey Poznyakoff  <gray@gnu.org>

        Fix dns_resolve_ipstr

        * lib/dns.c (dns_resolve_ipstr): Select rrtype depending on the 
        domain in question. This should produce the same results as it
        was in the previous res_query implementation, which queried for
        T_ANY and selected the first RR type returned.

2017-11-21  Sergey Poznyakoff  <gray@gnu.org>

        Ensure case-insensitive comparison of SPF record marker.

        * lib/dns.c (spf_lookup): ignore case when looking for v=spf1

2017-11-21  Sergey Poznyakoff  <gray@gnu.org>

        Normalize inclusion of mailutils headers


2017-11-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Concatenate segments of a TXT record.

        * lib/dns.c (txt_lookup): Concatenate multiple
        ans->rrs.manyistr.

2017-11-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix resolving of queries containing invalid characters

        * lib/dns.c (DEFAULT_QFLAGS): Add adns_qf_quoteok_query

2017-11-03  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.4

        * NEWS: Update.
        * configure.ac: Update.
        * doc/upgrade.texi: Update.

2017-11-02  Sergey Poznyakoff  <gray@gnu.org>

        Bugfix

        * lib/srvman.c: Use mu_sys_sockaddr_to_astr
        * configure.ac: Require mailutils 3.4

2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 8.3


2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update documentation


2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        calloutd: implement the --resolv-conf-file option


2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Remove cover requirement from doc license text


2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Documentation and configuration changes

        * configure.ac: Remove leftover checks for libresolv.
        * doc/upgrade.texi: Document recent changes.

2017-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve ADNS return status handling.

        * lib/dns.c (adns_to_dns_status): Rewrite.

2017-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs. Version 8.2.91


2017-10-25  Sergey Poznyakoff  <gray@gnu.org>

        Change the rc suffix to mf in test scripts.

        That was a leftover from pre-6.0 times.

2017-10-23  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix


2017-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve DNS API; rewrite DNS testsuite.

        * lib/dns.c (dnsbase_real_init): Take configuration text as
        argument (can be NULL). Enable adns debugging on trace9
        (dnsbase_file_init): New function.
        (dns_reply_init): New function.
        (dns_reply_push): New function.
        (soa_check): New function. Rewrite all functions using
        dns_reply_init+dns_reply_push, as appropriate.
        * lib/dns.h (dns_reply) <maxcount, data.ptr>: New members.
        (dnsbase_real_init, dnsbase_file_init)
        (dns_reply_init, soa_check): New protos.
        * src/builtin/dns.bi (resolve_host): Rewrite to return all A
        records.
        (dns_replies_intersect): New static function.
        (primitive_ismx): Rewrite taking into account all A records.
        * src/main.c: New option --resolv-conf-file (mostly for
        checking.

        * tests/resolv.c: Change option handling, implement new options.

        * tests/atlocal.in (MF_TOPDOMAIN,MF_NAMESERVER): New variables.
        (at_resolv_conf): New function.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Include new tests.
        * tests/hasmx.at: Use dedicated MF test domains,
        * tests/hostname.at: Likewise.
        * tests/ismx.at: Likewise.
        * tests/rescname.at: Likewise.
        * tests/resolve.at: Likewise.

        * tests/resolv_a.at: New test.
        * tests/resolv_mx.at: Likewise.
        * tests/resolv_ptr.at: Likewise.
        * tests/resolv_ptr_val.at: Likewise.
        * tests/resolv_spf.at: Likewise.
        * tests/resolv_txt.at: Likewise.

2017-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * lib/dns.c (dns_reply_resolve): Remove unneeded ntohl.
        * src/builtin/dns.bi): Remove unneeded htonl.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve DNS API consistency

        * lib/dns.c (dns_get_mx_records, getmx, getmxip): Replace with a
        single function mx_lookup. All uses updated.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes; implement test program for DNS API.

        * lib/dns.c (ptr_lookup): Reverse IP octets prior to look up. 
        Use adns_r_ptr_raw to disable consistency checks.
        (ptr_validate): Return values in struct dns_reply. All uses
        changed.
        * lib/dns.h (ptr_validate): Change signature.

        * tests/resolv.c: New test program.
        * tests/Makefile.am: Add resolv.c
        * tests/.gitignore: Update.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Drop configure checks for res_ functions


2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs


2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Unify DNS reply types.

        * lib/dns.h (mxbuf): Remove
        (mxbuf_init, mxbuf_free): Remove protos.
        (dns_get_mx_records): Remove the maxdepth parameter. Return MX
        names in struct dns_reply. All uses changed.
        (getmx,getmxip): Return MX names in struct dns_reply. All uses
        changed.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rewrite base dns functions using adns.

        * configure.ac: Require libadns.
        * lib/dns.c: Rewrite.
        * lib/dns.h (dns_resolve_ipstr, dns_resolve_hostname): Simplify 
        parameters.
        (dns_reply): Remove max, last_len, and last_max.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Drop ttl tracking from DNS API; drop SPF caching

        * lib/dns.c: Remove ttl tracking.
        * lib/dns.h: Fix prototypes.
        * mflib/spf.mf: Remove caching.
        * src/builtin/spf.bi (spf_ttl): Remove variable.
        * src/builtin/dns.bi: Update calls to DNS API.
        * src/spf.c: Likewise.
        * src/spf.h (spf_answer_t): Remove ttl.

2017-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * lib/dns.c (cname_loop_body): Restore accidentally removed
        line.

2017-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve DNS resolver API

        Remove arbitrary size limits.

        * NEWS: Version 8.2.90
        * configure.ac: Likewise. Require Mailutils 3.3

        * doc/calloutd.texi: Update.
        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.
        * doc/upgrade.texi: Update.

        * lib/dns.c: Rewrite.
        * lib/dns.h (MAXMXCOUNT, MXF_MAX): Remove.
        (mxbuf_init,dns_resolve_ipstr)
        (a_lookup,ptr_lookup,txt_lookup)
        (spf_lookup): Change protos.
        (dns_reply): New struct.
        (dns_reply_free,dns_reply_ip): New functions.
        * lib/libmf.h (getmxip): Change proto.

        * src/builtin/dns.bi: Remove runtime configuration statements: 
        max-dns-reply-a, max-dns-reply-ptr, and max-dns-reply-mx.
        Rewrite using the new DNS API.
        * src/callout.c: Update.
        * src/mailfromd.h: Update.
        * src/main.c: Remove the max-match-mx configuration statement.
        * src/prog.c: Update.
        * src/spf.c: Update.
        * src/spf.h: Update.
        * src/srvcfg.c: Remove the max-callout-mx configuration
        statement.

2017-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Allocate exception buffer even if status.mf is not required

        This fixes coredumps caused by calls to MF_THROW from built-in
        functions in scripts without the 'require status' statement.

        * src/exclist.c (fixup_exceptions): New function
        * src/mailfromd.h (fixup_exceptions): New proto.
        * src/gram.y: Call fixup_exceptions before setting up dataseg.

2017-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Require mailutils 3.3


2017-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 8.2


2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * src/gram.y (free_node): Deinit locus

2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

        Switch to detailed source locations from Mailutils 3.2.92

        * configure.ac: Version 8.1.92
        * NEWS: Update.
        * src/builtin/debug.bi (debug): Use mu_locus_range
        * src/builtin/from.bi: Likewise.
        * src/builtin/header.bi: Likewise.
        * src/builtin/progress.bi: Likewise.
        * src/builtin/qrnt.bi: Likewise.
        * src/builtin/rcpt.bi: Likewise.
        * src/exclist.c: Likewise.
        * src/builtin/sieve.bi: Use mu_locus_range
        (sieve): Accept new optional argument "col".
        * src/drivers.c: Use mu_locus_range
        (MARK_LOCUS): Rewrite as inline function.
        * src/gram.y: Use mu_locus_range and location macros from
        mailutils/yyloc.h Improve error diagnostics
        (parse_program): Prepare mu_strerr for locus-aware diagnostics.
        * src/lex.l: Use mu_linetrack_t to track locations.
        * src/mailfromd.h: Use mu_locus_range
        * src/main.c: Likewise.
        * src/pp.c: Likewise.
        * src/prog.c: Likewise.
        * src/prog.h: Likewise.
        * src/symbols.c: Likewise.

        * tests/ashadow.at: Expect detailed error locations.
        * tests/bctx00.at: Likewise.
        * tests/fctx00.at: Likewise.
        * tests/invcidr.at: Likewise.
        * tests/invcidr2.at: Likewise.
        * tests/module04.at: Likewise.
        * tests/module06.at: Likewise.
        * tests/poll04.at: Likewise.
        * tests/setvar.at: Likewise.
        * tests/shadow.at: Likewise.
        * tests/static02.at: Likewise.

2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes.

        * gacopyz/context.c (gacopyz_setmlreply_va): Return meaningful
        code.
        (gacopyz_setmlreply_v): Likewise.
        * lib/db.c (db_compact): Fix improper use of uninitialized
        value.
        * lib/userprivs.c (mf_gid_list_free): Fix loop.
        * mtasim/mtasim.c (smtp_mail): Remove unused variable.
        * src/calloutd.c (main): Likewise.
        * src/savsrv.c (callout_session_server): Likewise.

2017-04-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix typo in docs.


2017-04-09  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.1.90


2017-03-06  Sergey Poznyakoff  <gray@gnu.org>

        Fix compiler message


2017-03-04  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * lib/dns.c (cnameloop): Ignore trailing dot

2017-03-04  Sergey Poznyakoff  <gray@gnu.org>

        Fix syntax table in mfl-mode

        * elisp/mfl-mode.el: Declare _ as part of word

2017-01-21  Sergey Poznyakoff  <gray@gnu.org>

        mtasim: code cleanup

        * mtasim/mtasim.c (argcv_split, argcv_free): Remove.
        (parse_email_addr): Use mu_alloc.
        (check_address_command): Rewrite.
        (smtp_mail): New function.
        (smtp_rcpt): Update.
        (smtp): Use mu_wordsplit.

2017-01-02  Sergey Poznyakoff  <gray@gnu.org>

        Use new assoc array API (MU commit 622bc770)

        * lib/dict.c (name_destroy): Remove
        (dict_init): Use new API
        (dict_install,dict_getsym): Likewise.

2017-01-02  Sergey Poznyakoff  <gray@gnu.org>

        Happy GNU Year


2016-12-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve Sieve interface

        * src/builtin/sieve.bi: Initialize Sieve environment
        * doc/functions.texi: Document changes.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 8.1


2016-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use new Sieve API

        * src/builtin/sieve.bi: Change to use new Sieve API
        * configure.ac: Version 8.0.90.  Require MU 3.0.90
        * NEWS: Update.

2016-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/mailfromd


2016-12-08  Sergey Poznyakoff  <gray@gnu.org>

        Fix typo


2016-12-08  Sergey Poznyakoff  <gray@gnu.org>

        Ensure proper type conversion when coding immediate values.

        * src/prog.h (mf_c_cast): New define.
        (code_put, code_immediate): New macros.
        * src/prog.c (code_immediate): Rename to code_immediat_stkval.
        (code_put): Rename to code_put_stkval.
        * src/drivers.c: Use typed calls to code_immediate and code_put
        * src/gram.y: Likewise.

        * src/main.c: Allocate mu_log_tag.

2016-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes

        * lib/mfgetopt.c (mf_getopt): Initialize cfhint.flags
        * src/symbols.c (free_symbols): Free buckets after freeing 
        everything else.

2016-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix

        * lib/dns.c: Use stat.res_h_errno instead of the global h_errno.

2016-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Version 8.0


2016-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes


2016-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Update docs


2016-11-09  Sergey Poznyakoff  <gray@gnu.org>

        Update docs

        * doc/mailfromd.texi: Document the single configuration file.
        * doc/calloutd.texi: Update.
        * doc/mfdbtool.texi: Update.
        * doc/pmult.texi: Update.
        * pmult/pmult.c: Use the common configuration file.  Support 
        database-related configuration statements for compatibility with 
        other mailfromd utilities.
        * src/mfdbtool.c: compatibility fix: --predict implies --list.

2016-11-08  Sergey Poznyakoff  <gray@gnu.org>

        Use single configuration file.

        * lib/libmf.h (MF_GETOPT_DEFAULT)
        (MF_GETOPT_IN_ORDER,MF_GETOPT_NO_CONFIG): New flags.
        (mf_getopt): Change signature.
        * lib/mfgetopt.c (mf_getopt): Remove the cfile parameter. Change
        semantics of the 5th parameter (inorder -> flags).

        * mtasim/mtasim.c: Change call to mf_getopt.
        * pmult/pmult.c: Likewise.
        * src/calloutd.c: Likewise.
        * src/main.c: Likewise.
        * src/mfdbtool.c: Likewise.

2016-11-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix mfdbtool.

        * lib/db.c (mf_database_mode): New global variable.
        (mf_dbm_open): Remove "mode" parameter.  Use mf_database_mode.
        (db_expire_func): Fix passing the datum size.
        (db_compact): Preserve mode and ownership of the database.
        * lib/dbcfg.c (cb_database_mode): New function.
        * lib/mfdb.h (mf_database_mode): New extern.
        (mf_dbm_open): Change signature.
        (cb_database_mode): New proto.

        * src/mfdbtool.c (mfdbtool_cfg_param): New statement
        "database-mode". Read configuration from /etc/mailfromd.conf
        * src/srvcfg.c (srv_cfg_param): Likewise.

        * lib/cache.c: Update calls to mf_dbm_open.
        * lib/rate.c: Likewise.
        * lib/tbf_rate.c: Likewise.

2016-11-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        mfdbtool: add missing options


2016-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Require mailutils 3.0; update documentation


2016-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Follow Mailutils commit dc62b399


2016-10-31  Sergey Poznyakoff  <gray@gnu.org>

        Bugfixes

        * gacopyz/server.c (gacopyz_srv_reply): Return entire buffer.
        * pmult/pmult.c (collect_symlists): Don't attempt to print empty 
        client name.
        (main): Read mailutils configuration file.
        * src/srvcfg.c (mfd_capa_server): Don't register srv_cfg_param. 
        It pertains to canned section.

2016-10-30  Sergey Poznyakoff  <gray@gnu.org>

        Version 7.99.97


2016-10-30  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix

        * lib/libmf.h: Include limits.h

2016-10-30  Sergey Poznyakoff  <gray@gnu.org>

        Get rid of obstack; use mu_opool_t instead

        * configure.ac: Remove checks for obstack. Require Mailutils
        2.99.993
        * lib/Makefile.am: Remove obstack.
        * lib/obstack.c: Delete.
        * lib/obstack.h_: Delete.
        * po/POTFILES.in: Remove obstack.

        * lib/mfgetopt.c (mf_getopt): Bugfix: initialize flags.

        * lib/db.c: Use mu_opool_t instead of obstack.
        * mtasim/mtasim.c: Likewise.
        * pmult/pmult.c: Likewise.
        * src/callout.c: Likewise.
        * src/callout.h: Likewise.
        * src/engine.c: Likewise.
        * src/gram.y: Likewise.
        * src/lex.l: Likewise.
        * src/mailfromd.h: Likewise.
        * src/pragma.c: Likewise.
        * src/prog.c: Likewise.
        * src/spf.c: Likewise.
        * src/symbols.c: Likewise.

2016-10-29  Sergey Poznyakoff  <gray@gnu.org>

        Minor fixes


2016-10-28  Sergey Poznyakoff  <gray@gnu.org>

        Finish conversion.  Version 7.99.96


2016-10-24  Sergey Poznyakoff  <gray@gnu.org>

        Convert mailfromd to new interface.


2016-10-24  Sergey Poznyakoff  <gray@gnu.org>

        Start transition to mu_cli interface

        * configure.ac: Require mailutils 2.99.991

        * src/main.c: Start transition to mu_cli
        * lib/optcache.c: Remove file.
        * lib/Makefile.am (optcache.c): Remove.
        * lib/libmf.h: Remove optcache prototypes.
        * lib/dbcfg.c: Convert to mu_option.
        * lib/utils.c: Likewise.
        * src/builtin/dns.bi: Likewise.
        * src/builtin/io.bi: Likewise.
        * src/builtin/mbox.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/mfdbtool.c: Likewise.
        * src/savsrv.c: Likewise.
        * src/srvcfg.c: Likewise.
        * src/srvcfg.h: Likewise.

2016-10-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes

        * lib/dns.c (mf_to_dns_status): New function.
        * lib/libmf.h (mf_to_dns_status): New proto.
        * lib/cache.c: Fix conversions.
        * lib/rate.c: Fix conversions.
        * lib/vercmp.c: Fix conversions.
        * src/builtin/dns.bi: Fix conversions.
        * src/builtin/string.bi: Fix conversions.
        * src/drivers.c: Fix conversions.
        * src/exclist.c: Fix conversions.
        * src/main.c: Fix conversions.
        * src/prog.c: Fix conversions.
        * tests/trycatch05.at: Print first field of wc output.
        * tests/trycatch06.at: Likewise.
        * tests/trycatch07.at: Likewise.
        * tests/trycatch08.at: Likewise.
        * tests/trycatch09.at: Likewise.
        * tests/trycatch10.at: Likewise.
        * tests/trycatch11.at: Likewise.
        * tests/trycatch12.at: Likewise.
        * tests/trycatch13.at: Likewise.
        * tests/trycatch14.at: Likewise.
        * tests/trycatch15.at: Likewise.
        * tests/trycatch16.at: Likewise.
        * tests/version.at: Compatibility fix in sed expression.

2016-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes (mostly po-related)


2016-08-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Make listen(2) backlog size configurable.

        * lib/srvman.c (mfd_server_set_backlog): New function.
        * lib/srvman.h: Likewise.
        * src/srvcfg.c (server_section_param): New statement: "backlog"
        * src/srvcfg.h (mf_srvcfg) <backlog>: New member.

        * doc/mailfromd.texi: Document the backlog statement.
        * NEWS: Mention the backlog statement.

2016-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix documentation of spf_explanation.


2016-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * gacopyz/server.c (gacopyz_srv_connect): Fix memory allocation
        error.

2016-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Handle multiple strings in SPF records.

        * lib/dns.c (cname_loop_body): Concatenate multiple strings of a
        TXT record (RFC 7208, 3.3)

2016-04-26  Sergey Poznyakoff  <gray@gnu.org>

        Improve previous commit.

        * src/builtin/spf.bi (update_spf_vars): Add trailing null
        character.
        * src/spf.c (mech_include): Remove any mechanisms saved during 
        call to spf_check_host_internal if the result qualifies as not
        matching.

2016-04-20  Sergey Poznyakoff  <gray@gnu.org>

        List all traversed mechanisms in the spf_mechanism built-in
        variable.

        * src/builtin/spf.bi (update_spf_vars): Concatenate all 
        traversed mechanisms.
        * src/spf.c (spf_data): Replace exp, mech, ttl with a pointer to 
        answer.
        (UPDATE_ANSWER_TTL): New macro.  Use it instead of UPDATE_TTL 
        throughout this source.
        (spf_data_init): Take spf_answer_t * as 2nd argument.  All uses 
        changed.
        (mech_include,mod_redirect): Propagate pointer to original
        spf_answer_t through subordinate spf_check_host_internal calls.
        (mod_exp): Expand text here.
        (spf_eval_record): Trace traversed mechanisms.
        (spf_answer_free): Free mechv array
        (spf_answer_add_mech): New function.
        * src/spf.h (spf_answer_t): Remove mech. New members: mechv,
        mechn, mechmax.
        (spf_answer_add_mech): New proto.

        * doc/functions.texi: Document changes to the spf_mechanism 
        built-in variable.
        * NEWS: Update.

2016-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes

        * configure.ac: Fix the --with-dspam option.
        * doc/mailfromd.texi: Update postfix-related info.

2016-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Prevent NULL dereferencing when attempting to remove an
        unexistent symtab entry.

        * lib/symtab.c (symtab_remove): Return if no matching entry was
        found.

2016-03-03  Sergey Poznyakoff  <gray@gnu.org>

        Minor fix in pmult

        * pmult/pmult.c: PM_MAX_MACROS was renamed to PM_MACROS_MAX.

2016-03-02  Sergey Poznyakoff  <gray@gnu.org>

        Fix compilation of pmult with MeTA1 1.0.0.0

        * configure.ac: In MeTA1 1.0.0.0 librcbcomm was renamed to
        rcbcommr, and librcb - to librcbr.
        * pmult/pmult.c [!PM_MAX_MACROS] (PM_MAX_MACROS): Provide
        default.
        (SM_ONERROR_ACTION): Expect const char * from smerr2txt.
        (pmult_connect, pmult_rcpt): Use snprintf instead of umaxtostr.
        (main): Call mu_set_program_name.
        * doc/pmult.texi: Improve pmult documentation.

        Fix coredump:

        * gacopyz/server.c (gacopyz_srv_clear_macros_pred): Rearrange 
        the array after removing elements.

2016-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update copyright years


2016-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix type-related warnings.


2015-11-12  Sergey Poznyakoff  <gray@gnu.org>

        Fix C unescaping in lex code.

        The mailutils commit f160ca75 changed return code of 
        mu_wordsplit_c_unquote_char.  This commit modifies the code 
        accordingly.

        * src/lex.l (c_unescape): New function.  Use instead of 
        mu_wordsplit_c_unquote_char throughout the code.
        (QML line): remove spurious backslash.

2015-11-12  Sergey Poznyakoff  <gray@gnu.org>

        Fix build with dspam and geoip

        * src/builtin/dspam.bi: Fix the use of MF_VAR_REF.
        * src/builtin/geoip.bi: Use MF_RETURN.

2015-11-11  Sergey Poznyakoff  <gray@gnu.org>

        bootstrap: pull submodules


2015-09-15  Sergey Poznyakoff  <gray@gnu.org>

        Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/mailfromd


2015-09-15  Sergey Poznyakoff  <gray@gnu.org>

        Version 7.99.94

        * configure.ac: Version 7.99.94; Require Mailutils 2.99.99, use
        gettext 0.16
        * NEWS: Update.
        * etc/rc.in: Rewrite mailfromd_status
        * gacopyz/Makefile.am (AM_CPPFLAGS): Add /lib
        * src/builtin/io.bi (open_program_stream_ioe): Disable C escapes 
        when splitting the command line.
        * src/srvcfg.c (mf_srvcfg_init): Update call to
        mu_register_argp_capa

2015-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix typos.

        Thanks to Andres Jonsson.

2015-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes

        * Makefile.am: Fix path to git2chg.awk
        * lib/dns.c (domain_name_cmp): Use case-insensitive comparison

2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs

        * NEWS: Document new functions.
        * doc/functions.texi: Fix typos.
        * doc/mailfromd.texi: Likewise.

2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update copyright years


2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Avoid casts between pointers and integers (mtasim)

        * mtasim/mtasim.c (_def_write, _def_read, _def_close): SD points
        to file handle.
        (mta_daemon,mta_stdio): Change initialization of in and out.

2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Avoid casts between pointers and integers (group lists)

        * lib/libmf.h (mf_gid_list): New datatype.
        (mf_gid_list_alloc,mf_gid_list_free)
        (mf_gid_list_dup,mf_gid_list_add)
        (mf_gid_list_array): New functions.
        (switch_to_privs,get_user_groups): Change signature.
        * lib/server.c (mf_server_retain_groups): Change type.
        * lib/userprivs.c (mf_gid_block,mf_gid_list): New struct.
        (mf_gid_list_alloc,mf_gid_list_free)
        (mf_gid_list_dup,mf_gid_list_add)
        (mf_gid_list_array): New functions.
        (get_user_groups): Rewrite.
        (switch_to_privs): Take pointer to mf_gid_list as its last
        argument.
        (grouplist_translate): Rewrite.
        * mtasim/mtasim.c (grouplist): Change type. All uses updated.
        * src/srvcfg.c (mf_option_group): Rewrite.

2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Avoid casts between pointers and integers (optcache)

        * lib/libmf.h (mf_option_value): Union.
        (mf_option_cache): Rearrange members.
        (handler,set): Change signature.
        (isset): New member.
        (mf_optcache_set_option): Change signature.
        (mf_option_string,mf_option_boolean): Likewise.
        (mf_option_time_t,mf_option_size_t): Remove.
        (mf_option_timeout,mf_option_size): New prototypes.
        * lib/optcache.c (optcache_dup): Clear isset member for each
        element.
        (mf_optcache_set_option): Rewrite.
        (mf_option_string, mf_option_boolean): Rewrite.
        (mf_option_time_t,mf_option_size_t): Remove.
        (mf_option_timeout,mf_option_size): New functions.

        * lib/utils.c: Change the use of mf_optcache functions.
        * src/main.c: Likewise.
        * src/mfdbtool.c: Likewise.
        * src/srvcfg.c: Likewise.

2015-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Avoid casts between pointers and integers (prog & runtime).

        * src/prog.h (mf_stkval): New data type.
        (STKVAL): Redefine as union mf_stkval.
        (mft_ptr,mft_str,mft_int)
        (mft_uint,mft_long,mft_ulong)
        (mft_size,mft_string,mft_number): New data types.
        (mf_cat,mf_c_val): New macros.
        (instr_t): Moved from mailfromd.h
        (mf_code_cell): New union
        (mf_code_cell_t): New typedef.
        (mf_cell_instr,mf_cell_value)
        (mf_cell_c_value): New macros
        (code_peek): Moved from mailfromd.h. Change return type;
        (code_immediate,code_put): Moved from mailfromd.h. Change
        signature.
        (code_op,code_instr,code_exmask)
        (code_get_counter,dump_code,fixup_code): Moved from mailfromd.h.
        (prog): Change type.
        * src/prog.c: Use mf_c_val to extract C values from STKVAL.
        (get_immediate): Return STKVAL.
        (prog): Change type
        (code_cell): New function.
        (code_instr): Rewrite using code_cell
        (code_immediate): Likewise. Change argument type.
        (code_exmask): Use proper typecast.
        (code_put): Change argument type.
        (code_peek): Change return type.
        (runtime_stack_trace): Use mf_cell_instr to access instruction 
        pointer.
        * src/mailfromd.h (yyerror): Change signature.
        (instr_t): Move to prog.h
        (code_put,code_peek,code_reserve)
        (code_immediate,code_op,code_instr)
        (code_exmask,code_get_counter)
        (dump_code,fixup_code): Move to prog.h
        * src/exclist.c: Use mf_c_val
        * src/gram.y (yyerror): Change signature.
        (mailfromd_run): Use mf_c_val to extract actual value.

        * doc/functions.texi (body_has_nulls): Fix return type.

        * src/builtin/snarf.m4 (__mf_defun): Define __MF_RETTYPE__
        (MF_RETURN): Take optional second argument (return type). Decide
        what push function to use and what type to cast the value to
        depending on its value and that of __MF_RETTYPE__.
        (MF_RETURN_STRING): Remove.
        (MF_RETURN_OBSTACK): Explicitly declare return type as STKVAL.
        (MF_VAR_REF): Take two or three arguments (second one declaring 
        value type).
        (MF_ALLOC_HEAP_TEMP):
        (MF_VAR_STRING): Update.
        (END): Popdef __MF_RETTYPE__.
        * src/builtin/body.bi: Use MF_RETURN.
        (body_has_nulls): Fix return type.
        * src/builtin/burst.bi: Use MF_RETURN.
        * src/builtin/callout.bi: Likewise.
        * src/builtin/ctype.bi: Likewise.
        * src/builtin/curhdr.bi: Likewise.
        * src/builtin/db.bi: Likewise.
        * src/builtin/debug.bi: Likewise.
        * src/builtin/dns.bi: Likewise.
        * src/builtin/email.bi: Likewise.
        * src/builtin/geoip.bi: Likewise.
        * src/builtin/getopt.bi: Likewise.
        * src/builtin/gettext.bi: Likewise.
        * src/builtin/io.bi: Likewise.
        * src/builtin/ipaddr.bi: Likewise.
        * src/builtin/macro.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/builtin/sa.bi: Likewise.
        * src/builtin/spf.bi: Likewise.
        * src/builtin/string.bi: Likewise.
        * src/builtin/system.bi: Likewise.
        * src/builtin/vars.bi: Likewise.

        * src/drivers.c: Use proper typecasts when calling code_*
        functions.
        * src/optab.opc (scan_code): Use mf_cell_c_value to inspect 
        prog[].

2015-04-24  Sergey Poznyakoff  <gray@gnu.org>

        Minor change


2015-04-24  Sergey Poznyakoff  <gray@gnu.org>

        Implement change sender function.

        * gacopyz/gacopyz.c (gacopyz_argn_command): New function.
        (gacopyz_add_rcpt_par, gacopyz_chgfrom): Use
        gacopyz_argn_command.

        * src/builtin/Makefile.am (BI_FILES): Add from.bi
        * src/builtin/from.bi: New file.

        * src/mailfromd.h (msgmod_opcode) <set_from>: New opcode.
        * src/engine.c (run_msgmod): Support set_from.
        (smfilter): Announce SMFIF_CHGFROM flag.
        * src/gram.y (msgmod_opcode_str): Support set_from.

        * NEWS: Update.
        * doc/functions.texi: Document set_from.

2015-04-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix doc generation.

        Default Config file applied to all output formats, which is
        wrong. Use a dedicated configuration file for html output
        formats, and defaults for the rest.

        * doc/Makefile.am (GENDOCS): Add html-specific configuration
        file.
        * doc/Config: Rename to doc/html.init (with changes).
        * doc/functions.texi: Fix sectioning.
        * doc/mailfromd.texi: Likewise.

2015-03-01  Sergey Poznyakoff  <gray@gnu.org>

        Switch to Texinfo 5.0

        * doc/Config: Rewrite.
        * doc/Makefile.am: Use Makeinfo 5 instead of texi2htm
        * doc/gendocs_template: Ps is not built
        * imprimatur: Upgrade.

2014-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix (remove unused static function)


2014-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        New function message_body_is_empty

        * src/builtin/msg.bi (DCL_BODY_HDR): New m4 macro.
        (message_body_is_empty): New function.

        * NEWS: Mention message_body_is_empty
        * doc/functions.texi: Document message_body_is_empty

        * tests/nulmsg.at: New  testcase.
        * tests/Makefile.am: Add new test.
        * tests/testsuite.at: Likewise.

2014-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/builtin/mbox.bi (mailbox_open): Fix the use of the perms 
        argument.
        * doc/functions.texi: Document last argument to mailbox_open.

2014-08-27  Sergey Poznyakoff  <gray@gnu.org>

        get translations from TP during bootstrapping


2014-02-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * src/pp.c (stderr_redirector): Fix reading loop.
        * src/savsrv.c (callout_session_server): Likewise.

2013-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Get rid of gnulib.

        * .gitmodules: Remove gnulib.
        * gnulib: Remove.
        * gnulib.modules: Remove.
        * Makefile.am: Remove gnulib. Use git2chg.awk to create 
        ChangeLog.
        * bootstrap: Rewrite.
        * bootstrap.conf: Remove.
        * configure.ac: Update.
        * gacopyz/Makefile.am (AM_CPPFLAGS): Update.
        * git2chg.awk: New file.
        * lib/Makefile.am: Remove dependencies on gnulib.
        * mtasim/Makefile.am: Likewise.
        * pmult/Makefile.am: Likewise.
        * src/Makefile.am: Likewise.
        * src/builtin/Makefile.am: Likewise.

        * lib/gettext.h: New file.
        * lib/.gitignore: New file.
        * lib/obstack.c: New file.
        * lib/obstack.h_: New file.

        * lib/ftimestr.c (format_time_str): Rewrite using strftime and
        statically allocated buffer.
        * lib/libmf.h (transform_error_string): Change return type
        (const char *).
        * lib/proctitle.c: Rewrite using statically allocated buffer.
        * lib/transform.c: Use mu_ allocation and ctype functions.
        (transform_error_string): Use statically allocated buffer. 
        Return a pointer to its content.
        * mtasim/mtasim.c Use mu_ allocation and ctype functions.
        (save_cwd, restore_cwd): New functions

        * lib/db.c: Use mu_ allocation and ctype functions.
        * lib/dbcfg.c: Likewise.
        * lib/dict.c: Likewise.
        * lib/dns.c: Likewise.
        * lib/namefixup.c: Likewise.
        * lib/optcache.c: Likewise.
        * lib/parsetime.c: Likewise.
        * lib/server.c: Likewise.
        * lib/srvman.c: Likewise.
        * lib/userprivs.c: Likewise.
        * lib/utils.c: Likewise.
        * pmult/pmult.c: Likewise.
        * src/bitmask.h: Likewise.
        * src/builtin/burst.bi: Likewise.
        * src/builtin/ctype.bi: Likewise.
        * src/builtin/db.bi: Likewise.
        * src/builtin/dns.bi: Likewise.
        * src/builtin/dspam.bi: Likewise.
        * src/builtin/getopt.bi: Likewise.
        * src/builtin/getpw.bi: Likewise.
        * src/builtin/mbox.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/builtin/sprintf.bi: Likewise.
        * src/callout.h: Likewise.
        * src/calloutd.c: Likewise.
        * src/deprecation.c: Likewise.
        * src/engine.c: Likewise.
        * src/exclist.c: Likewise.
        * src/gram.y: Likewise.
        * src/lex.l: Likewise.
        * src/mailfromd.h: Likewise.
        * src/main.c: Likewise.
        * src/mfdbtool.c: Likewise.
        * src/pp.c: Likewise.
        * src/pragma.c: Likewise.
        * src/prog.c: Likewise.
        * src/srvcfg.c: Likewise.
        * src/stack.c: Likewise.
        * src/symbols.c: Likewise.

        * src/callout.c: Likewise.
        * po/.gitignore: Update.
        * po/Makevars: New file.
        * src/builtin/io.bi: Use mu_ allocation and ctype functions.
        (stderr_to_log): Use fgets instead of getline.
        * src/builtin/system.bi (strftime): Use statically allocated
        buffer and strftime.
        * src/savsrv.c: Use mu_ allocation and ctype functions.
        (trimcrlf): Return 0 if theCR(LF) has been removed and 1
        otherwise.
        (callout_session_server): Use statically allocated buffer.
        Reject input lines that are longer than allowed by its capacity.
        * src/spf.c: Use mu_ allocation and ctype functions.
        (scanback): New function.
        (spf_reverse,spf_truncate): Use scanback instead of memrchr.

2013-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document testsuite

        * tests/testsuite.at: Add banners

2013-07-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Provide built-ins for effective handling of large message
        bodies.

        * src/mailfromd.h (body_repl_fd): New opcode.
        * src/engine.c (run_msgmod): Handle body_repl_fd.
        * src/gram.y (msgmod_opcode_str): Handle body_repl_fd.
        * gacopyz/gacopyz.c (gacopyz_replace_body_fn)
        (gacopyz_replace_body_fd): New functions.
        (gacopyz_replace_body): Rewrite using gacopyz_replace_body_fn.
        * gacopyz/gacopyz.h (gacopyz_replace_body_fn)
        (gacopyz_replace_body_fd): New protos.
        * src/builtin/body.bi (replbody_fd): New built-in function.
        * src/builtin/io.bi (open_program_stream_ioe): New static.
        (open_program_stream): Rewrite via open_program_stream_ioe.
        (spawn, write_body): New built-in functions.
        * src/builtin/system.bi (unlink): New built-in function.
        * NEWS: Update.
        * doc/functions.texi: Document the new functions.

2012-12-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use AM_CPPFLAGS instead of INCLUDES in Makefiles.


2012-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix communication with a program invoked via open().

        * src/builtin/io.bi (REDIRECT_STDOUT_P): Fix.
        (open_program_stream): Remove improper calls to close().
        (open): Implement the |< prefix to open read-only communication 
        with the invoked program.
        * doc/functions.texi: Document the |< prefix.
        * NEWS: Update.
        * THANKS: Mention Mehmet Tolga Avcioglu.

2012-09-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix `next' in do-while loops.

        The next keyword would incorrectly bypass the conditional in 
        do-while loops.

        * src/drivers.c (code_type_loop): Fix jump target for `next' to 
        include end of loop conditional.
        * tests/next03.at: New test case.
        * tests/Makefile.am (TESTSUITE_AT): Add next03.at
        * tests/testsuite.at: Include next03.at

        * tests/next01.at: Fix keywords.
        * tests/next02.at: Likewise.
        * tests/trycatch07.at: Likewise.
        * tests/trycatch08.at: Likewise.
        * tests/trycatch11.at: Likewise.
        * tests/trycatch12.at: Likewise.
        * tests/trycatch15.at: Likewise.
        * tests/trycatch16.at: Likewise.

        * NEWS: Update.

2012-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve DSN API.

        * src/builtin/mail.bi (add_headers): Append headers to existing
        ones, instead of replacing them. Unref the header stream.
        (mime_create_quote): Skip envelope (UNIX From ) line.
        (create_dsn): New function.

2012-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rename header_rename_* functions to header_prefix_*

        * mflib/header_rename.mf4 (header_rename_all): Rename to
        header_prefix_all.
        (header_rename_pattern): Rename to header_prefix_pattern.
        * NEWS: Likewise.
        * doc/functions.texi: Likewise.

2012-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement functions for modifying headers addressed by their
        number. Improve header renaming functions.

        * NEWS: Updated.
        * doc/functions.texi: Updated.
        * mflib/header_rename.mf4: Rewrite from scratch.
        * src/builtin/curhdr.bi (get_current_header): Remove, use
        env_get_header instead. All uses changed.
        * src/builtin/header.bi (header_delete_nth)
        (header_replace_nth): New built-ins.
        * src/builtin/snarf.m4 (MF_CAPTURE): Accept opional argument. 
        All uses updated.
        * src/builtin/vars.bi (sendmail_header_count): New variable.
        (get_sendmail_header_count)
        (set_sendmail_header_count): New functions.
        * src/engine.c (message_data) <hdrtrans,hdrcount>: New members.
        (test_message_data_init,priv_get): Initialize hdrtrans and
        hdrcount.
        (priv_store_msgmod_closure): Name can be NULL.
        (filter_cleanup): Free hdrtrans.
        (run_msgmod) <header_insert>: Adjust header number by the value
        of sendmail_header_count variable. Handle header_replace_nth and
        header_delete_nth opcodes.
        * src/gram.y (msgmod_opcode_str): Handle header_replace_nth and 
        header_delete_nth opcodes.
        * src/mailfromd.h (msgmod_opcode) <header_delete_nth>
        <header_replace_nth>: New opcodes.
        (get_sendmail_header_count)
        (set_sendmail_header_count)
        (env_get_header): New protos.
        * src/prog.c (eval_environ) <header>: New member.
        (env_capture_start): Initialize header.
        (env_get_header): New function.
        (env_msgmod): Name can be NULL.
        (destroy_environment): Destroy the header.

2012-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix trace output.

        The c-escape filter used by the trace output stream suppresses 
        newlines in output.  This is harmless when the output goes to 
        syslog, but when it goes to stderr, all trace lines get
        concatenated into a single one on output.  To fix this, newline
        has to be sent directly to the underlying stream, bypassing the
        filter.

        * src/main.c (trace): Send newline bypassing the c-escape filter
        (which would have converted it to the "\n" sequence). This
        requires MU commit 1cbbd572.

2012-07-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Upgrade imprimatur.


2012-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * lib/db.c (db_compact): Do not unlink prior to renaming.

2012-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        mfdbtool: fix creating the database when compacting

        This requires MU 5eb34056 or later.

        * lib/db.c (make_tmp_name): Prefer changing the suffix when 
        creating temporary db name.
        (db_compact): Make sure file mode and owner are preserved. Use
        actual file name (as opposed to eventual URL) when renaming.

2012-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * mflib/Makefile.am (EXTRA_DIST): Add dspam.mf

2012-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore legacy lock-* configuration statements.

        * lib/libmf.h (config_cb_lock_retry_count)
        (config_cb_lock_retry_timeout)
        (mf_option_size_t,mf_init_lock_options): New prototypes.
        * lib/optcache.c (mf_option_size_t): New function.
        * lib/utils.c (config_cb_lock_retry_count)
        (config_cb_lock_retry_timeout)
        (mf_init_lock_options): New functions.
        * src/main.c (mf_cfg_param): Restore lock-retry-count and 
        lock-retry-timeout for backward compatibility.
        (main): Call mf_init_lock_options.
        * src/mfdbtool.c (mfdbtool_cfg_param): Restore lock-retry-count
        and lock-retry-timeout for backward compatibility.
        (main): Call mf_init_lock_options.
        * src/calloutd.c: Likewise.

        * lib/close-fds.c (close_fds_except): Don't access FD_SET unless 
        i is less than FD_SETSIZE.

2012-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix database expiration in mfdbtool.

        * NEWS: Version 7.99.92
        * configure.ac: 7.99.92
        * lib/db.c (make_tmp_name): Don't assume additional directories.
        * lib/mfdb.h (db_expire_t): Change signature.  All uses updated.

2012-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix circular dependency in Makefiles.

        This fixes 2ef494a7.  Make should process the mflib directory 
        before src, because the latter relies on status.ex being built. 
        On the other hand, mf sources in mflib have to be linted on make
        check.  The solution runs as follows: (1) mflib appears in 
        SUBDIRS before src, and (2) src/Makefile.am runs make lint in
        ../mflib on make check.

        * Makefile.am (SUBDIRS): Restore mflib to its proper place.
        * mflib/Makefile.am (check-am): Remove rule.
        * src/Makefile.am (check-am): New rule.  Run make lint in mflib.

2012-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix ipv6 configuration test.


2012-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement ltrim and rtrim

        * src/builtin/string.bi (ltrim, rtrim): New functions.
        * NEWS: List new functions.
        * doc/functions.texi: Document new functions.

2012-02-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix argument expansion in pragmas.

        * src/pragma.c (expand_string): Fix expansion of quoted strings.

2012-02-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix database privileges in dbfirst.

        * src/builtin/db.bi (dbfirst): Get db mode from the properties, 
        use DEFAULT_DB_MODE if these are not defined.

2011-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.99.91


2011-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        More fixes.  Use mu_list_foreach instead of mu_list_do.

        * Makefile.am (SUBDIRS): Use mflib after src, so that make check
        uses the freshly built version of mailfromd.
        * lib/userprivs.c: Use mu_list_foreach instead of mu_list_do
        * mtasim/mtasim.c: Likewise.
        * pmult/pmult.c: Likewise.
        * src/builtin/mbox.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/engine.c: Likewise.
        * src/gram.y: Likewise.
        * src/main.c: Likewise.
        * src/pp.c: Likewise.

2011-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * configure.ac: Fix mu info test.
        * lib/db.c: Add default safety flags to mu_dbm_create* calls.
        * src/builtin/db.bi: Likewise.

2011-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve handling of database security flags.

        * src/builtin/db.bi (db_prop)<hint>: New member.
        (dbprop): Accept additional "hint" argument.
        (_mf_dbm_open): Rename to _open_dbm (all uses changed). Get
        safety flags from the created DB and augment them with bits
        deduced from the file mode.
        * src/srvcfg.c (mf_srvcfg_flush): Add default parameters to the
        database URL hint.

2011-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes

        * lib/db.c (mf_dbm_open): Destroy db after failed attempt to
        open it.
        * src/builtin/db.bi (_mf_dbm_open): Likewise.
        (dbmap_lookup): Take db_prop as an additional argument.  Use its
        mode field for opening. Fix improper conditional.

2011-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Switch to libmu_dbm for DBM support.

        * configure.ac (DEFAULT_DB_TYPE): New variable. Use mu info to
        determine which DBM is supported.
        * lib/Makefile.am (noinst_LIBRARIES): Remove libdbm.a
        * lib/mf-dbm.c: remove.
        * lib/mf-dbm.h: remove.
        * lib/cache.c: Use libmu_dbm functions.
        * lib/db.c: Likewise.
        * lib/dbcfg.c: Likewise.
        * lib/greylist.c: Likewise.
        * lib/rate.c: Likewise.
        * lib/tbf_rate.c: Likewise.
        * src/builtin/db.bi: Likewise.
        * src/savsrv.c: Likewise.
        * src/srvcfg.c (srv_cfg_param) <database-type>: New statement.
        * lib/libmf.h (config_cb_ignore): New proto.
        * lib/mfdb.h (db_item_printer_t): Change signature.
        * lib/utils.c (config_cb_ignore): New function.
        * po/POTFILES.in: Update.
        * src/Makefile.am (mailfromd_LDADD)
        (calloutd_LDADD): Remove libdbm.a.
        * src/calloutd.c: Update.
        * src/main.c (mf_cfg_param): lock-retry-count and 
        lock-retry-timeout are no-op now.
        * src/mfdbtool.c: Likewise.

2011-11-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Adapt for MU 2.99.94

        * configure.ac: Require MU 2.99.94
        * lib/mf-dbm.c: Use EACCES instead of the removed
        MU_ERR_UNSAFE_PERMS
        * src/builtin/burst.bi (finish_stream): Use MU_ERR_INVALID_EMAIL
        instead of the removed MU_ERR_BAD_822_FORMAT.
        * src/mfdbtool.c (main): exit on invalid usage.

2011-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Docs: fix sentence spacing; use @: where appropriate.


2011-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use Imprimatur for doc development and maintenance.

        * Makefile.am (SUBDIRS): Add imprimatur.
        * configure.ac: Invoke IMPRIMATUR_INIT
        * doc/Makefile.am: Update.
        * doc/check-docs.sh: Remove.
        * doc/rendition.texi: Remove.
        * doc/untabify.el: Remove.
        * doc/mastermenu.el: Remove.
        * doc/functions.texi: Minor changes.
        * doc/mailfromd.texi: Minor changes.
        * doc/mfdbtool.texi: Minor changes.

2011-09-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/builtin/io.bi (open_program_stream): Print the value of 
        errno, not rc (which is irrelevant if execve fails).

2011-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document DSPAM, fix doc compilation.

        * NEWS: Update.
        * doc/Makefile.am (AM_MAKEINFOFLAGS): Use abs_top_srcdir Pass
        --I option to texi2html.
        * doc/functions.texi: Document DSPAM. Use @deftypevr instead of
        @deftypevar.
        * doc/mailfromd.texi: Update.

2011-08-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Further improvements to the message_burst interface.

        * NEWS, doc/functions.texi: Update.
        * mflib/status.mf (BURST_ERR_MASK): New mask.
        (BURST_DECODE): New flag.
        * src/builtin/burst.bi (burst_stream) <on_bad_format>: Remove.
        <burst_ctl>: New member.
        (finish_stream): Select error action from burst_ctl.
        (burst_digest): Optionally decode MIME parts.

2011-08-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Separate C and MFL constant space.

        * mflib/.gitignore: Add status.h
        * mflib/Makefile.am (noinst_HEADERS): Add status.h
        (BUILT_SOURCES): Expand to noinst_HEADERS
        * mflib/dspam.mf: Change prefix to _MFL_
        * mflib/status.mf: Likewise.
        * mflib/syslog.mf: Likewise.
        * src/builtin/builtin.c (_builtin_const_to_c)
        (_builtin_c_to_const,_builtin_const_to_bitmap): New functions.
        * src/builtin/builtin.def (builtin_const_trans): New struct.
        (_builtin_const_to_c,_builtin_c_to_const)
        (_builtin_const_to_bitmap): New protos.
        * src/builtin/burst.bi: Include mflib/status.h. Rename BURST_ 
        constants to agree with the new prefix.
        * src/builtin/dspam.bi: Use translation functions from
        builtin.c.
        * src/builtin/syslog.bi: Likewise.
        * src/builtin/io.bi: Translate shutdown modes.
        * src/builtin/snarf.m4 (MF_TRANS_PREFIX): New constant.
        (MF_TRANS): New macro.
        * src/builtin/system.bi: Translate access modes.

2011-08-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix NEWS


2011-08-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve error handling in message_burst.

        * mflib/status.mf (BURST_ERR_FAIL)
        (BURST_ERR_IGNORE,BURST_ERR_BODY): New constants.
        * src/builtin/burst.bi (burst_stream) <on_bad_format>: New
        member.
        (finish_stream): If the stream cannot be converted to message, 
        use on_bad_format to decide what to do with it.
        (message_burst): Take optional argument.
        * src/builtin/sa.bi (set_xscript): Now returns void.
        * src/prog.c (env_function_cleanup_del): Bugfix.

        * NEWS, doc/functions.texi: Document the changes to
        message_burst.

2011-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * src/builtin/burst.bi (DEFAULT_EB_LEN): New define
        (MF_INIT): Initialize burst_eb_min_length.
        * doc/functions.texi: Document RFC 934 functions.

2011-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement a built-in function for bursting RFC 934 digests.

        * configure.ac: Require Mailutils 2.99.93

        * src/prog.c (_cleanup_destroy) allow for clos->cleanup == NULL.
        (env_function_cleanup_del): New function.
        * src/prog.h (env_function_cleanup_del): New proto.

        * mflib/status.mf (e_format): New exception.

        * src/builtin/snarf.m4 (MF_CLR_CLEANUP): New macro.
        * src/builtin/burst.bi: New source.
        * src/builtin/Makefile.am (BI_FILES): Add burst.bi

        * src/builtin/body.bi (current_message): Pass MF_MSG_CURRENT to
        bi_message_register.
        * src/builtin/mbox.bi (mailbox_get_message): Pass MF_MSG_MAILBOX 
        to bi_message_register.
        * src/builtin/msg.bi (drop_current_message)
        (bi_get_current_message): Check for MF_MSG_CURRENT
        (bi_close_message): Destroy the message if type is
        MF_MSG_STANDALONE.
        (bi_message_register): Change meaning of the last argument.
        * src/builtin/msg.h (MF_MSG_MAILBOX)
        (MF_MSG_CURRENT,MF_MSG_STANDALONE): New defines.
        (mf_message) <mylist>: Remove.
        (mf_message) <current>: Rename to type.
        * src/builtin/sieve.bi: Fix a bug introduced in 19f41d6c5b.

        * NEWS: Document message_burst.
        * doc/functions.texi: Restructure the "Message functions"
        section.

2011-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve third-party interfaces to process arbitrary messages
        (not only current one).

        * NEWS: Updated.
        * doc/functions.texi: Reflect changes in sieve, clamav and sa
        (spamc) functions.
        * mflib/Makefile.am: Build sa.h
        * mflib/sa.mf (SA_SYMBOLS, SA_REPORT)
        (SA_LEARN_SPAM,SA_LEARN_HAM,SA_FORGET): New constants.
        (sa): Wrapper over spamc for backward compatibility.
        * src/builtin/Makefile.am (builtin.h): Depends on builtin.def
        * src/builtin/body.bi (current_message): Use
        MF_STREAM_TO_MESSAGE.
        * src/builtin/builtin.c: Add more includes.
        (_builtin_stream_cleanup): New function.
        (_builtin_mu_stream_to_message): New function.
        * src/builtin/builtin.def (_builtin_stream_cleanup)
        (_builtin_mu_stream_to_message): New protos.
        * src/builtin/dspam.bi: Use _builtin_stream_cleanup for stream
        cleanups.
        * src/builtin/msg.bi (message_from_stream): Use
        MF_STREAM_TO_MESSAGE.
        * src/builtin/sa.bi (open_connection): Register returned stream 
        for cleanup.
        (sa): Rewrite as spamc function.
        (clamav): Take message descriptor as the first argument.
        * src/builtin/sieve.bi (sieve): Take message descriptor as the
        first argument. Use cleanups.
        * src/builtin/snarf.m4 (MF_STREAM_TO_MESSAGE): New macro.
        * src/main.c (options): Remove "debug" option, handled by
        srvcfg.c
        * tests/bctx00.at: Use current_message function.
        * tests/bctx01.at: Likewise.
        * tests/fctx00.at: Likewise.
        * tests/fctx01.at: Likewise.

2011-08-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * src/builtin/dspam.bi: Translate return code. Change handling
        of class_src argument.
        * mflib/dspam.mf: Redefine DSS_NONE,DSR_NONE to be 0.

2011-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Parse dspam configuration file.

        * mflib/dspam.mf: Start DSZ_ constants from 1.
        * src/builtin/dspam.bi: Parse dspam.conf
        * src/builtin/snarf.m4 (__MF_DSEXP_REQ): Fix quoting.

2011-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * src/builtin/dspam.bi: Configure training mode.

2011-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.


2011-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/mailfromd


2011-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement dspam support.

        * configure.ac: Check for dspam
        * mflib/.gitignore: Add dspam.h
        * mflib/Makefile.am: Build dspam.h Install dspam.mf
        * mflib/dspam.mf: New file.
        * src/Makefile.am (mailfromd_LDADD): Add DSPAM_LIBS
        (INCLUDES): Add DSPAM_CFLAGS
        * src/builtin/Makefile.am (BI_FILES): Add dspam.bi.
        (INCLUDES): Add DSPAM_CFLAGS
        * src/builtin/dspam.bi: New file.
        * src/main.c (mailfromd_show_defaults): Reflect dspam support.

2011-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        New macros and functions for registering function cleanup
        sequence in environments.

        Cleanup sequence holds pointers to data created within the
        function along with the corresponding functions for their
        disposal.  When the function terminates or raises an exception,
        the sequence is executed thereby freeing the temporary data.

        * mflib/mfh.awk: Convert # comments to C-style.
        * src/builtin/io.bi (REDIRECT_STDOUT_P): Remove useless
        comparison.
        * src/builtin/snarf.m4 (MF_VAR_STRING): New macro
        (END): Call env_function_cleanup_flush.
        (MF_DCL_CLEANUP,MF_CLEANUP): New macros.
        * src/builtin/spf.bi (spf_check_host)
        (spf_test_record): Use MF_VAR_STRING to initialize q.exp_prefix.
        * src/prog.c (environ_cleanup_closure): New struct.
        (eval_environ)<cleanup_list>: New member.
        (env_create_cleanup_list): New static function.
        (env_function_cleanup_flush)
        (env_function_cleanup_add): New function.
        (env_throw_0): Call env_function_cleanup_flush.
        (create_environment): Create cleanup_list.
        (destroy_environment): Destroy it.
        * src/prog.h (env_function_cleanup_add)
        (env_function_cleanup_flush): New protos.

2011-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve I/O interface, implement new functions.

        * mflib/status.mf (SHUT_RD,SHUT_RW)
        (SHUT_RDWR): New constants.
        * src/builtin/io.bi (io_stream) <shutdown>: New member
        (open_inet_stream): Set str->shutdown.
        (tempfile,shutdown,rewind,copy): New built-in functions.
        * src/builtin/mail.bi (_send): Recipient address (to) can be
        null.
        (send_mail,send_text): `To' argument is now optional.
        (send_message): New built-in function.
        * src/builtin/msg.bi (message_copy): Rename to message_to_stream
        (message_copy_body): Rename to message_body_to_stream.
        (message_to_stream): New built-in function.

        * NEWS: Document new functions.
        * doc/functions.texi: Likewise.

2011-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Pass content size to item printers

        * lib/mfdb.h (db_item_printer_t): Take four arguments.
        * lib/cache.c: Update item printers.
        * lib/db.c: Likewise.
        * lib/greylist.c: Likewise.
        * lib/tbf_rate.c: Likewise.
        * lib/rate.c: Likewise.

2011-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix


2011-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement getenv() builtin and string_list_iterate macro.

        * mflib/pp-setup (string_list_iterate): New macro.
        * src/builtin/system.bi (getenv): New function.

        * NEWS: Update.
        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.

2011-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement message_copy and message_body_copy built-ins.

        * src/builtin/io.bi (_bi_io_fd): New function.
        * src/builtin/msg.bi (message_copy)
        (message_body_copy): New builtin functions.
        * src/builtin/msg.h (_bi_io_fd): New proto.
        * doc/functions.texi: Document new functions.
        * NEWS: Mention new functions.

2011-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix IPv6 recognition in configure.

        * am/ipv6.m4: check whether getaddrinfo works for AF_INET6.
        * tests/connect03.at: Fix prerequisite.

2011-08-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Call connect handler from mtasim.

        * configure.ac (MF_IPV6_SUPPORT): New subst var.
        * gacopyz/gacopyz_priv.h (GACOPYZ_IPV6PREFIX_STR)
        (GACOPYZ_IPV6PREFIX_LEN): New macros.
        * gacopyz/gacopyz.h (gacopyz_srv_connect): Rename to
        gacopyz_srv_open
        (gacopyz_srv_conn): Rename to gacopyz_srv_connect.
        * gacopyz/gacopyz.c (shan_connect): Use GACOPYZ_IPV6PREFIX_STR 
        and GACOPYZ_IPV6PREFIX_LEN macros instead of the literals.
        <inet6>: Convert port to network byte order.
        * gacopyz/server.c (gacopyz_srv_connect): Rename to
        gacopyz_srv_open.
        (gacopyz_srv_conn): Remove.
        (gacopyz_srv_connect): New function.
        * mtasim/mtasim.c (sender_hostname, sender_sockaddr): New
        variables.
        (OPTION_SENDER_SOCKADDR): New option code.
        (options)<--sender-sockaddr>: New option.
        (parse_opt): Handle OPTION_SENDER_SOCKADDR.
        (main): Call gacopyz_srv_connect if sender_hostname is set.
        (smtp): Call gacopyz_srv_connect before handling first SMTP
        command, unless it has already been called before.
        (shell_help): Show \S command if available.
        (shell): Handle \S command.
        * pmult/pmult.c: Reflect the above changes.
        * tests/Makefile.am (TESTSUITE_AT): Add connect00.at,
        connect01.at, connect02.at and connect03.at.
        * tests/testsuite.at: Include connect00.at -- connect03.at.
        * tests/atlocal.in (MF_IPV6_SUPPORT): New variable.
        * tests/connect00.at: New testcase.
        * tests/connect01.at: New testcase.
        * tests/connect02.at: New testcase.
        * tests/connect03.at: New testcase.

        * NEWS: Update.
        * doc/mtasim.texi: Document the \S command and the
        --sender-sockaddr option.
        * doc/mailfromd.texi: Update.

2011-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add a testcase for #! ... !# comment.

        * tests/atlocal.in (MAILFROMD): New variable.
        * tests/shellmagic.at: New file.
        * tests/Makefile.am: Add shellmagic.at
        * tests/testsuite.at: Include shellmagic.at

2011-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * doc/mailfromd.texi: Make it clear that the initial #! must 
        have a closing !#.

2011-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement the initial #! ... !# block comment.

        * src/lex.l: Handle initial #! ... !# block comment.
        * doc/mailfromd.texi: Document the #! ... !# comment.
        * NEWS: Update.

2011-07-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/builtin/mail.bi: Redo message creation using a static
        stream.

2011-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve reporting of startup errors. HUP restarts the program
        only if syntax check succeeds.

        * lib/libmf.h (mf_server_lint_option): New extern.
        * lib/server.c (mf_server_lint_option): New global variable.
        (sig_restart): Don't call mfd_srvman_stop.
        (run_lint,server_idle_hook): New functions.
        (mf_server_start): Install idle hook. HUP restarts the program
        only if syntax check succeeds. Close fds above 2 if using stderr
        for error output, and from 1 if using syslog.
        * src/calloutd.c (main): Call mu_stdstream_setup. Set
        mf_server_lint_option.
        * src/main.c (main): Check whether stderr is open as early as
        possible. Update call to mu_stdstream_setup (needs MU
        5e1d982ec). Set mf_server_lint_option.
        * src/srvcfg.c (srv_parse_opt): Make sure --syslog takes effect 
        at once.

2011-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor improvement.

        * lib/srvman.c (report_exit_status): Surround PIDs with square
        brackets to facilitate grepping in logfiles.

2011-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * lib/syslog_async.c (find_percent_m): Fix endless loop.

2011-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * etc/Makefile.am (install-data-local): Don't check for the 
        pre-6.0 mailfromd.rc

2011-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore last_poll_host.

        * mflib/callout.mf4 (callout_do): Handle INIT.
        * src/callout.c (callout_io): Pass hostname as argument to INIT.
        * src/savsrv.c (savsrv_smtp_io_callback): Don't ignore INIT.

2011-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix

        * mflib/portprobe.mf4 (portprobe): Allow for family
        specification in host argument.

2011-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement IPv6 support.

        * am/ipv6.m4: New file
        * configure.ac: Call MF_ENABLE_IPV6
        * gacopyz/gacopyz.c (parse_url,do_connect)
        (gacopyz_parse_connection): Handle IPv6 addresses.
        (shan_connect): Remove IPv6: prefix from addresses.
        * gacopyz/gacopyz.h (milter_sockaddr_t) [GACOPYZ_IPV6] <sin6>:
        New member.
        (gacopyz_srv_set_source): Alter signature.
        * gacopyz/server.c (gacopyz_srv) <source_addr>: Change type to 
        struct sockaddr. All uses updated.
        <source_addr_len>: New member.
        (gacopyz_srv_set_source): Change signature.
        (gacopyz_srv_destroy): Free source_addr.
        (srv_connect): Support IPv6

        * lib/srvman.c (srvman_url_to_sockaddr): Handle IPv6 addresses.
        * mflib/status.mf (FAMILY_INET6): New constant.
        * src/builtin/io.bi (open_parsed_inet_stream): Handle IPv6
        addresses.
        * src/builtin/vars.bi (set_milter_$1_address): Handle IPv6
        addresses.
        * src/engine.c (mlfi_connect): Handle IPv6 addresses.
        * src/callout.c (smtp_io_open): Handle IPv6 addresses.
        * src/mailfromd.h (MFAM_INET6): New constant.
        (source_address): Change type to struct mu_sockaddr.
        * src/srvcfg.c (source_address): Change type to struct
        mu_sockaddr.
        (mf_srvcfg_add): Don't abort if mfd_server_new returns NULL
        (mf_option_source_ip,option_source_ip): Remove.
        (set_source_ip): Use mu_sockaddr_from_node to parse the address.
        (cb_source_ip): Call set_source_ip.
        * src/srvcfg.h (source_address): Change type to struct
        mu_sockaddr.

2011-03-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.99.90

        Version number updated to avoid confusion with the 7.x branch

2011-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        syslog_async: add support for %m format specifier.

        * lib/syslog_async.c (find_percent_m): New static function.
        (vsyslog_async_logger): New static function, from renamed 
        vsyslog_async.
        (syslog_async, vsyslog_async): Rewrite as a wrapper around 
        vsyslog_async_logger.

2011-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * src/callout.c (callout_host): Reword a debugging message.

2011-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix

        * src/builtin/.gitignore: Add syslog.c

2011-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement modulo operator.

        * src/drivers.c (optimize_arith,code_type_bin): Implement modulo 
        operator.
        * src/gram.y: Implement modulo operator.
        * src/lex.l: Withdraw support for %ident.
        * src/mailfromd.h (bin_opcode) <bin_mod>: New constant.
        * src/opcodes (MOD): New opcode.
        * src/prog.c (instr_mod): New function.
        * doc/mailfromd.texi: Update.
        * NEWS: Update.

2011-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * mflib/syslog.mf: Rewrite facility constants in a traditional
        way, i.e. as (N<<3).

2011-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement bitwise shifts.

        * doc/mailfromd.texi: Document << and >>
        * src/drivers.c (optimize_arith,optimize_type_bin): Implement 
        bitwise operations.
        * src/gram.y: Implement bitwise << and >>.
        * src/lex.l: Likewise.
        * src/mailfromd.h (bin_opcode): New opcodes bin_shl and bin_shr.
        * src/opcodes (SHL, SHR): New opcodes.

2011-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix in syslog_async

        * lib/syslog_async.c (vsyslog_async): accept the facility level 
        ORed in the priority argument.

2011-03-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        New builtin function: syslog.

        * lib/libmf.h (logger) <log_text>: New member
        (logger_text): New proto.
        * lib/logger.c: Add static qualifiers where they belong
        (syslog_default_logtext,syslog_async_logtext): New static
        functions.
        (logger_text): New function.
        * mflib/mfh.awk: New file.
        * mflib/Makefile.am (noinst_HEADERS,BUILT_SOURCES): Add syslog.h
        (EXTRA_DIST): Add mfh.awk
        (.mf.h): Use mfh.awk to generate the goal.
        * mflib/.gitignore: Add syslog.h
        * src/builtin/syslog.bi: New file.
        * src/builtin/Makefile.am (BI_FILES): Add syslog.bi
        * NEWS: Update.
        * doc/functions.texi: Update.

2011-03-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use C-escape filter (MU b5c66e41) to format trace output.

        * src/main.c (mf_trace_stream): New static var.
        (open_trace_stream): New static function.
        (trace): Print to mf_trace_stream.

2011-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document enable-vrfy.


2011-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs.

        * NEWS: Update.
        * doc/mailfromd.texi: Remove the description of the standalone
        listen statement, Move descriptionis of --lock-retry-* options
        to mfdbtool.texi
        * doc/mfdbtool.texi: Describe --lock-retry-* options.
        * doc/Makefile.am (check-config): Ignore keywords not starting
        with [a-zA-Z_].

2011-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore lock-retry-count and lock-retry-timeout configuration
        statements

        * lib/mf-dbm.h (lock_retry_timeout_option): New extern.
        * lib/libmf.h (mf_option_time_t, config_cb_time_t): New protos.
        * lib/optcache.c (mf_option_time_t): New function.
        * lib/utils.c (config_cb_time_t): New function.
        * src/main.c (mf_cfg_param): Restore lock-retry-count and
        lock-retry-timeout statements.
        (cb_timeout): Remove.  Use config_cb_timeout instead
        * mfdbtool.c (options, parse_opt): Enable --lock-retry-count and
        --lock-retry-timeout options,
        (option_cache): Define lock-retry-count and lock-retry-timeout 
        caches.
        * TODO: Update

2011-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Provide a definition of timersub for platforms missing it

        * gacopyz/gacopyz_priv.h [!timersub]: Define timersub

2011-03-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        mtasim: minor improvement

        * mtasim/mtasim.c (start_mailfromd): Print mailfromd PID in
        verbose mode.

2011-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rethink the solution to mtasim interaction problem (see
        c0535e8e).

        * src/main.c (parse_opt) <OPTION_MTASIM>: Rollback c0535e8e.
        (mtasim_option): Move to srvcfg.c.
        * src/srvcfg.c (server_section_parser) <mu_cfg_section_end>: If 
        mtasim_option is set, ignore the server statements.

2011-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/builtin/debug.bi (callout_transcript): Fix return type.

2011-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement callout_transcript function to toggle SMTP transcript
        on and off.

        * src/builtin/debug.bi (callout_transcript): New function.
        * NEWS: Mention callout_transcript.
        * doc/functions.texi: Document callout_transcript.

2011-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve interaction with mtasim.

        Jan Rafaj reported that the use of mtasim -Xauto may result in 
        the subordinate mailfromd removing the UNIX communication
        sockets of the main running process.  This can happen if: (1)
        there is a mailfromd process running on the box where mtasim is
        run and
        (2) the user does not supply --no-site-config option to the
        subordinate.

        * src/main.c (parse_opt) <OPTION_MTASIM>: Inhibit loading of the
        default configuration files.

2011-03-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        docs: document mailfromd options

        * doc/Makefile.am (check-config): Fix the rule
        * doc/mailfromd.texi: Document mailfromd options.

        * etc/Makefile.am (.mf.lint): -I$(top_srcdir)/src is no longer
        needed (see 01ad06fc).
        * mflib/Makefile.am: Likewise.

2011-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rename .pm:server config section to .mfd:server.  Fix
        check-docs.


2011-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        New function header_rename_pattern

        * NEWS: Update.
        * mflib/header_rename.mf4: New function header_rename_pattern.
        * doc/functions.texi: Document changes to message_header_count. 
        Document header_rename_pattern.

2011-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve docs

        * NEWS: Update.
        * doc/functions.texi: Document new built-in and most library 
        functions.
        * doc/upgrade.texi: Update.

        * src/builtin/debug.bi (debug_level): Fix the use of modname.
        (debug_spec): Remove the minlevel parameter.
        * src/builtin/io.bi: Remove misleading comment.
        * src/main.c: Restore the --debug option.

2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.


2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs.

        * doc/mailfromd.texi: Document new pragmas (prereq and
        provide-callout)

2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        docs: improve check-docs, document mfdbtool.

        * doc/mfdbtool.texi: New file.
        * doc/calloutd.texi: New file.
        * doc/Makefile.am (mailfromd_TEXINFOS): Add new files.
        (check-options): depend on several check-*-options goals
        (check-mailfromd-options)
        (check-calloutd-options)
        (check-mfdbtool-options): New goals.
        (check-sub-config): Scan $(top_srcdir)/lib/dbcfg.c as well.
        * doc/check-docs.sh: Minor change
        * doc/functions.texi: Remove the discussion of DNS Cache
        Management.
        * doc/macros.texi (xopindex, opsummary): Take the program name
        as the 2nd argument. All uses changed.
        * doc/mailfromd.texi: Add documentation placeholder for
        calloutd. Add documentation of mfdbtool. Remove description of
        DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL and dns database.

2011-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve check-docs

        * doc/Makefile.am (check-pragmas): Implement the rule.
        * doc/check-docs.sh: Remove leading whitespace from joinable 
        files.

2011-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Ensure the same set of constants is used in the sources and in
        the documentation.

        * .gitignore: Add global.h and global.texi
        * global.awk: New file.
        * global.texi: New file.
        * Makefile.am (SUBDIRS): Begin with .
        (noinst_HEADERS): Add global.h
        (noinst_DATA): Add global.texi
        (BUILT_SOURCES): Add both.
        (EXTRA_DIST): Likewise. Add global.def and global.awk
        (.def.h): New rule
        (.def.texi): New rule
        * doc/values.texi: Remove.
        * doc/Makefile.am (mailfromd_TEXINFOS): Remove values.texi.
        (AM_MAKEINFOFLAGS): Add top_srcdir to include path.
        * doc/mailfromd.texi: Include global.texi instead of
        values.texi.
        * doc/functions.texi: Update.

        * src/builtin/dns.bi: Include global.h.  Use constants defined
        in it.
        * src/builtin/io.bi: Likewise.
        * src/builtin/mbox.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/prog.c: Likewise.
        * src/builtin/msg.h (NMBOXES, NMSGS): Remove definitions.

2011-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor documentation changes.

        * doc/Makefile.am (check-config, check-exceptions): Fix rules.
        * doc/mailfromd.texi: Document e_exists.
        * doc/values.texi (MIN_EXCEPTION, MAX_EXCEPTION): Remove.
        (E_EXCEPTIONS): New value.

2011-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement escape/unescape builtin functions and functions for
        email processing.

        * mflib/.gitignore: Add email.h
        * mflib/Makefile.am (noinst_HEADERS,BUILT_SOURCES): Add email.mf
        * mflib/email.mf: New file.
        * mflib/callout.mf4 (callout_do): Escape email.
        * src/builtin/email.bi (email_map): New function.
        * src/builtin/string.bi (escape, unescape): New functions.
        * doc/functions.texi: Document new functions.

2011-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        More bugfixes

        * src/main.c (main): Call mf_server_log_setup only for 
        mode==MAILFROMD_DAEMON.
        (parse_opt): Allocate strings appended to args->trace_modules.
        * src/prog.c (instr_xmemstk): Adjust stack before pushing to it.
        (dump_catch): Print exception names.

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.0.95

        * NEWS, configure.ac: Update.

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore (try,catch)/loop/(break,next) functionality.

        The commit bd4fb40f took care about breaks and nexts called from 
        tries/catches that appear within a loop, but in the meantime it 
        broke the functionality of breaks/nexts called within loops
        which are nested in a try or catch block.  This is fixed in this
        commit.

        * src/drivers.c (trycatch_stack_entry) <id>: New member.
        (trycatch_last_id): New function.
        (enter_trycatch): Initialize ent.id.
        (_code_trycatch_exit): Break the iteration if current entry id
        is less than the loop id.
        (code_trycatch_exit): Take block ID as argument.
        (enter_loop): Initialize trycatch_id.
        (code_type_next, code_type_break): Pass loop ID to
        code_trycatch_exit.

        * tests/trycatch13.at: New testcase.
        * tests/trycatch14.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add new testcases.
        * tests/testsuite.at: Include new testcases.

        * tests/miltermacros.at: Fix a typo.

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix built-in macro expansion in strings appearing within
        pragmas.

        * src/pragma.c (nextword): Advance *end past the final quote.
        * tests/expstr.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add expstr.at
        * tests/testsuite.at: Include expstr.at
        * tests/macros.at: Add keywords.

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Cleanup.

        * po/POTFILES.in: Remove appinit.c (See e473ab7d).
        * src/Makefile.am: Restore incdir, needed for AM_CPPFLAGS. Was 
        accidentally removed in 01ad06fca.
        * src/builtin/sa.bi (sa): Restore initialization of msize.
        Accidentally removed in bcd64af9.
        * src/main.c: Call mf_server_log_setup after compiling the
        sources, so that --lint spits out its diagnostics on stderr
        (initially placed here in e75c9a39).

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix deferred variable initialization.

        The bug was spotted by Brian Kroth.

        * src/gram.y (deferred_decl) <locus>: New member.
        (defer_initialize_variable): Use string_alloc instead of
        literal_lookup. Take additional argument (ptr to locus). All 
        uses updated.
        (apply_deferred_init): Pass a ptr to the actual locus to
        initialize_variable.
        * src/mailfromd.h (defer_initialize_variable): Change signature.
        * src/main.c (cb_set_variable): Deduce definition location from 
        mu_strerr.
        * THANKS: Update.
        * tests/setvar.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add setvar.at.
        * tests/testsuite.at: Include setvar.at.
        * tests/invcidr.at: Update experr.
        * tests/invcidr2.at: Likewise.

2011-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * src/lex.l (lex_new_source): Fail if the fail is not a regular
        one.

2011-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Sync with MU commit 4bcd5c9de0cb6ca85bcc3a35b1518739b939b009.

        * lib/appinit.c: Remove.
        * lib/Makefile.am (libmf_a_SOURCES): Remove appinit.c
        * lib/libmf.h (mu_app_rcfile, mfd_app_init): Remove.
        * src/calloutd.c (main): Use mu_app_init. Set mu_site_rcfile
        beforehand.
        * src/main.c (main): Likewise.
        * src/mfdbtool.c (main): Likewise.

2011-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Sync with MU commit ad938c5af.

        * lib/appinit.c (mfd_parse_config_files): Remove.
        (mfd_app_init): Use new API.

2011-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/main.c (cb_set_variable): Fix argument cast.

2011-03-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes


2011-03-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use `volatile' qualifier for variables that can change during
        dataseg expansion.

        * src/builtin/snarf.m4 (__mf_dataseg): New define.
        (MF_DSEXP, __MF_DSEXP_REQ)
        (__mf_define_fun, MF_DSEXP_SUPPRESS): New macros.
        (__mf_c_type): Define string arguments wiht __mf_dataseg
        qualifier.
        (MF_DEFUN): For functions returning STRING assume MF_DSEXP.
        (MF_ALLOC_HEAP,MF_ALLOC_HEAP_TEMP)
        (MF_COPY_STRING): Call __MF_DSEXP_REQ
        (END): Redefine __mf_dataseg to empty string.

        * src/builtin/db.bi (dbmap_lookup): Define within a 
        MF_DSEXP_SUPPRESS block.
        (dbmap): Mark as MF_DSEXP.
        * src/builtin/sa.bi (sa, clamav): Mark as MF_DSEXP.
        * src/builtin/spf.bi (update_spf_vars): Define within a 
        MF_DSEXP_SUPPRESS block.
        (spf_check_host, spf_test_record): Mark as MF_DSEXP.
        * src/builtin/string.bi (rindex): Mark as MF_DSEXP.
        * src/builtin/vars.bi (set_milter_$1_address): Define within a
        MF_DSEXP_SUPPRESS block.
        (set_milter_server_id): Likewise.

        * src/prog.c (get_string_arg): Use MFL_DATASEG qualifier for
        return pointer
        (get_pointer_arg): Likewise.
        (heap_obstack_grow, pushs): Use MFL_DATASEG qualifier for
        pointer arg.
        (instr_concat): Use MFL_DATASEG qualifiers for left and right
        declarations.
        * src/prog.h (MFL_DATASEG): New define.
        (get_pointer_arg, get_string_arg)
        (heap_obstack_grow, pushs): Change signature.

2011-03-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/prog.c (instr_backref): Reference matchstr only after 
        eventual dataseg expansion.
        (env_pop_auto): New function.
        (pushs): Protect source pointer from changing during dataseg
        expansion
        (env_final_gc): Likewise.
        (heap_obstack_grow): Likewise.

2011-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix the usage of `next' and `break' in try/catch blocks.

        * src/drivers.c (enter_trycatch, leave_trycatch)
        (code_trycatch_exit): New functions.
        (code_type_catch): Enclose traverse_tree in
        enter_trycatch/leave_trycatch.
        (code_type_try): Likewise.
        (code_type_next): Call code_trycatch_exit to make sure any outer
        tries/catches are exited correctly.
        (code_type_break): Likewise.

        * tests/trycatch05.at: New file.
        * tests/trycatch06.at: New file.
        * tests/trycatch07.at: New file.
        * tests/trycatch08.at: New file.
        * tests/trycatch09.at: New file.
        * tests/trycatch10.at: New file.
        * tests/trycatch11.at: New file.
        * tests/trycatch12.at: New file.
        * tests/Makefile.am (TESTSUITE_AT): Add trycatch05.at -
        trycatch12.at
        * tests/testsuite.at: Include trycatch05.at - trycatch12.at
        * tests/trycatch01.at: Update AT_KEYWORDS.
        * tests/trycatch02.at: Likewise.
        * tests/trycatch03.at: Likewise.
        * tests/trycatch04.at: Likewise.

        * doc/.gitignore: Update.
        * mflib/.gitignore: Update.
        * src/builtin/.gitignore: Update.

2011-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Move debugging API to a separate compilation unit.

        Rename wd built-in to _wd.

        * src/builtin/debug.bi: New file.
        * src/builtin/Makefile.am (BI_FILES): Add debug.bi
        * src/builtin/other.bi: Move debugging functions to debug.bi.
        * src/prog.c (env_register_read) <REG_REG>: Add a type cast.

2011-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        New debugging function: _reg().

        * mflib/_register.mf: New file.
        * mflib/.gitignore: Add _register.mf
        * mflib/Makefile.am (MF_FILES): Add _register.mf
        (noinst_HEADERS, BUILT_SOURCES): Add _register.h
        * src/builtin/other.bi (_reg): New function.
        * src/prog.c (env_register_read): New function.
        * src/prog.h (env_register_read): New proto.

2011-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix

        * src/drivers.c (print_type_try): Fix output indentation.

2011-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        New pragma: prereq.  New function: vercmp.

        * NEWS, configure.ac: Version 7.0.94
        * lib/vercmp.c: New file.
        * lib/Makefile.am (libmf_a_SOURCES): Add vercmp.c
        * lib/libmf.h (mf_vercmp): New proto.

        * src/builtin/Makefile.am (BI_FILES): Add prereq.bi.
        * src/builtin/.gitignore: Add prereq.c
        * src/prog.c (env_throw_0): Reword unknown exception
        diagnostics.

        * tests/vercmp.at: New file.
        * tests/vercmp01.at: New file.
        * tests/vercmp02.at: New file.
        * tests/Makefile.am (TESTSUITE_AT): Add vercmp.at, vercmp01.at 
        and vercmp02.at.
        * tests/testsuite.at: Include vercmp testcases.

        * mflib/status.mf: Require mailfromd version 7.0.94 or later.
        [OLD_EXCEPTION_CODES]: Remove.

        * po/POTFILES.in: Update.

2011-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Store exception names in the dataseg.

        * src/mf-status.c: Remove.
        * src/exclist.c: New file.
        * src/Makefile.am (mailfromd_SOURCES): Remove mf-status.c, add
        exclist.c.
        * src/gram.y (exdecl): Call define_exception.
        (dataseg_layout): Create table of exception names in dataseg.
        * src/mailfromd.h (define_constant): Change return value.
        (string_to_exception): Remove.
        (define_exception,enumerate_exceptions)
        (free_exceptions): New protos.
        * src/main.c (main): Call free_exceptions.
        * src/prog.c (exception_count): Move declaration to exclist.c
        (instr_throw): Add trace print.
        (dump_throw): Print exception number along with its symbolic
        value.
        (env_throw_0): Reword default message.
        * src/prog.h (EXTABIND): New macro.
        * src/symbols.c (define_constant): Return pointer to the
        allocated struct constant.
        * tests/eof.at: Reflect changes to env_throw_0.
        * tests/hdr-gete.at: Likewise.
        * mflib/mfex.awk: Simplify.

2011-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix src/.gitignore


2011-02-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document e_exists and dbinsert (see commit 185360ba).


2011-02-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        New built-in: body_has_nulls

        * src/builtin/body.bi (body_has_nulls): New function.
        * doc/functions.texi: Document body_has_nulls.

2011-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Revamp declaration of built-in exception codes.

        Exception codes are declared (via dclex) in mflib/status.mf. 
        The C code includes mflib/status.ex, which is generated from
        that file.

        * src/status.mfh: Move to mflib.
        * src/mf-status.mfi: Move to mflib/status.mfh
        * src/mf-status.mfi: Move to src/mf-status.c
        (std_status_tab): Include mflib/status.ex
        * src/mfstat.awk: Remove.
        * src/status.mfi: Remove.
        * src/Makefile.am: Reflect these changes.
        * src/mailfromd.h (mf_exception_code): Remove exception
        declarations, include mflib/status.ex instead.
        * src/prog.c (exception_count): Initialize to 0.
        (instr_restex): If count is 0, do nothing.
        (env_init): Copy exceptions only if exception_count is not 0.
        (env_throw_0): Remove extra \n from runtime error diagnostics.
        (create_environment): Allocate catch_ctx and defcatch_ctx only 
        if exception_count is not 0.

        * mflib/.gitignore: Add status.ex
        * mflib/Makefile.am (inc_DATA,noinst_HEADERS,BUILT_SOURCES): Add
        status.mfh
        (MF_FILES): Add status.mf
        (EXTRA_DIST): Add mfex.awk
        (SUFFIXES): Add .ex
        (.mf.ex): New rule.
        * mflib/mfex.awk: New file.

        * tests/Makefile.am (status.mf): Depend on
        $(top_srcdir)/mflib/status.mf
        * tests/eof.at: Reflect changes to "built-in" exceptions.
        * tests/hdr-gete.at: Likewise.
        * tests/trycatch02.at: Likewise.
        * tests/trycatch04.at: Likewise.

2011-02-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix the use of user-defined exceptions.

        * src/prog.c (instr_throw): Use exception_count instead of 
        mf_exception_count.

2011-02-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change


2011-02-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Synchronize MF_SIEVE_ defines in C with the corresponding
        constants in MFL.

        * Makefile.am (SUBDIRS): Place mflib before lib and src.
        * mflib/.gitignore: Add sieve.h
        * mflib/Makefile.am (noinst_HEADERS,BUILT_SOURCES): New
        variables.
        (.mf.h): New implicit rule.
        * mflib/sieve.mf: Fix comment.
        * po/POTFILES.in: Remove builtin/mudebug.bi.
        * src/builtin/Makefile.am (INCLUDES): Add $(top_srcdir)
        * src/builtin/sieve.bi: Include mflib/sieve.h. Remove MF_SIEVE_
        defines.

2011-02-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve the sieve built-in.

        * mflib/sieve.mf (MF_SIEVE_FILE,MF_SIEVE_TEXT): New constants.
        (MF_SIEVE_LOG,MF_SIEVE_DEBUG_TRACE)
        (MF_SIEVE_DEBUG_INSTR): Change numeric values.
        * src/builtin/other.bi (wd): New function.
        * src/builtin/sieve.bi (sieve): The script parameter specifies
        the Sieve program text (literal) if MF_SIEVE_TEXT flag is set. 
        Additional parameters file and line can be used in this case to 
        correct reported locations in the Sieve program. Fix memory leak
        (msg not being destroyed).

        * doc/functions.texi: Document changes to the sieve function.

2011-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * src/prog.c (eval_environ) <string>: Remove.  The pointer is 
        invalidated after dataseg expansion.  Keep offset of the last
        matched string in matchstr instead (data offset is invariant). 
        All callers updated.
        (expand_dataseg): Remove static qualifier.
        (instr_memstk, instr_xmemstk): Bugfix.  Both functions were not 
        expansion-safe.
        * src/prog.h (expand_dataseg): New proto.
        * src/builtin/other.bi (_expand_dataseg): New function.

2011-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * lib/mf-dbm.c (mf_dbm_insert): Add missing break.

        * src/bitmask.h (bitmask_merge): Update bm_nset.

        * src/prog.c (environ_locus): New struct.
        (eval_environ): Change type of locus to environ_locus.
        (ENV_LOC_FILE,ENV_LOC_LINE): New defines.
        (env_get_locus): Store locus in the struct locus supplied by the
        second argument. Register the file member as automatic variable, 
        lest it gets clobbered by stack expansions. All callers updated.
        (instr_push,instr_stkalloc,instr_regmatch_mx)
        (instr_next): Fix trace formats.
        * src/prog.h (runtime_warning,runtime_error)
        (prog_trace): Mark as printflike.
        (env_get_locus): Change signature.

        * src/builtin/header.bi (header_add,header_insert)
        (header_delete,header_replace): Update calls to env_get_locus.
        * src/builtin/progress.bi (progress): Likewise.
        * src/builtin/qrnt.bi (quarantine): Likewise.
        * src/builtin/rcpt.bi (rcpt_add,rcpt_delete): Likewise.

        * src/builtin/snarf.m4: Minor indentation change.

        * mflib/sieve.mf (MF_SIEVE_DEBUG_MAILUTILS)
        (MF_SIEVE_DEBUG_PROT): Remove.
        * src/builtin/sieve.bi: Likewise.
        * src/builtin/mudebug.bi: Remove.
        * src/builtin/Makefile.am (BI_FILES): Remove mudebug.bi
        * src/builtin/other.bi (debug): Set logstream locus information
        for better error diagnostics. Declare mailutils_set_debug_level
        as alias to debug.

2011-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement dbinsert built-in function.

        * src/builtin/db.bi (dbinsert): New function. Similar to dbput
        but allows better control over what to do if the key is already
        present in the database.
        * src/mailfromd.h (mfe_exists): New exception code.

2011-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update TODO.


2011-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Builtin functions obtain a reference to the capture stream, not
        the stream itself.

        * src/builtin/snarf.m4 (MF_CAPTURE): Require an argument.
        (__mf_defun): If MF_CAPTURE was called, declare an extra 
        mu_stream_t argument and initialize it to the capture stream 
        reference.
        (return): New macro.
        (MF_RETURN,MF_RETURN_STRING): Go to end label, instead of
        returning.
        (MF_THROW): Unref __MF_CAPTURE__, if defined.
        (END): Unref __MF_CAPTURE__, if defined. Declare end label. 
        Undefine __MF_ENDLAB__

        * src/mailfromd.h (env_get_stream): Change prototype.
        * src/prog.c (env_get_stream): Return error code. Return a
        reference to the capture stream in the memory location pointed
        to by the second argument.

        * src/builtin/body.bi (current_message): Fix MF_CAPTURE
        declaration.
        * src/builtin/curhdr.bi (current_header_count): Likewise.
        (current_header_nth_name,current_header_nth_value): Likewise.
        (current_header): Likewise.
        * src/builtin/sa.bi (sa, clamav): Likewise.
        * src/builtin/sieve.bi (sieve): Likewise.
        * src/builtin/getpw.bi (return_passwd): Don't use
        MF_RETURN_OBSTACK here.
        (getpwnam, getpwuid): Use it here instead.
        * src/builtin/io.bi (write): Fix debug format string.
        * src/builtin/mail.bi (build_mime): Fix memory leak (occurred on 
        error).
        (send_dsn): Likewise.

2011-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        gacopyz server: unescape % characters (complements e8f737fa).

        * gacopyz/gacopyz.h (gacopyz_srv_reply): Return int.
        (gacopyz_srv_reply_raw): New proto.
        * gacopyz/server.c (gacopyz_srv_reply): Unescape % characters. 
        Allocates returned string.
        (gacopyz_srv_reply_raw): New function (renamed from old
        gacopyz_srv_reply).
        * mtasim/mtasim.c: Use xstrdup.
        (smtp_ehlo, process_gacopyz_reply)
        (process_data_reply): Fix calls to gacopyz_srv_reply.

2011-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        lib: minor fix

        * lib/logger.c (mf_gacopyz_log_printer): Handle SMI_LOG_PROTO.

2011-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        gacopyz: minor fix.

        * gacopyz/context.c (format_message): Escape percent characters
        in the message string.

2011-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update copyright year.


2011-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        sa,clamav: bugfixes.

        * lib/server.c (mf_server_check_pidfile): Use mu_program_name.
        * src/builtin/sa.bi: Major cleanup.
        (set_xscript): Do not switch to MU_XSCRIPT_PAYLOAD at once.
        (spamd_send_stream): New function.
        (spamd_connect): Do not unreference transport streams.
        (open_connection): Use _aget to obtain path.
        (sa,clamav): Rewind message stream; use spamd_send_stream to 
        send it.
        * src/builtin/mail.bi (build_mime): Reposition the stream to its 
        beginning.

2010-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * lib/logger.c (syslog_async_open): Fix signature.
        * mflib/Makefile.am (.mf4.mf): Put $(AM_V_GEN) in front of the
        command.

2010-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Reflect recent changes in MU (mu_debug_handle_t/mu_debug_level_t
        types).


2010-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Raise version number and MU requirements. Rewrite transcript
        support in callout.c

        * configure.ac: Require MU 2.9.90 Set version number to 7.0.93 
        Remove dist-lzma
        (strtok_r): Remove unused declaration.
        (gnulib.modules) <strtok_r>: Remove.
        * src/callout.c: Rewrite transcript support using MU3 API.
        (transcript): Remove. All callers updated.
        (create_transcript_stream): New function.
        (smtp_io_open): Set transcript stream if smtp_transcript is set.

2010-12-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Switch to MU3 API.

        * lib/debug.c: Remove.
        * lib/debug.h: Remove.
        * lib/Makefile.am (noinst_HEADERS): Remove debug.h
        (libmf_a_SOURCES): Remove debug.c
        * lib/appinit.c: Use new mu_stream_* calls.

        * lib/libmf.h (config_array_to_argv,config_array_to_string):
        Change signatures.
        (config_cb_timeout): Likewise.
        (logger)<log_print>: Remove.
        <log_open>: Change signature.
        (logger_open): Change signature.
        (vlogmsg,logmsg): Rewrite as macros.
        * lib/logger.c: Rewrite logging support using MU3 streams.

        * lib/utils.c (config_array_to_argv)
        (config_array_to_string, config_cb_timeout): Rewrite.

        * lib/server.c (mf_server_start): Call mu_onexit_run.

        * lib/version.c (version_etc_copyright): Rename to avoid name 
        clash.

        * lib/dbcfg.c: Rewrite callbacks.  Use MU3 configuration
        framework.

        * lib/cache.c: Use mu_debug for debugging.
        * lib/db.c: Likewise.
        * lib/dns.c: Likewise.
        * lib/greylist.c: Likewise.
        * lib/mf-dbm.c: Likewise.
        * lib/rate.c: Likewise.
        * lib/srvman.c: Likewise.
        * lib/tbf_rate.c: Likewise.
        * src/builtin/snarf.m4: Likewise.
        * src/calloutd.c: Likewise.
        * src/engine.c: Likewise.
        * src/spf.c: Likewise.

        * src/Makefile.am (mfd-dbgmod.h): Offset the indices by the
        value of mfd_debug_handle.

        * src/builtin/body.bi (current_message): Use
        mu_stream_to_message.
        * src/builtin/curhdr.bi: Use MU3 API.
        * src/builtin/db.bi: Likewise.
        * src/builtin/io.bi: Likewise.
        * src/builtin/mail.bi: Likewise.
        * src/builtin/msg.bi: Likewise.
        * src/builtin/mudebug.bi: Likewise.
        * src/builtin/sieve.bi: Likewise.
        * src/lex.l: Likewise.
        * src/savsrv.c: Likewise.
        * src/srvcfg.c: Likewise.

        * src/builtin/other.bi (debug_level): Rewrite using
        mu_debug_category_level
        (debug_spec): Rewrite using mu_debug_format_spec.
        (debug): Rewrite using mu_debug_parse_spec.

        * src/callout.c (smtp_io_data) <send_off, recv_off>: Remove. All
        uses updated.
        (smtp_io_free, smtp_send, smtp_recvline)
        (smtp_io_close, callout_host, callout_mx)
        (libcallout_init): Use new stream and debugging API.

        * src/mailfromd.h (mfd_debug_handle): New extern.
        (add_legacy_milter_port): Change signature.
        * src/main.c (mf_strecho): New global.
        (mfd_gacopyz_log_printer): Remove.
        (read_domain_file): Change signature.
        (cb_milter_timeout, cb_timeout, cb_set_variable)
        (cb_include_path, cb_trace_program, cb_relayed_domain_file):
        Rewrite.
        (mfd_debug_handle): New variable.
        (open_strecho): New function.
        (main): Revise logging support initialization.
        * src/mfdbtool.c: Use new MU API.
        * src/pp.c: Likewise.
        * src/pragma.c: Likewise.

        * src/prog.c: Use new MU API.
        (instr_echo): Send output to mf_strecho.
        * src/prog.h (mf_strecho): New extern.

        * src/builtin/msg.h (mf_message) <mstr, bstr>: New members.
        * src/builtin/sa.bi: Rewrite using new stream functions.

        * pmult/.gitignore: Remove pdbg.h.
        * pmult/pdbg.hm4: Remove.
        * pmult/debugdef.m4: Remove.
        * pmult/Makefile.am (EXTRA_DIST): Remove pdbg.hm4 and
        debugdef.m4
        (pmult_SOURCES): Remove pdbg.h
        * pmult/pmult.c: Redo logging, debugging and configuration
        support.

        * tests/hdr-gete.at: Update.
        * tests/testsuite.at (AT_MTA_TEST): Filter out info prefix from
        the
        'echo' output.

2010-11-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * etc/Makefile.am: Install postfix-macros.sed to pkgdatadir.
        (install-data-local): Add missing $(DESTDIR)
        * src/builtin/sa.bi (sa): Check the result of the initial SPAMC
        command.
        * src/gram.y (register_macro): Set a comparator that ignores 
        enclosing '{ }'. Always enclose in curly braces macro names
        longer than 1 character.
        * tests/miltermacros.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add miltermacros.at.
        * tests/testsuite.at: Include miltermacros.at.

2010-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Be careful about undefined sun_path in struct sockaddr_un.

        * gacopyz/gacopyz.c (gacopyz_handle_connection): Log unnamed 
        socket as [unnamed].
        * src/builtin/vars.bi (set_milter_$1_address): Use empty string 
        if the socket is unnamed.

2010-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * lib/dns.c (_dnsbase_init): Rename to dnsbase_init, now extern.
        (all functions): Remove calls to _dnsbase_init.
        * lib/libmf.h (dnsbase_init): New proto.
        * src/calloutd.c (main): Call dnsbase_init.
        * src/savsrv.c (cmd_run): Bugfix.
        (callout_session_server): Bugfix.
        * src/main.c (main): Call dnsbase_init.

2010-08-31  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement header renaming functions.

        * mflib/header_rename.mf4: New file.
        * mflib/.gitignore: Add header_rename.mf and rateok.mf.
        * mflib/Makefile.am (MF_FILES): Add MF4_FILES (with suffix 
        fixup).

2010-08-31  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.0.92


2010-08-31  Sergey Poznyakoff  <gray@gnu.org.ua>

        Expand the functionality of the message_header_count() function.

        * src/builtin/msg.bi (message_header_count): Optional 2nd
        argument specifies the name of the header to count.

2010-08-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Two new MFL functions for reading message headers.

        * src/builtin/msg.bi (message_nth_header_name)
        (message_nth_header_value): New functions.

2010-08-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        callout: optionally use the VRFY command, if the remote party
        provides it.

        * src/callout.c (smtp_io_data) <nlines, esmtp_capa>: New
        members.
        (SMTP_PARSEHLO, CAPA_VRFY): New defines.
        (smtp_recv): Parse the EHLO reply, if SMTP_PARSEHLO flag is set. 
        Always clear it before returning.
        (esmtp_vrfy): New function.
        (callout_io): Call esmtp_vrfy if enable_vrfy is set.
        (smtp_io_init, smtp_send, smtp_recvline)
        (smtp_recv, callout_io): Prefix all diagnostics with the
        transcaction ID.
        * src/callout.h (enable_vrfy): New extern.
        * src/savsrv.c (enable_vrfy): New variable.
        * src/srvcfg.c (srv_cfg_param)<enable-vrfy>: New statement

2010-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Tiny fix.

        * src/builtin/header.bi (header_replace): Fix a typo.

2010-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.0.91


2010-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve the caching logic in verify().

        * src/savsrv.c (vrfy_state): Remove. All uses updated.
        (verify): Change the cache usage logic.
        (cmd_run): Take into account mf_timeout results.
        * lib/cache.c (EXPIRE_INTERVAL): Take into account mf_timeout
        results.

2010-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * src/callout.c (first_line_of): New static function.
        (smtp_last_sent): Use first_line_of.
        (smtp_last_received): Use first_line_of. Return the very first 
        line in case of multiline responses.

2010-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * mflib/rateok.mf: Rename to rateok.mf4. Use defined() to check
        whether mincnt is actually given. This fixes the bug reported by
        Rich Graves on August 24, 2010.

2010-08-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * lib/filenames.h (DEFAULT_PIDFILE): Remove.
        * lib/logger.c (loggertab): Add syslog_async_fdset method for 
        syslog:async.
        * src/Makefile.am (mfd-dbgmod.h): Kik off libcallout_a_SOURCES.
        * src/calloutd.c (_log_setup, mf_server_log_setup): Remove.
        (main): Call mf_srvcfg_log_setup. Update call to mf_srvcfg_init.
        * src/engine.c (setprocid): New static function.
        (mfd_callout_session_server): New function.
        * src/lex.l (lex_new_source_0): Bugfux.
        * src/mailfromd.h (mfd_callout_session_server): New proto.
        * src/main.c (mf_diag_syslog_printer, _log_setup)
        (mf_server_log_setup): Remove.
        (main): Call mf_srvcfg_log_setup. Update call to mf_srvcfg_init.
        * src/savsrv.c: Include signal.h
        (vrfy_state): New enum.
        (vrfy_queue)<state>: New member.
        (verify): Use rc and qp->state to decide whether to process the
        entry. This still needs some more work, though.
        (addq): Initialize qp->state.
        (cmd_run): Update qp->state.
        (callout_session_server): Ignore SIGPIPE and SIGALRM.
        * src/srvcfg.c (srv_options): Remove 's' option.
        (srv_parse_opt): Logger options update optcache.
        (setdefpidfilename): New static function.
        (mf_srvcfg_init): Take program invocation name as the first
        argument.  Construct pidfile name based on it, unless pidfile
        has already been initialized. Done update srvman_param.keepfds
        (see mf_srvcfg_log_setup). Initialize syslog_tag.
        (mf_diag_syslog_printer, mf_debug_syslog_printer): New
        functions.
        (mf_srvcfg_log_setup): New function.
        * src/srvcfg.h (mf_srvcfg_init): Change signature.

2010-08-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve default filter.

        * src/builtin/system.bi (access): New function.
        * src/status.mfi (R_OK, W_OK, X_OK, F_OK): New constants.
        * etc/Makefile.am: Minor change.
        * etc/mailfromd.mf (whitelist_db): New constant.
        (envfrom): Test for existence of the whitelist db before trying
        to access it.

2010-08-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Various changes to improve backward compatibility.

        * etc/mailfromd.mf: Clean up.
        * lib/server.c (mf_server_write_pidfile): New function.
        (mf_server_start): Call mf_server_log_setup prior to starting 
        listeners. Issue the start up information afterwards, to make 
        sure it is sent to the established logging channel. Call
        mf_server_write_pidfile instead of mu_daemon_create_pidfile, 
        since the latter fails if the pidfile name is not absolute. 
        Unlink the pidfile after mfd_srvman_run returns.
        * tests/testsuite.at (mailfromd_debug_header): Reflect the above
        change.
        * mflib/callout.mf4 (callout_open): If milter_client_address is 
        empty (a local socket), use the word "local" instead.

        * src/callout.c: Include srvcfg.h
        (transcript): Check the smtp_transcript flag.
        * src/callout.h: Remove externs declared in srvcfg.h
        * src/savsrv.c: Include srvcfg.h
        * src/srvcfg.c (transcript_option): Change to static.
        (smtp_transcript): New variable.
        (server_section_parser): Allow for empty label (means
        "default").
        (srv_cfg_param): Restore the `transcript' statement.
        (mf_srvcfg_flush): Set the value of smtp_transcript.
        * src/srvcfg.h (transcript_option): Remove extern.
        (smtp_transcript, io_timeout): New externs.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.

        * src/savsrv.c (mailfrom_address): Remove initializer.
        * src/callout.c (smtp_io_setup_callout): Allow for
        mailfrom==NULL.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix starting of the default callout server. Reflect the actual
        server URL in callout_server_url.

        * mflib/callout.mf4 (callout_server_url): New variable.
        (begin): Provide a default for callout_server_url.
        (__callout_open_default): Return the fd.
        (callout): Use return from __callout_open_default as the first
        argument to callout_do.
        * mflib/poll.mf (__make_extra_arg): New static function.
        (_pollhost, _pollmx, stdpoll, strictpoll): Use return from
        __callout_open_default as the first argument to callout_do. 
        Construct the rest of arguments using __make_extra_arg.
        * src/builtin/callout.bi (callout_server_url): Remove.
        (default_callout_server_url): New function.
        (MF_INIT): Remove initialization of callout_server_url.
        * src/mailfromd.h (default_callout_url): Rename to 
        callout_server_url.
        * src/main.c (default_callout_url): Rename to 
        callout_server_url.
        (provide_default_callout_server): Rewrite the condition. Don't
        try to reset the callout_server_url MFL variable: it is useless
        after compilation is finished.
        (mf_server_function): Fix the use of mu_list_locate.
        (main): Fix a typo in the server section label.
        * src/srvcfg.c (server_section_parser): Move the call to 
        mf_server_function to the mu_cfg_section_end branch.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Complement the bugfix from 011f85d4

        * src/mailfromd.h (SYM_PASSTOGGLE): New bit.
        * src/gram.y (_ds_variable_count_fun)
        (_ds_variable_fill_fun, _ds_reloc_fun): Use SYM_PASSTOGGLE bit
        to avoid processing the same variable several times.
        (dataseg_layout): Fix memory allocation.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Introduce callout session ID.

        * lib/srvman.c (mfd_srvman_open): Print error message if no 
        servers are configured.
        * mflib/Makefile.am (.mf4.mf): Call m4 -s.
        * mflib/callout.mf4 (callout_open): Set session ID.
        * src/callout.c (smtp_io_setup_callout): Replace empty mailfrom
        address with <>.
        (smtp_io_id): New function.
        * src/callout.h (smtp_io_id): New proto.
        * src/savsrv.c (session_id): New variable.
        (defproctitle): New function.
        (vrfy_free): Consistently set proctitle to reflect the current
        state.
        (addq): Save session ID in the smtp io structure.
        (cmd_sid): New function.
        (callout_command_tab)<SID>: New command.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * src/builtin/macro.bi (miltermacros): Fix minimal number of 
        arguments.

2010-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Re-implement the `listens' function in mflib.

        * mflib/portprobe.mf4: New implementation of the `listens'
        function.
        * mflib/Makefile.am (MF4_FILES): New variable.
        (MAINTAINERCLEANFILES): Add mf files produced from MF4_FILES.
        (.mf4.mf): Define MF_AUTOHEADER to add a warning at the top of 
        the generated files.
        * mflib/pp-setup: Issue an "automatically generated file"
        warning if MF_AUTOHEADER is defined.
        * mflib/.gitignore: Add portprobe.mf
        * src/builtin/dns.bi: Include srvcfg.h
        (listens_on, listens): Remove.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore some cfg statements for backward compatibility.

        * src/srvcfg.h: Add copyleft header.
        (DEFAULT_PIDFILE): Move to lib/filenames.h.
        (mf_srvcfg): New struct.
        (mf_server_function): New proto.
        (parse_milter_url): New proto.
        * lib/filenames.h: Add copyleft header.
        (DEFAULT_PIDFILE): New define.

        * src/gram.y: Use mf_list_compare_string comparator.
        (initialize_variable): Avoid coredump if locus==NULL.
        * mailfromd.h (default_callout_url): New extern.
        (compare_string): Remove proto.
        * src/main.c (default_callout_url): New function.
        (compare_string): Remove function. All callers use 
        mf_list_compare_string instead.
        (mf_cfg_param): Remove ehlo-domain and mail-from-address 
        statements (duplicated in srvcfg.c) Restore the callout-url
        statement.
        (mf_server_function): Change signature. Check for "option
        default" for callout servers.
        (main): Move call to mf_srvcfg_flush several lines up, before
        processing the filter script.
        * src/srvcfg.c (parse_milter_url): Remove static qualifier.
        (mf_srvcfg_add, server_section_parser): Use the new calling
        scheme of mf_server_function.
        (server_config_stmt): Remove struct.
        (server_config_stmt):Change type struct mf_srvcfg.
        (server_section_param) <option>: New statement.
        <default>: Restore statement.
        * src/calloutd.c (mf_server_function): Change signature.

        * lib/libmf.h (mf_list_compare_string): New function.
        * lib/utils.c: Likewise.
        * mflib/callout.mf4 (ehlo_domain, mailfrom_address): Comment
        out. See callout.bi.
        (callout_open): Comment out sending the SET commands.
        * mflib/spf.mf: Remove dependency on phased-out mydomain.mf.
        (check_host): Revert to using ehlo_domain.
        * src/builtin/callout.bi (ehlo_domain, mailfrom_address): Define
        here
        (again).
        (MF_INIT): Initialize callout_server_url, ehlo_domain and
        mailfrom_address.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore the io-timeout configuration statement.

        * src/srvcfg.c (srv_cfg_param): Restore the io-timeout
        statement.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * pmult/pmult.c (stderr_closed_p): Remove a leftover
        redefinition.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * mflib/mydomain.mf: Remove
        * mflib/Makefile.am: Remove mydomain.mf
        * mflib/poll.mf: Add copyleft header.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix namespace (mu_db -> mf_db)


2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix namespace (pm -> mf)


2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix debugging in calloutd.

        * src/dbgmod.awk: Use optional `offset' variable.
        * src/main.c (main): Call libcallout_init.
        * src/calloutd.c: Likewise.
        * lib/db.c (db_format_install): Register format (not database
        file) name.
        * lib/debug.c (debug_next_handle): New function.
        (debug_init): Register "all" only once.
        * lib/debug.h (debug_next_handle): New proto.
        * src/Makefile.am (callout-dbgmod.h): Offset handles by 
        callout_debug_handle.
        * src/callout.c (libcallout_init): New function.
        * src/callout.h (callout_debug_handle): New extern.
        (libcallout_init): New proto.

        * etc/mailfromd.mf: Minor change.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rename mfd -> src


2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes

        * mfd/engine.c (mlfi_negotiate): Fix improper use of the debug
        macro.
        * mfd/gram.y: Remove prototypes of non-existing functions.
        * mfd/lex.l: Remove MF_SOURCE_NAME leftover.
        * mfd/mailfromd.h (tie_in_onblock): Restore prototype.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore temporarly removed features.

        * mfd/main.c (main): Restore the check for non-absolute script
        file name.

        * mfd/srvcfg.c: Restore the --source-ip (-S) option and 
        source-ip configuration statement.
        * tests/testsuite.at (mailfromd_script_warning): New define.
        (AT_MTA_TEST_X, AT_MTA_TEST_SCRIPT,
        (AT_MTA_TEST_FILTER_SCRIPT): Redefine mailfromd_debug_header to 
        account for the non-absolute script file name warning.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Silently ignore the --remove (-r) option.

        * mfd/srvcfg.c: Silently ignore the --remove (-r) option.

2010-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restore the `on' construct.

        * etc/mailfromd.mf: Require poll and callout.
        * lib/namefixup.c (pm_file_name_ptr_fixup): Bugfix.
        * mfd/gram.y: Restore the `on poll' construct.
        * mfd/lex.l: Likewise.
        * mflib/callout.mf4 (ehlo_domain): Remove static qualifier.
        * po/POTFILES.in: Update.
        * tests/etc/Makefile.am (RCFILES): Add vmod1.mf and vmod2.mf.
        * tests/etc/poll-1.rc: Require poll.
        * tests/etc/poll.rc: Likewise.
        * tests/poll.at: Rewrite using AT_MTA_TEST_FILTER.
        * tests/poll01.at: Likewise.
        * tests/poll02.at: Likewise.
        * tests/poll03.at: Likewise.
        * tests/poll04.at: Require poll.

2010-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement default callout server. Fix the handling of not
        imported variables in submodules.

        * mfd/calloutd.c: New file.
        * mfd/builtin/callout.bi: New file.
        * mfd/builtin/.gitignore: Add callout.c
        * mfd/builtin/Makefile.am (BI_FILES): Add callout.bi.
        * builtin/builtin.def (provide_callout): New extern.

        * mfd/Makefile.am (noinst_LIBRARIES): New library libcallout.a.
        (mailfromd_SOURCES): Remove srvcfg.c
        (mailfromd_LDADD, calloutd_LDADD): Add libcallout.a.
        (calloutd_SOURCES): Move all sources to libcallout.a. Add
        calloutd.c
        (LDADD): Remove.
        (mfd-dbgmod.h): Obtain symbols from libcallout_a_SOURCES as
        well.
        (callout-dbgmod.h): Obtain symbols from libcallout_a_SOURCES.

        * lib/filenames.h (DEFAULT_CALLOUT_SOCKET): New define.
        * lib/libmf.h (stderr_closed_p): New proto.
        * lib/utils.c (stderr_closed_p): New function.

        * mfd/callout.c: Rearrange includes.
        * mfd/callout.h: Rearrange includes.
        (ehlo_domain, mailfrom_address): New externs.
        (callout_session_server): New extern.
        * mfd/savsrv.c: Rearrange includes.
        (main, etc.): Remove.
        * mfd/srvcfg.c (set_port): Fix 1st argument to pm_srvcfg_add.
        (srv_cfg_param): New keywords: database and mail-from-address
        (pm_srvcfg_flush): Initialize ehlo_domain and timeouts.

        * mfd/main.c: Rearrange includes.
        (pm_server_function): Use key as a selector value.
        (main): Start default milter and/or callout servers, if
        necessary.

        * mfd/symbols.c (import_builtin_variables): Minor fix.
        (module_head, module_tail): New statics.
        (module_register, module_symtab_enumerate): New functions.
        (module_init): Register the module.

        * mfd/mailfromd.h (SYM_INITIALIZED): New flag.
        (module_symtab_enumerate): New proto.
        * mfd/gram.y (initialize_variable): Set SYM_INITIALIZED bit.
        (dataseg_layout): Use module_symtab_enumerate instead of 
        symtab_enumerate.

        * mflib/callout.mf: Rename to mflib/callout.mf4
        * mflib/Makefile.am (EXTRA_DIST): Add callout.mf4
        * mflib/.gitignore: Add callout.mf.
        * mflib/poll.mf: Rewrite using the callout function.

        New testcase.

        * tests/etc/vmod1.mf: New file.
        * tests/etc/vmod2.mf: New file.
        * tests/module07.at: New testcase.
        * tests/Makefile.am: Add module07.at
        * tests/testsuite.at: Add module07.at
        (MAILFROMD_LOGOPTS): New define
        (MF_CHECK_PROG, MF_CHECK_TEXT, MF_RUN_TEXT)
        (AT_MTA_TEST_X, AT_MTA_TEST): Add MAILFROMD_LOGOPTS to the
        mailfromd command line.

        Bugfix:

        * mfd/builtin/io.bi (write, read, getdelim)
        (getline, fd_set_delimiter, fd_delimiter): Fix assertions.
        * mfd/builtin/snarf.m4 (MF_PRAGMA): Replace '-' with '_' in the
        name of the generated hander.

2010-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve debugging in calloutd.

        * lib/debug.h (debug_vlog): New proto.
        * lib/logger.c (debug_vlog): New function.
        * mfd/savsrv.c (writeout): New function. Use it instead of 
        fprintf to send out server replies.

2010-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add pmtool.c


2010-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Provide a default milter listener.

        * mfd/main.c (main): start a default listener if no servers have
        been configured.
        * mfd/srvcfg.c (pm_srvcfg_add): New function.
        (set_port): Rewrite using pm_srvcfg_add.
        * mfd/srvcfg.h (pm_srvcfg_add): New proto.

2010-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix testsuite (except for poll tests).

        * tests/testsuite.at (mailfromd_debug_header)
        (mailfromd_debug_footer): New defines.
        (__MTA_TEST): New macro.
        (AT_MTA_TEST): Rewrite via __MTA_TEST.

        * tests/curmsg.at: Remove mailfromd debugging output from stderr
        patterns. It is added automatically by AT_MTA_TEST.
        * tests/hdr-all.at: Likewise.
        * tests/hdr-cap.at: Likewise.
        * tests/hdr-count.at: Likewise.
        * tests/hdr-get.at: Likewise.
        * tests/hdr-gete.at: Likewise.
        * tests/hdr-getn.at: Likewise.
        * tests/hdr-itr.at: Likewise.
        * tests/hdr-mul.at: Likewise.
        * tests/rset.at: Likewise.
        * tests/greylist-ct.at: Call mailfromd_stop if any subtest
        fails.

2010-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fixup database names in reference to the state dir.

        * lib/Makefile.am (libmf_a_SOURCES): Add namefixup.c
        * lib/db.c (db_format_install): Register database name for
        fixup.
        * lib/libmf.h: Uncover namefixup prototypes.
        * lib/namefixup.c (head, tail): Statics.
        * lib/optcache.c: Likewise.
        * mfd/main.c: Fixup names.

2010-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add a tool for database management.

        * lib/pmdb.h (ignore_failed_reads_option, time_format_string):
        New externs.
        * mfd/Makefile.am (bin_PROGRAMS): New program pmtool.
        * mfd/gram.y (convert_rate): Remove.
        * mfd/srvcfg.c: Include sysexits. Handle "port" option cache.
        * mfd/.gitignore: Add pmtool.

2010-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * lib/optcache.c (find_option, pm_optcache_flush): Bugfix
        (ouch!)

2010-08-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Change callout protocol.

        * mfd/builtin/vars.bi (ehlo_domain, mailfrom_address): Remove
        variables.
        (builtin_post_setup): Remove function.
        * mfd/callout.c (smtp_io_set_timeouts): New function.
        * mfd/callout.h (smtp_io_set_timeouts): New proto.
        * mfd/gram.y: Remove call to builtin_post_setup.
        * mfd/mailfromd.h (builtin_post_setup): Remove proto.
        * mfd/main.c (parse_opt): Allocate string before adding it to
        trace_modules.
        * mfd/savsrv.c (ehlo_domain, mailfrom_address): New variables.
        (callout_mode): New enum.
        (vrfy_queue)<mode>: New member.
        (verify): 2nd arg tells which timeouts to use and whether to 
        translate mf_timeout to mf_not_found. All callers updated.
        (addq): Use new protocol.
        (cmd_vrfy): Do not free timed out entries.
        (callout_command_tab): Alter protocol.
        (callout_cfg_param): New keywords ehlo-domain and
        mail-from-address.
        (init_domain): New function.
        (main): Call init_domain.

        * lib/cache.c (tempfail_expire_interval): New variable.
        (EXPIRE_INTERVAL): Take into account mf_temp_failure.

        * mflib/callout.mf, mflib/mydomain.mf, mflib/poll.mf: New files.
        * mflib/Makefile.am (MF_FILES): Add callout.mf, mydomain.mf and
        poll.mf
        * mflib/spf.mf: Use my_domain instead of the removed
        ehlo_domain.

2010-08-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Move callout to a separate server


2010-07-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Move srvman and logging to lib.

        * mfd/srvman.c, mfd/srvman.h: Move to lib, with edits.
        * lib/Makefile.am: Update.
        * mfd/Makefile.am: Update.

        * lib/logger.c: New file.
        * lib/debug.c (source_info_option): New global.
        * lib/debug.h: Likewise.
        * lib/libmf.h (logger): New struct.
        (logger_select, logger_open)
        (logger_close, logger_fdset)
        (logger_flags, vlogmsg, logmsg): New prototypes.

        * mfd/builtin/io.bi (stderr_to_log): Use logger_fdset.
        * mfd/mailfromd.h (source_info_option): Remove extern.
        (logmsg, vlogmsg): Remove protos.
        (log_to_stderr, use_syslog_async): Remove extern.
        * mfd/main.c (force_remove): Initialize to 1.
        (source_info_option): Remove.
        (log_to_stderr, use_syslog_async): Remove.
        (syslog_printer, vlogmsg, logmsg)
        (vformat_logmsg, format_logmsg)
        (format_log_si, debug_locus, debug_log)
        (mflog_fd): Remove.
        (_log_setup): Rewrite.
        (set_srvman_param): New function.
        (main): Call srvman_init and set_srvman_param.
        (log_stream): New variable.
        (option_cache): Cache logger.
        (OPTION_LOGGER): New constant.
        (OPTION_NO_SYSLOG_ASYNC, OPTION_SYSLOG_ASYNC): Remove.
        (options): Remove --syslog-async, --no-syslog-async. New option
        --logger.
        (arguments) <syslog_async>: Remove. All uses updated.
        (parse_opt): Set log_stream instead of the removed
        log_to_stderr.
        (mf_cfg_param)<syslog-async>: Remove.
        <logger>: New statement.
        (_log_setup): Change signature. All callers updated.
        (mflog_close): Remove function.
        (main): Do second log setup after calling process_options, so
        that the "logger" statement and "--logger" option work 
        correctly. A side effect is that syntax errors are reported on
        stderr even when started in daemon mode.
        * mfd/pp.c (pp_extrn_start): Rewrite stderr redirection.
        * tests/numrcpt.at: Remove left-over % prefix.
        * mfd/builtin/io.bi (stderr_to_log): Use logger_open.
        * mfd/engine.c (mailfromd_daemon): Use logger_close.

2010-07-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * mfd/srvman.c (mfd_srvman_run): Check if stop signal arrived 
        right before select. This fixes sporadically reoccurring error 
        in greylist*.at.

2010-07-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Redo debugging support in the library.

        * mfd/debug.c: Moved to lib/debug.c.
        * mfd/debug.hin: Renamed to lib/debug.h. Removed calls to m4
        macros.
        (__debug, debug): New macros.
        (debug_locus): New proto.
        * mfd/debugdef.m4: Remove.
        * mfd/modlist.cin: Remove.
        * lib/Makefile.am: Update.
        * lib/libmf.h (TYPE_SIGNED, INT_STRLEN_BOUND)
        (INT_BUFSIZE_BOUND, NUMERIC_BUFSIZE_BOUND): New defines (from
        mailfromd.h)
        (argp): Forward declaration of the struct.
        * mfd/.gitignore: Update.
        * mfd/Makefile.am (mailfromd_SOURCES): Remove debug.c and 
        modlist.c.
        (noinst_HEADERS): Remove debug.h, add mfd-dbgmod.h.
        (EXTRA_DIST): Remove debug.hin, debugdef.m4, modlist.cin and
        module.list. Add dbgmod.awk.
        (BUILT_SOURCES): Likewise.
        (SUFFIXES): Remove .hin
        (mfd-dbgmod.h): New goal.
        (module.list, debug.h, modlist.c): Remove goals.
        (.cin.c, .hin.h): Remove rules.
        * mfd/dbgmod.awk: New file.

        * mfd/builtin/snarf.m4: Change default divertion to #2.
        (MF_INIT): Undivert everything here.
        (MF_DEBUG): New macro.

        * mfd/builtin/db.bi: Use MF_DEBUG instead of debug.
        * mfd/builtin/io.bi: Likewise.
        * mfd/builtin/mbox.bi: Likewise.
        * mfd/builtin/other.bi: Likewise.
        * mfd/builtin/sa.bi: Likewise.

        * mfd/mailfromd.h (getmaxfd): Remove (already defined in
        libmf.h) Include mfd-dbgmod.h
        * mfd/main.c (vformat_logmsg, format_logmsg)
        (format_log_si): New statics.
        (debug_locus): New function.
        (debug_log): Rewrite.
        (modnames): New variable.
        (main): Call debug_init.

        * mfd/*.c: Remove definitions of MF_SOURCE_NAME. Use debug()
        macro uniformly.

        * po/POTFILES.in: Update.

2010-07-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve MFL getline interface.

        * mfd/builtin/io.bi (io_stream)<delim>: New member.
        (close_stream): Free delim.
        (read_stream_delim): Take delim as char*.
        (open): Initialize delim.
        (getdelim): Optimize.
        (getline):  Use ioptr->delim, fall back to "\n", if not set.
        (fd_set_delimiter, fd_delimiter): New functions.

2010-07-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Change callout server protocol (part I).

        * mfd/appinit.c: Moved to ../lib
        * mfd/Makefile.am, lib/Makefile.am: Update accordingly.
        * lib/libmf.h (mu_app_rcfile): New extern.
        (mfd_app_init): New proto.

        * mfd/savsrv.c (callout_command)<argc>: Remove.
        <argmin,argmax>: New members.
        (vrfy_queue) <serial, result, file>: New members.
        (serial): New static.
        (vrfy_free, vrfy_del): New functions.
        (verify): Take one argument. Show request serial numbers in
        proctitle formats.
        (run_queue): Rewrite.
        (savsrv_smtp_io_callback): New function.
        (addq): Register i/o callback function.
        (cmd_vrfy): Print serial number in OK response.
        (cmd_run): Print results in OK response.
        (cmd_drop): New function.
        (callout_command_tab): Update.
        (callout_session_server): Check argmin and argmax.

2010-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * mfd/engine.c (mlfi_negotiate): issue a debugging diagnostics 
        when automatically registering the "i" macro.
        (milter_enable_state): Update first_used_state only if state is
        one of the actual SMTP states (excluding begin and end).

2010-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 7.0

        * NEWS, configure.ac: Update
        * doc/upgrade.texi: Update

2010-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * mfd/engine.c (check_pidfile): Use `name' argument, not
        `pidfile' global.

2010-08-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes. Improve callout sequence.

        * etc/mailfromd.mf (begin): Unconditionally initialize 
        ehlo_domain. Provide a comment explaining this.
        * mfd/builtin/vars.bi: Set ehlo_domain to the value of the
        domain name, instead of the host name.
        * mfd/callout.c (callout_io): Try EHLO first and fall back to
        HELO if it fails, as requested by RFC 2821, section 3.2 "Client
        Initiation".

2010-08-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * mflib/sa.mf (sa_format_report_header): Initialize ret.

2010-08-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Register the "i" macro for use in the lowest SMTP state declared
        in the program.

        * mfd/engine.c (first_used_state): New variable.
        (mlfi_negotiate): If first_used_state is set, register "i" macro
        for it.
        (milter_enable_state): Set first_used_state.
        * mfd/gram.y (register_macro): Remove static qualifier.

        * mfd/builtin/macro.bi (miltermacros): New pragma.

        * mfd/lex.l (paren_follows): Remove tie-in variable.
        * mfd/mailfromd.h (register_macro): New proto.
        (paren_follows): Remove extern.

        * NEWS: Update.
        * doc/mailfromd.texi: Document #pragma miltermacros.
        * doc/functions.texi: Likewise.

2010-08-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Register the "i" macro for use in the lowest SMTP state declared
        in the program.

        * mfd/engine.c (first_used_state): New variable.
        (mlfi_negotiate): If first_used_state is set, register "i" macro
        for it.
        (milter_enable_state): Set first_used_state.
        * mfd/gram.y (register_macro): Remove static qualifier.

        * mfd/builtin/macro.bi (mta_state_macros): New pragma.

        * mfd/lex.l (paren_follows): Remove tie-in variable.
        * mfd/mailfromd.h (register_macro): New proto.
        (paren_follows): Remove extern.

2010-08-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * mfd/builtin/db.bi: Remove extra whitespace.

2010-08-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix docs

        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.

2010-07-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update the docs.


2010-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>

        Discern between unset and zero module debugging levels.

        * mfd/builtin/other.bi (debug_spec): Additional 3rd argument.
        * mfd/debug.c (module_level) <isset>: New member.
        (debug_level_p): Check module level only if it is set.
        (debug_enable_module): Set isset to 1.
        (debug_disable_module): New function.
        (parse_spec): Skip initial whitespace.  Handle !module construct
        (meaning to unset debugging for module).
        (debug_spec_string): New argument showunset.  Print unset 
        modules explicitly (discern between !module and module=0). Allow
        for leading whitespace in specs.
        * mfd/debug.hin (debug_spec_string): Change signature.

        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.

2010-07-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update the docs.

        * doc/mailfromd.texi: Update

2010-07-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Suppress cc warnings.

        * gacopyz/server.c (gacopyz_srv_eoh): Remove unused variable.
        * mfd/dns.c (getmx): Likewise.
        * mfd/lex.l: Set nounput option.

2010-07-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 6.0.94

        * NEWS, configure.ac: Update version number.

2010-07-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs; other minor changes.

        * etc/postfix-macros.sed: New file.
        * etc/Makefile.am (pkglibexec_DATA): Add postfix-macros.sed.

        * lib/version.c (version_etc_copyright): Update copyright years.
        * mflib/spf.mf (__spf_msgid): New static.  Use it instead of 
        referring to $i, which may be not defined.

        * doc/mailfromd.texi: Update.
        * doc/pmult.texi: Update.

2010-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.


2010-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * mfd/builtin/.gitignore: Add mmq.c

2010-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve DNS interface. Number of MXs used in various operations
        is configurable.

        * mfd/dnsbase.c (_getmx): Change prototype. Use struct mxbuf,
        (dns_get_mx_records): Likewise.
        (dns_freemx): Remove.
        (mxbuf_init, mxbuf_free): New functions.
        * mfd/dns.h (mxbuf): New struct.
        (mxbuf_t): Remove typedef.
        (mxbuf_init, mxbuf_free): New functions.
        (dns_get_mx_records): Change proto.
        (dns_freemx): Remove proto.
        * mfd/dnscache.c (parse_value, dns_cache_get): Change signature.
        All callers updated.
        * mfd/mailfromd.h (getmx, getmxip): Change signature.
        (max_callout_mx, max_match_mx): New externs.
        (dns_cache_get): Change signature.
        * mfd/main.c (max_callout_mx, max_match_mx): New globals.
        (mf_cfg_param): New statements "max-callout-mx" and
        "max-match-mx".
        * mfd/callout.c (callout_mx): Use new mxbuf interface.
        * mfd/dns.c (getmx): Change signature. Use new mxbuf interface.
        (getmxip): Likewise.
        * mfd/prog.c (mx_match): Use new mxbuf interface. Limit number 
        of MXs by max_match_mx.
        * mfd/spf.c (mech_mx): Use new mxbuf interface.

        * mfd/builtin/dns.bi (dns_cfg_param): New statement
        "max-dns-reply-mx".
        (primitive_hasmx,getmx)
        (primitive_ismx): Rewrite to use new mxbuf interface.

        * doc/values.texi (MAX_DNS_MX, MAXMXCOUNT): New values.
        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.
        * doc/pmult.texi: Update.
        * doc/values.texi (MAX_DNS_MX, MAXMXCOUNT): New values.

2010-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Remove hardcoded limits on the number of A and PTR records in
        DNS replies.

        * mfd/main.c (mf_runtime_param_finish): Fix.
        * doc/functions.texi: Document changes to DNS functions.
        * doc/mailfromd.texi (conf-runtime): Document max-dns-reply-a 
        and max-dns-reply-ptr.
        * doc/values.texi (MAX_DNS_A, MAX_DNS_PTR): New values.

        * mfd/builtin/dns.bi (dns_cfg_param): Define new configuration 
        statements in runtime block: max-dns-reply-a, max-dns-reply-ptr.
        (dns_getaddr, dns_getname): Do not use hardcoded limits.
        (MF_INIT): Register new configuration statements.

2010-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Make runtime constants in builtin/*.bi sources configurable.

        * mfd/mailfromd.h (mf_add_runtime_params): New proto.
        * mfd/main.c (mf_cfg_param)<runtime>: New entry.
        (mf_add_runtime_params,mf_runtime_param_finish): New functions.
        (main): Call mf_runtime_param_finish.

        * mfd/builtin/io.bi (nstreams): New static, used instead of 
        NSTREAMS macro.
        (io_cfg_param, MF_INIT): Declare a configuration statement to
        confifure nstreams.
        * mfd/builtin/mbox.bi (nmboxes): New static, used instead of 
        NMBOXES macro.
        (mbox_cfg_param, MF_INIT): Declare a configuration statement to
        confifure nmboxes.
        * mfd/builtin/msg.bi (nmsgs): New static, used instead of NMSGS
        macro.
        (msg_cfg_param, MF_INIT): Declare a configuration statement to
        confifure nmsgs.

        * doc/Makefile.am (check-runtime-config): New rule.
        (all-check-docs): Depend on check-runtime-config.
        (check-sub-config): Ignore the "runtime" section.

        * doc/functions.texi: Document the runtime limits.
        * doc/mailfromd.texi (conf-runtime): New node.
        * doc/values.texi (NSTREAMS, NMBOXES, NMSGS): New values.

        * mfd/msg.h: Moved to builtin.
        * mfd/Makefile.am (noinst_HEADERS): Remove msg.h
        * mfd/builtin/Makefile.am (noinst_HEADERS): Add msg.h

2010-07-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs.


2010-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Documentation: describe the changes since the last release and
        the upgrade procedure.


2010-07-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes to the docs.


2010-07-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Write more docs.

        * doc/deprecate.texi: Remove.
        * doc/pragma-database.texi: Remove.
        * doc/pragma-option.texi: Remove.
        * doc/Makefile.am (mailfromd_TEXINFOS): Remove the above.
        (check-pragmas): Remove the rule, but leave a placeholder for a
        while.
        (check-sub-config): Fix the rule to allow for dashes in keyword 
        names.
        * doc/functions.texi: Fix a typo.
        * doc/macros.texi (histref): New macro.
        * doc/mailfromd.texi: Remove obsolete sections. Describe callout
        servers and SMTP timeouts.

        * mflib/sav.mf: Remove.

2010-07-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document try-catch and dclex

        * NEWS: Update.
        * doc/mailfromd.texi: Document try-catch and dclex.
        * doc/upgrade.texi : Update.
        * doc/values.texi (MIN_EXCEPTION, MAX_EXCEPTION): New values.

2010-07-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve docs: replace %var with var.

        * doc/functions.texi: Update.
        * doc/mailfromd.texi: Update.

2010-07-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Restructure the manual.

        Move function descriptions in a separate chapter.

        * doc/functions.texi: New file.
        * doc/Makefile.am (info_TEXINFOS): Add functions.texi
        * doc/mailfromd.texi: Restructure.

2010-07-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes

        * NEWS: Reword some passages.
        * etc/Makefile.am (EXTRA_DIST): Add sendmail-8.14.3.connect.diff

2010-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes in io.bi

        * mfd/builtin/io.bi (mfd/builtin/io.bi): Free str->name.
        (open): Allocate memory for iotab[i].name.
        (open_parsed_inet_stream): Remove select-driven loop which did
        nothing except eating up CPU.

2010-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change


2010-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Warn about risky uses of accept. Provide ways to properly handle
        them.

        * mfd/builtin/mmq.bi: New source.
        * builtin/Makefile.am (BI_FILES): Add mmq.bi

        * mfd/debug.hin (init_debug_modlist)
        (debug_init): New prototypes.
        * mfd/engine.c (message_data): Rename hdr to mmq. All uses 
        updated.
        (priv_store_msgmod_closure): Purge the queue if cmd is NULL.
        (mlfi_eom): Emit warning if accept is called when the MMQ is not
        empty.
        * mfd/gram.y: Handle NULL closure.
        * mfd/mailfromd.h (env_clear_msgmod): New proto.
        * mfd/prog.c (ENVF_MSGMOD): New constant.
        (exception_context)<flags>: New member.
        (runtime_warning): Rewrite using mu_diag_printf.
        (instr_result): Warn user if `accept' is called after commands
        that modify message headers or body.
        (env_clear_msgmod): New function.
        (env_msgmod): Set ENVF_MSGMOD flag.

        * NEWS, doc/mailfromd.texi: Document mmq_purge and changes to
        accept.

2010-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 6.0.93

        * configure.ac, NEWS: Update.
        * mfd/mailfromd.h [USE_SYSLOG_ASYNC] (use_syslog_async): New 
        extern.

2010-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve handling of stderr in open("|...").

        * doc/mailfromd.texi: Document dequote and extensions to 
        open("|..").
        * builtin/io.bi (STDERR_SHUT, STDERR_NULL)
        (STDERR_LOG, STDERR_FILE, STDERR_FILE_APPEND)
        (LOG_TAG_PFX, LOG_TAG_PFX_LEN): New defines.
        (stderr_to_log, stderr_handler)
        (parse_stderr_redirect): New statics.
        (open_program_stream): Always close or redirect stderr.
        * NEWS: Updated.

        * doc/Makefile.am (check-builtins): Fix rule to match new naming
        convention.

2010-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Smap forked into a separate project.

        * NEWS, configure.ac: Version 6.0.92.
        * Makefile.am (SUBDIRS): Remove smap.
        * doc/Makefile.am, doc/mailfromd.texi: Remove smap docs.
        * doc/smap.texi: Remove.
        * smap/.gitignore: Remove.
        * smap/Makefile.am: Remove.
        * smap/smap.c: Remove.
        * po/POTFILES.in: Update.

2010-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * configure.ac: Remove whitespace around shell assignment
        operator.

2010-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Optimize boolean shortcut evaluation when one of arguments is
        constant.

        * mfd/drivers.c (node_boolean_value, _optimize_shortcut): New
        static functions.
        (optimize_relational): Optimize boolean shortcut evaluation.
        * mfd/debug.hin (debug_register): New prototype.
        * NEWS: Fix typos.

2010-05-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.

        * doc/mailfromd.texi (MF_OBSTACK_1GROW): Change type of the temp 
        variable to char.
        * doc/mailfromd.texi: Minor fixes.

2010-05-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve debugging system.

        * mfd/debug.cin: Remove.
        * mfd/modlist.cin: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add modlist.c.
        (EXTRA_DIST): Remove debug.cin, add modlist.cin.
        (BUILT_SOURCES): Remove debug.c, add modlist.c.
        (debug.c): Rewrite rule.
        (debug.h): Remove rule.
        * mfd/.gitignore: Remove debug.c, add modlist.c.
        * mfd/builtin/Makefile.am (module.list): Remove.
        * mfd/builtin/.gitignore: Likewise.
        * mfd/builtin/snarf.m4 (MF_SOURCE_DEBUG_NAME): Do not output
        #define directive, only return the constructed module name.
        (_init_builtin): Register module in the debugging subsystem and 
        initialize debug_handle. Define MF_SOURCE_NAME to debug_handle.
        * mfd/debug.hin (debug_spec_string): Change signature.
        * mfd/main.c (main): Call init_debug_modlist.

        * mfd/builtin/other.bi (debug_spec): Take additional argument, 
        which specifies whether to return zero level specifications.

        * NEWS: Update.

2010-05-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Change builtin trace control.

        The method used so far limited number of built-in modules. This 
        limit was already reached with the addition of email.bi module,
        which was the compelling reason to implement a better scalable
        solution.

        * mfd/builtin/builtin.c: New file.
        * mfd/builtin/.gitignore: Explicitly mention ignored files.
        * mfd/builtin/Makefile.am (libbuiltin_a_SOURCES): Add builtin.c.
        * mfd/builtin/builtin.def (builtin_module) <mask>: Remove.
        <trace>: New member.
        (builtin_setup, builtin_set_module_trace)
        (builtin_set_all_module_trace,builtin_module_trace): New protos.
        * mfd/builtin/init.m4 (MF_MODULE_MASK): Replace by
        MF_MODULE_IDX. Change initializers of builtin_module. Define
        BUILTIN_IDX_MAX.
        * mfd/builtin/snarf.m4 (MF_MODULE_MASK): Replace by
        MF_MODULE_IDX.
        (__mf_defun): Use builtin_module_trace.
        * mfd/prog.c: Don't define DEFINE_BUILTIN_MODULE.
        (prog_trace_option): Remove variable.
        (PROG_TRACE_ENGINE): Rewrite macro.
        (enable_module_trace, disable_module_trace): Remove in favor of 
        builtin_set_module_trace.
        (toggle_prog_trace): Remove.
        (set_prog_trace): New function.
        (enable_prog_trace, disable_prog_trace): Use set_prog_trace.
        (builtin_setup): Move to mfd/builtin/builtin.c.
        * po/POTFILES.in: Add mfd/builtin/builtin.c.

2010-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Amend previous commit:

        * NEWS: Update.
        * mfd/builtin/Makefile.am: Update.
        * mfd/builtin/dns.bi: Update.

2010-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement dequote function

        * mfd/builtin/email.bi: New function.
        * mfd/builtin/Makefile.am (BI_FILES): Add email.bi.
        * mfd/builtin/dns.bi (domainpart, localpart): Move to email.bi.
        * NEWS: Update.

2010-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Reorganize source tree structure.

        * configure.ac (AC_CONFIG_FILES): Add mfd/builtin/Makefile.
        * mfd/.gitignore: Update.
        * mfd/Makefile.am (SUBDIRS): New variable.
        (M4_FILES): Remove (see mfd/builtin/Makefile.am). All references
        updated.
        (noinst_HEADERS): Remove builtin.h.
        (EXTRA_DIST): Remove files moved to builtin.
        (BUILT_SOURCES): Likewise.
        (INCLUDES): Add -I$(top_srcdir)/mfd/builtin.
        (.def.h): Remove rule.
        (module.list): New goal.
        (LDADD): Add builtin.
        (SUFFIXES): Remove .m4 .c .def .h.
        (.m4.c, .def.h): Remove rules.
        (.cin.c, .hin.h): Rewrite.
        (debug.c, debug.h): Change dependencies.

        * mfd/builtin: New directory.
        * mfd/bi_(.*).m4: Move to mfd/builtin/\1.bi
        * mfd/builtin.def: Move to mfd/builtin.
        * mfd/init.m4: Likewise.
        * mfd/snarf.m4: Likewise.
        * mfd/builtin/Makefile.am: New file
        * mfd/builtin/.gitignore: New file
        * mfd/builtin/init.m4 (MF_MODULE_NAME): Reflect changes in file
        naming.
        * mfd/builtin/snarf.m4 (MF_MODULE_NAME)
        (MF_SOURCE_DEBUG_NAME): Likewise.
        * mfd/debug.cin (struct modinfo): Remove. Include module.list
        and builtin/module.list.
        * mfd/debugdef.m4 (__makedebugsym): Update.

        * po/POTFILES.in: Update.

2010-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document new features in NEWS.


2010-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add comments for the translators.


2010-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        More compatibility fixes.

        * lib/mudefs.h (MUREF): New macro.
        * pmult/pmult.c (parse_opt): Use MUREF instead of & where
        necessary.
        * smap/smap.c: Likewise.

2010-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Avoid name clashes.

        * mfd/snarf.m4 (MF_VAR_SET_STRING): Prefix local variables with 
        a double-underscore to avoid name clashes with the existing
        variables.

2010-04-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update for compatibility with Mailutils HEAD.

        * configure.ac: Check for struct mu_argp_node_list.
        * doc/upgrade.texi: Replace itemize with enumerate.
        * lib/mudefs.h: New file.
        * lib/Makefile.am (noinst_HEADERS): Add mudefs.h
        * pmult/pmult.c: Include mudefs.h
        (parse_opt): Use MUDEF_ARGP_NODE_LIST instead of struct
        mu_argp_node_list.
        * smap/smap.c: Likewise.

2010-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix keeping state information in the server.

        * gacopyz/gacopyz.h (gacopyz_flag_op): New enum.
        (GACOPYZ_SRV_DISABLED): New define.
        (gacopyz_srv_state): Remove proto.
        (gacopyz_srv_flags, gacopyz_srv_get_flags): New protos.
        * gacopyz/server.c (gacopyz_srv_state): Remove.
        (_SRV_CONNECTED,_SRV_READY,_SRV_CLRDIS)
        (_SRV_SYS_MASK): New defines.
        (gacopyz_srv.state): Remove.
        (gacopyz_srv.flags): New member.
        (gacopyz_srv_state): Remove function.
        (gacopyz_srv_flags, gacopyz_srv_get_flags): New functions.
        (gacopyz_srv_create): Init flags.
        (gacopyz_srv_connect): Set _SRV_CONNECTED flag.
        (gacopyz_srv_negotiate): Set _SRV_READY flag.
        (gacopyz_srv_send_command): On receiving the SMFIR_REPLYCODE 
        reply set GACOPYZ_SRV_DISABLED flag, if the original command was
        one of SMFIC_BODY, SMFIC_HEADER or SMFIC_EOH.
        (gacopyz_srv_abort): Update flags.
        (gacopyz_srv_quit): Likewise.
        (_SRV_ASSERT_FLAG): New macro.
        (gacopyz_srv_helo)
        (gacopyz_srv_envfrom,gacopyz_srv_envrcpt)
        (gacopyz_srv_data,gacopyz_srv_header)
        (gacopyz_srv_eoh,gacopyz_srv_body): Return SMFIR_CONTINUE if 
        GACOPYZ_SRV_DISABLED bit is set.
        (gacopyz_srv_eom): Likewise, but clear the GACOPYZ_SRV_DISABLED 
        bit.
        (gacopyz_srv_close): Do nothing if _SRV_CONNECTED is not set.

2010-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * doc/mailfromd.texi: Update.

2010-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve I/O timeout handling. Implement `progress' function.

        * gacopyz/gacopyz_priv.h (gacopyz_read_command): Additional 
        argument: timeout index.
        * gacopyz/io.c (_gacopyz_read_tm): New function.
        (_gacopyz_read): Wrapper around _gacopyz_read_tm.
        (gacopyz_read_command): Additional argument: timeout index. All
        callers updated.
        * gacopyz/server.c (srv_connect): Use configured connection 
        timeout instead of the hardcoded value.
        (gacopyz_srv_send_command): Use GACOPYZ_TO_EOM (EOM timeout) if
        the command send was SMFIC_BODYEOB. Handle SMFIR_PROGRESS
        return.
        * mfd/Makefile.am: Add bi_progress.m4.
        * mfd/bi_progress.m4: New file.
        * mfd/bi_system.m4 (sleep): Provide optional second argument:
        number of microseconds to sleep.
        * mtasim/mtasim.c (options): New option --milter-timeout.
        (parse_milter_timeouts): New function.
        (parse_opt): Handle --milter-timeout.

        * doc/mtasim.texi: Update.
        * doc/mailfromd.texi: Update.
        * NEWS: Update.

2010-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve handling of abort requests.

        * mfd/engine.c (mlfi_helo): Free previous value of md->helostr.
        (mlfi_abort): Do not discard helostr. See RFC 2822, section
        4.1.1.5.

        * pmult/pmult.c (rf_abort): Clear macros in gsrv.

2010-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve gacopyz server API.

        * gacopyz/gacopyz.h (gacopyz_srv_clear_macros_pred)
        (gacopyz_srv_get_id,gacopyz_srv_get_portspec)
        (gacopyz_srv_get_state,gacopyz_srv_get_logmask)
        (gacopyz_srv_get_fd,gacopyz_srv_get_onerr)
        (gacopyz_srv_set_logmask): New prototypes.
        * gacopyz/server.c (gacopyz_srv_clear_macros_pred)
        (gacopyz_srv_get_id,gacopyz_srv_get_portspec)
        (gacopyz_srv_get_state,gacopyz_srv_get_logmask)
        (gacopyz_srv_get_fd,gacopyz_srv_get_onerr)
        (gacopyz_srv_set_logmask): New functions.
        (gacopyz_srv_set_callback): Don't switch to srv_disabled state
        if command returned SMFIR_REPLYCODE.

2010-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix control flow through the try-catch construct.

        * mfd/drivers.c (code_type_try): Fix handling of returns from
        both branches of the construct: the return value is preserved in
        the register A until RESTEX.
        * tests/trycatch01.at: New test case.
        * tests/trycatch02.at: New test case.
        * tests/trycatch03.at: New test case.
        * tests/trycatch04.at: New test case.
        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Add new tests.

        * tests/etc/catch.rc: Fix diagnostic message.
        * tests/etc/catch01.rc: Likewise.
        * tests/invcidr.at: Likewise.
        * tests/invcidr2.at: Likewise.
        * tests/invip.at: Likewise.

2010-01-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update copyright years.

        Happy GNU Year!

2009-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve make check.

        * Makefile.am (git-describe): Prefix with AM_V_GEN
        * etc/Makefile.am (check-am): New rule.
        * etc/mailfromd.mf: Update. Use new syntax.
        * mflib/Makefile.am (.mf.lint): New rule.
        (check-am): Rewrite as a dependency on *.lint files.
        * mflib/spf.mf (spf_cached): Remove global.
        (__spf_log): Take `cached' as an argument.

2009-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add close_fds functions.

        * lib/Makefile.am (libmf_a_SOURCES): Add close-fds.c
        * lib/libmf.h (close_fds_above)
        (close_fds_except): New declarations.
        * mfd/bi_io.m4 (open_program_stream): Use close_fds_above.
        * mfd/engine.c (mailfromd_daemon): Likewise.
        * mfd/pp.c (pp_extrn_start): Likewise.
        * mfd/srvman.c (close_fds): Remove.
        (server_run): Use close_fds_except.
        (srvman_url_to_sockaddr): Fix signature. All uses updated.
        * mfd/srvman.h (srvman_url_to_sockaddr): Fix prototype.

2009-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Reflect server ID in the proctitle.

        * mfd/engine.c (milter_session_server): Call mflog_reopen to
        reset syslog ID.
        * mfd/mailfromd.h (syslog_fd): Rename to mflog_fd.
        (mflog_close, mflog_reopen): New functions.
        (log_setup): Remove.
        (mflog_setup): New function.
        * mfd/main.c (set_default_callout_server): New function.
        (server_config_stmt): New keyword "default".
        (server_section_parser): Handle "default" settings.
        (cb_callout_url): Call set_default_callout_server.
        (syslog_fd): Rename to mflog_fd.
        (mflog_close, mflog_reopen): New functions.
        (log_setup): Rename to _log_setup, now static, with changes.
        (mflog_setup): New function.
        * mfd/savsrv.c (callout_session_server): Call mflog_reopen to
        reset syslog ID.

        * mfd/lex.l: Stylistic changes.

2009-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * mfd/lex.l (__git__): New built-in constant.

2009-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix gacopyz verbosity

        * gacopyz/gacopyz.c (report_command): print
        'state %s is unreachable' warning at debug level. Previously it
        was treated as a warning.
        (gacopyz_context_loop): Likewise. Also add state transition
        debugging info.

2009-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * mfd/mu_dbm.c (mu_dbm_errcall_fcn): One more fix

2009-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * mfd/mailfromd.h (set_options): Remove proto.
        * mfd/main.c (struct option_cache): Remove flags, confkw,
        conffn.
        (MFD_OPTION_CUMULATIVE): Remove.
        (set_option): Now static. Remove `override' parameter. All uses
        updated.
        * mfd/mu_dbm.c (mu_dbm_errcall_fcn)![DB_VERSION_MAJOR == 3]: Fix
        signature.

2009-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * lib/syslog_async.c (log_fd_async): Always return actual
        log_fd.
        * mfd/main.c (parse_milter_url): Fix parsing of
        sendmail-compatible URLs.
        (syslog_fd): New function.
        * mfd/savclt.c (schedule_callout): Return immediately if unable
        to establish connection with the server.
        * mfd/srvman.c (server_run): Avoid closing syslog descriptor, if
        the async implementation is in use.

2009-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix handling of hard timeouts in callouts.

        * mfd/mailfromd.h (mf_timeout): New status code.
        (mf_status_str, mf_status_to_exception): Remove macros.
        (mf_status_str, mf_status_to_exception): New protos.
        (test_message_data_init, trimcrlf): New protos.
        * mfd/mf-status.mfi (mf_status_str)
        (mf_status_to_exception): New functions.
        * mfd/savsrv.c (verify): Improve proctitle info. Handle
        mf_timeout response as equivalent to mf_not_found.
        * mfd/callout.c (reset, callout_io)
        (smtp_io_open, callout_host)
        (callout_mx, callout_strict)
        (listens_on): Return mf_temp_failure only if received 4xx reply
        from the SMTP server. If there was no response within the
        timeout interval, return mf_timeout.
        * mfd/engine.c (method_strict)
        (method_standard): Schedule callout only if our attempt returned
        mf_timeout.

2009-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve --version output for alpha version.

        The new output looks like:

           mailfromd (mailfromd) 6.0.91 [release-6.0-17-ga3fa5da]

        where the string in [] is the result of git describe.  If there
        are uncommitted changes, that string is suffixed with
        `-dirty'.

        * Makefile.am (git-describe): New goal.
        (dist-hook): Depend on ChangeLog and git-describe.
        * NEWS: Version 6.0.91.
        * configure.ac: Set GIT_DESCRIBE for alpha versions.
        * lib/version.c (mailfromd_version): Print $GIT_DESCRIBE along
        with the version info.
        * tests/version.at: Accept new version format.

2009-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 6.0.90

        * NEWS, configure.ac: Raise version number to 6.0.90

2009-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use callout resolver to handle timed-out callouts.

        * mfd/savclt.c: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add savclt.c
        * mfd/callout.c (transcript): Get ID as 1st arg. Remove static
        qualifier. All callers updated.
        * mfd/engine.c (method_strict)
        (method_standard): If callout returned mf_temp_failure, try to
        pass the task to the callout server, if one is defined.
        * mfd/mailfromd.h (transcript)
        (schedule_callout): New protos.
        (callout_server_sa, callout_server_sa_len): New externs.
        * mfd/main.c (force_remove): Initialize to 0 (see srvman.c)
        (server_config_stmt): New statements single-process and 
        reuseaddr.
        (add_legacy_milter_port, server_section_parser): Pass flags to
        mfd_server_new.
        (mf_cfg_param): New statement `callout-url'.
        * mfd/savsrv.c (MF_SOURCE_NAME): Fixed.
        (verify, callout_session_server): Set proctitle.
        (callout_session_server): Fix memory leak.
        * mfd/srvman.c (struct mfd_server): New member `flags'.
        (mfd_server_new): Take flags as 4th argument.
        (server_run): Use flags to set single-user and reuseaddr modes.
        * mfd/srvman.h (SRV_SINGLE_PROCESS)
        (SRV_KEEP_EXISTING): New defines.
        (mfd_server_new): Change signature.
        (srvman_url_to_sockaddr): New proto.

2009-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement the callout server.

        * mfd/savsrv.c: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add savsrv.c.
        * mfd/callout.c (struct smtp_io_data): Add new fields: email,
        ehlo and mailfrom.
        (smtp_io_create): trim trailing ': ' from the id.
        (smtp_io_init, smtp_io_setup_callout): New functions.
        (smtp_io_free): Free new members.
        (smtp_io_email): New function.
        (callout_io): Change signature.
        (smtp_io_open): 2nd arg is const char *.
        (callout): Remove.
        (callout_host, callout_mx)
        (callout_strict, callout_standard): New functions.
        * mfd/engine.c (mfl_smtp_io_callback): Now extern.
        (check_on_host, check_mx_records): Remove.
        (method_strict, method_standard): Rewrite using new callout 
        support.
        * mfd/mailfromd.h: Fix protos.
        (callout_host, callout_mx)
        (callout_strict, callout_standard): New functions.
        * mfd/main.c (cb_url)
        (callout_resolver, callout_resolver_section_param)
        (callout_resolver_cfg_init): Remove.
        (milter_config_stmt): Rename to server_config_stmt. Add new 
        field `server'.
        (cb_milter_stmt_listen): Rename to cb_server_stmt_listen.
        (milter_section_param): Rename to server_section_param.
        (milter_section_parser): Rename to server_section_parser. The
        label of the statement determines the server type.
        (milter_cfg_init): Rename to server_cfg_init.
        (mf_cfg_param): Rename `milter' and `callout-resolver' 
        statements. Add new statement `server'.
        (main): Call server_cfg_init.

        * mfd/bi_poll.m4 (_pollhost, _pollmx): Use callout_host and
        callout_mx, correspondingly.

        * mfd/cache.c (cache_get, cache_insert)
        (cache_get2, cache_insert2): String args are const.
        * mfd/dns.c (getmx): Likewise.
        * mfd/srvman.c: Add debugging statements.

2009-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement multiple servers support.

        * mfd/srvman.c: New file.
        * mfd/srvman.h: New file.
        * gacopyz/gacopyz.h (gacopyz_context_loop): New proto.
        * gacopyz/gacopyz.c (gacopyz_context_loop): Remove static
        qualifier. Take additional parameter (closure). All callers
        updated.
        (gacopyz_getclosure): New proto.
        * gacopyz/gacopyz_priv.h (struct smfi_str): desc is const *.
        (closure): New member.
        * mfd/Makefile.am (mailfromd_SOURCES): Add srvman.c and
        srvman.h.
        * mfd/bi_vars.m4: New MFL variable milter_server_id.
        (set_milter_server_id): New proto.
        * mfd/engine.c (priv_get): Set milter_server_id.
        (milter_conn_accept): Remove.
        (smfilter): Static. Init xxfi_accept to NULL.
        (milter_session_server, milter_setlogmask)
        (milter_settimeout): New functions.
        (check_local_portspec, check_portspec): Remove.
        (sig_stop, sig_restart): Call mfd_srvman_stop instead of
        smfi_stop.
        (mailfromd_daemon): Rewrite via srvman functions.
        * mfd/mailfromd.h (portspec, mailfromd_acl): Remove.
        (add_legacy_milter_port, free_parser_data)
        (set_milter_server_id)
        (milter_session_server, milter_setlogmask)
        (milter_settimeout): New prototypes.
        * mfd/main.c (portspec): Remove
        (force_remove): Initialize to 1.
        (mailfromd_acl): Remove.
        (parse_milter_url, next_server_id)
        (add_legacy_milter_port): New functions.
        (set_port): Call add_legacy_milter_port.
        (parse_opt): Call milter_set.* functions, instead of smfi_set.*
        (portspec_fixup): Remove.
        (main): Call milter_cfg_init.
        (mf_cfg_param): New block statement 'milter'.

        * mflib/Makefile.am (check-am): Ignore configuration files.

2009-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Preparational work for introducing callout resolver.

        * configure.ac: If --enable-pmilter=PATH is given, store
        appropriate -I statement in META1_INCLUDES. Modify CPPFLAGS for
        the subsequent AC_CHECK_HEADERS accordingly. Restrore LDFLAGS
        after checks.

        * mfd/bi_dns.m4: Rename smtp_timeout to smtp_timeout_soft.
        * mfd/engine.c: Rename smtp_timeout to smtp_timeout_soft.
        (xlate_and_replace_body): Fix uninitialized variable.
        * mfd/mailfromd.h (smtp_timeout): Remove.
        (smtp_timeout_soft, smtp_timeout_hard): New externs.
        (mfd_app_init): Change signature.
        * mfd/main.c (smtp_timeout): Remove.
        (smtp_timeout_soft, smtp_timeout_hard): New externs. New
        configuration statement `smtp-timeout', instead of `timeout'. 
        New block statement `callout-resolver'.
        * pmult/Makefile.am (INCLUDES): Add META1_INCLUDES.

2009-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes

        * mfd/callout.c: Fix comment.

        * gacopyz/context.c (format_message): Initialize xcodelen to
        shut up gcc warnings.
        * lib/utils.c, mfd/dnscache.c: Shut up gcc warnings.
        * mfd/appinit.c (mfd_app_init): Change signature. Take two
        closures: one for argp and another for mfd_parse_config_files.

2009-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Optimize callout support. Introduce distinct timeouts for each
        SMTP command.

        * mfd/callout.c: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add callout.c
        * mfd/bi_poll.m4 (set_last_poll_result): Remove.
        (set_last_poll_host)
        (set_last_poll_sent,set_last_poll_recv): New functions.
        * mfd/engine.c (struct message_data.io): Remove. All uses 
        updated.
        (test_message_data_init): New function.
        (priv_set_io): Remove. All uses updated.
        (transcript, smtp_io_*, listens_on): Remove. See callout.c
        (mfl_smtp_io_callback): New function.
        (check_on_host): Rewrite using smtp_io_t functions.
        * mfd/gram.y (mailfromd_test, mailfromd_run): Call 
        test_message_data_init.
        * mfd/mailfromd.h (connect_timeout)
        (response_timeout): Remove.
        (set_last_poll_result): Remove.
        (set_last_poll_host)
        (set_last_poll_sent,set_last_poll_recv): New proto.
        (listens_on): Change signature.
        (connect_timeout, response_timeout): Remove.
        (smtp_timeout): New extern.
        (smtp_timeout): New enum.
        (smtp_io_callback_t, smtp_io_t): New types.
        (smtp_io_create, smtp_io_free)
        (callout): New protos.
        * mfd/main.c (connect_timeout, response_timeout): Remove.
        (smtp_timeout): New global.
        (cb_io_timeout, cb_connect_timeout): Remove.
        (cb_initial_response_timeout): Remove.
        (cb_io_timeout): New function.
        (mf_cfg_param): New keywords: helo-timeout, mail-timeout, 
        rcpt-timeout, rset-timeout, quit-timeout
        (main): Set uninitialized elements of smtp_timeout to 
        io_timeout.
        * mfd/bi_dns.m4 (listens): Update call to listens_on.

2009-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes (port from master).

        * mfd/deprecation.c (init_fixup_stk): New function.
        (add_fixup_command, add_fixup_command_fmt): Call init_fixup_stk.
        * mfd/lex.l: Rewrite the rule for #pragma without using the 
        trailing context, so it works after yyless(0).
        * mfd/tbf_rate.c: Inlcude inttypes.h.

2009-10-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix exception handling. Introduce user-defined exceptions.

        * mfd/bitmask.h: New file.
        * mfd/Makefile.am: Add bitmask.h
        * mfd/drivers.c (print_type_catch): Take into account the `all' 
        flag: there may be more exceptions than mf_exception_count.
        (code_type_catch): Use code_exmask to code exception mask
        values.
        * mfd/gram.y (codegen): Take struct exmask * as its third
        parameter.
        (%union): New member catchlist.
        (catchlist): Change type.
        (T_DCLEX): New token.
        (decl rule): New production: exdecl.
        (exdecl): New rule.
        (catch rule): Use bitmask.
        (simple_catch rule): Likewise.
        (catchlist rule): Rewrite.
        (free_parser_data): New placeholder.
        (exmask_create): New function.
        (create_on_node): Use struct exmask* instead of the fixed-size 
        bitmask.
        (dataseg_layout): Store exception masks in the DS.
        * mfd/lex.l (dclex): New token.
        * mfd/mailfromd.h: Include bitmask.h
        (EXMASK): Rename to STATMASK.
        (struct catch_node, struct function): Store exception masks in
        struct exmask.
        (exmask): New struct.
        (exmask_create, code_exmask): New prototypes.
        * mfd/main.c (main): Call free_parser_data.
        * mfd/mf-status.mfi (mf_exception_str): Change parameter type to 
        unsigned int. Return USER-DEFINED-%d instead of the UNKNOWN for 
        exceptions not in the predefined range.
        * mfd/opcodes (CATCH): Decrease number of arguments.
        * mfd/prog.c (exception_count): New global.
        (code_exmask): New function.
        (exception_context): New struct.
        (eval_environ): defcatch and catch replaced by defcatch_ctx and
        catch_ctx.
        (instr_catch): Read exceptions from the DS. Take two arguments.
        (dump_catch): Update.
        (instr_saveex): For each exception, save on stack its entry
        point, tos and base addresses in the form of tos invariants.
        (dump_saveex): Update.
        (instr_restex): Do the reverse of instr_saveex.
        (env_init, destroy_environment)
        (env_save_catches): Reflect changes to eval_environ_t.
        (env_throw_0): Before passing control to the exception handler,
        restore tos and base addresses.
        * mfd/prog.h (exception_count): New extern.
        * mfd/snarf.m4: Use STATMASK instead of EXMASK.
        * mfd/symbols.c (function_install): Create mask using
        exmask_create.

2009-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement `try - catch' construct.

        * elisp/mfl-mode.el (mfl-compute-line-indentation): Account for
        `try'.
        (mfl-keywords): New keyword `try'.
        * mfd/drivers.c (print_type_catch): Properly indent END CATCH.
        (code_type_catch): Remove adjust kludge (see prog.c).
        (type try): New node type.
        * mfd/gram.y (T_TRY): New token.
        (try_block, simple_catch): New types.
        (catch): Rewrite rule.
        (simple_catch): New production.
        (try_block): New production.
        (node_type): Handle node_type_try.
        * mfd/lex.l: Recognize the `try' keyword.
        * mfd/mailfromd.h (struct try_node): New struct.
        (struct node): Add v.try.
        * mfd/prog.c (instr_retcatch): Remove 2 args from stack, as per
        env_throw_0.
        * doc/mailfromd.texi: New keyword `try'.

2009-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Re-introduce fixup script (partial port of 7cba79054 from
        master).

        * mfd/deprecation.c (add_fixup_command, add_fixup_command_fmt)
        (add_fixup_command_locus): New functions.
        (fixup_create_script): New functions.
        * mfd/gram.y: Issue fix-up statements for every deprecation 
        warning.
        * mfd/lex.l: Likewise.
        * mfd/mailfromd.h (fixup_op): New enumeration.
        (add_fixup_command,add_fixup_command_fmt)
        (add_fixup_command_locus, fixup_create_script): New functions.
        * mfd/main.c (main): Call fixup_create_script.

2009-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve locations in diagnostic messages (port b4e793c6329 from
        master).

        * mfd/deprecation.c (deprecation_warning_locus): New function.
        (deprecation_warning): Use print_parse_message.
        * mfd/gram.y: Improve error diagnostics by using Bison's
        locations feature.
        * mfd/lex.l (advance_line): Set point and leng to 0.
        (YY_USER_ACTION): Set yyloc.
        (keyword): Remove. Rely on YY_USER_ACTION for setting locations.
        (print_parse_message): Change scope of visibility. Print column
        information if location_column_option is set.
        (vparse_warning): Remove.
        * mfd/mailfromd.h (location_column_option): New extern.
        (struct locus): New members: point and leng.
        (LOCUS_EQ): Avoid coredumps on NULL file names.
        (mf_yyltype_t): New typedef.
        (YYLTYPE): New define.
        (vparse_warning): Remove.
        (print_parse_message): New proto.
        (deprecation_warning_locus): New proto.
        * mfd/main.c (location_column_option): New variable.
        (OPTION_LOCATION_COLUMN): New option.
        (options): New option --location-column.
        (parse_opt): Handle OPTION_LOCATION_COLUMN.
        * mfd/pp.c (assign_locus): Reset point and leng.
        * tests/poll04.at: Reflect changes in error messages.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update.

        * mflib/dns.mf4, mflib/safedb.mf4: Remove uses of %var.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Remove %var usage.

        * mfd/lex.l: Warn about %var constructs outside of strings.
        (print_parse_message): Fix call to mu_error to avoid
        misinterpreting
        "%" in the message.

        * tests/farg.at: Remove
        * tests/Makefile.am, tests/testsuite.at: Remove farg.at
        * mflib/gettext.mf: s/%var/var/g outside of strings.
        * mflib/heloarg_test.mf: Likewise.
        * mflib/is_ip.mf: Likewise.
        * mflib/localdomain.mf: Likewise.
        * mflib/match_cidr.mf: Likewise.
        * mflib/match_dnsbl.mf: Likewise.
        * mflib/match_rhsbl.mf: Likewise.
        * mflib/rateok.mf: Likewise.
        * mflib/revip.mf: Likewise.
        * mflib/sa.mf: Likewise.
        * mflib/sockmap.mf: Likewise.
        * mflib/spf.mf: Likewise.
        * mflib/strip_domain_part.mf: Likewise.
        * mflib/valid_domain.mf: Likewise.
        * mflib/verp.mf: Likewise.
        * tests/declvar.at: Likewise.
        * tests/eof.at: Likewise.
        * tests/etc/catch.rc: Likewise.
        * tests/etc/public.mf: Likewise.
        * tests/etc/static.mf: Likewise.
        * tests/fctx00.at: Likewise.
        * tests/fctx01.at: Likewise.
        * tests/hdr-all.at: Likewise.
        * tests/hdr-cap.at: Likewise.
        * tests/hdr-itr.at: Likewise.
        * tests/hdr-mul.at: Likewise.
        * tests/ml01.at: Likewise.
        * tests/next01.at: Likewise.
        * tests/next02.at: Likewise.
        * tests/regopt0.at: Likewise.
        * tests/shadow.at: Likewise.
        * tests/strings.at: Likewise.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        The '%' prefix no longer needed to refer to variables.

        * mfd/gram.y, mfd/lex.l: Allow to refer to variables without
        '%' prefix.
        * mfd/prog.h (add_xref): New proto.
        * tests/etc/ack.rc, tests/etc/catch01.rc: Replace obsolete
        (v1.0-style) parameter declarations with normal ones.
        * tests/farg.at: account for a deprecation message.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Simplify rules for function vs. procedure call.

        * mfd/gram.y (T_BUILTIN_PROC, T_FUNCTION_PROC): Removed.
        (proccall): Removed. Use funcall instead.
        * /mfd/lex.l (T_BUILTIN_PROC, T_FUNCTION_PROC): Removed.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Initial cleanup: remove deprecated features.

        * mfd/deprecation.c: Remove _change_conf functions and data.
        * mfd/drivers.c (type strcat): Remove.
        * mfd/gram.y: Remove deprecated features: use of "functional
        operators", implicit concatenation (except for literal strings),
        #pragma option and
        #pragma database.
        * mfd/mailfromd.h (LEGACY_SCRIPT_FILE): Remove.
        (set_option): Remove last argument.
        (legacy_script_warning, open_change_conf, write_change_conf)
        (write_db_config, close_change_conf): Remove.
        * mfd/main.c: Remove obsolete pragma support.
        * mfd/pp.c (parse_require): Remove.

        * mflib/heloarg_test.mf: Remove use of obsolete features.
        * mflib/match_rhsbl.mf: Likewise.
        * mflib/strip_domain_part.mf: Likewise.

        * tests/prec.at: Remove.
        * tests/Makefile.am, tests/testsuite.at: Remove prec.at and
        prec01.at
        * tests/etc/dns.rc, tests/etc/relayed.rc, tests/fctx00.at,
        tests/numrcpt.at, tests/strings.at: Don't use obsolete features.

2009-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 6.0

        * NEWS: Update.
        * configure.ac: Update.
        * mfd/lex.l (module rule): Add const qualifier.

2009-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs


2009-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.9.91 (alpha)


2009-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix configuration handling. Partial port from mtax-cleanup
        c9f9835a1820fa85ae49f2f511ce793255618bcb

        * mfd/appinit.c (mfd_app_init): Change signature. Take two
        closures: one for argp and another for mfd_parse_config_files.
        * mfd/mailfromd.h (mfd_app_init): Change signature.
        * mfd/main.c (main): Update call to mfd_app_init. Make sure to
        pass NULL as cfg_data, to not trigger a Mailutils bug.

2009-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * mfd/lex.l (print_parse_message): Use dot as a separator
        between line and column numbers.
        * doc/mailfromd.texi: Document this.

2009-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update the docs. Minor change in is_greylisted().

        * NEWS: Update.
        * configure.ac: Update.
        * doc/mailfromd.texi: Update.
        * mfd/bi_db.m4 (is_greylisted_ct): Set greylist_seconds_left if
        returning true.

2009-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix diagnostic messages.

        * lib/userprivs.c
        * mfd/bi_body.m4
        * mfd/bi_curhdr.m4
        * mfd/bi_db.m4
        * mfd/bi_macro.m4
        * mfd/bi_mbox.m4
        * mfd/bi_msg.m4
        * mfd/bi_sieve.m4
        * mfd/gram.y
        * mfd/main.c
        * mfd/pp.c
        * mfd/pragma.c
        * mfd/symbols.c
        * mfd/tbf_rate.c

2009-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Syntax sugar for the `require' statement.

        * mfd/lex.l (save_state): New static
        (XIDENT): New exclusive state. Enter XIDENT after `require' or
        initial `from' and quit after reading next symbol. Account for 
        possible comment between `require' or `from' and the symbol.

2009-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add gnulib as a module.

        * bootstrap: Merge changes from gnulib.
        * .gitmodules: Add gnulib

2009-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix.

        * mfd/lex.l: Remove dependency on base_name.

2009-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * mfd/Makefile.am (inc_DATA): Add status.mfh.
        * mfd/main.c (main): Use DEFAULT_CONFIG_FILE.
        * pmult/pmult.c (_cb_log_level): Bugfix.

2009-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix docs


2009-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix handling of 5.x filter files.

        * mfd/lex.l (INCTX_IGNORE_BYE): New flag.
        (string_beg): New static.
        (compose_start): Initialize string_beg.
        (compose_finish): Assign string_beg to yylloc.beg.
        (module rule): Fix warning message. Eat everything up to and
        including '.', if the module file is included. Raise
        INCTX_IGNORE_BYE flag in this case.
        (bye rule): If INCTX_IGNORE_BYE is set return EOF.
        * mflib/heloarg_test.mf, mflib/match_cidr.mf, 
        mflib/match_dnsbl.mf, mflib/match_rhsbl.mf, mflib/sockmap.mf,
        mflib/spf.mf: Quote arguments of the
        `require' statements.

        * doc/upgrade.texi: Update.

2009-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Spell check the docs.


2009-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve docs.

        * NEWS, doc/deprecate.texi, doc/mailfromd.texi: Document new
        features.
        * doc/sexp.texi: New file.
        * doc/upgrade.texi: Update.
        * mfd/bi_msg.m4 (message_read_line)
        (message_read_body_line): Raise eof exception when there are no
        more lines left.

2009-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix doc/Commit

        * doc/Commit (gray_print_section): Output anchors before 
        chapter/section/etc. titles, so that the heading menu in 
        monolithic document works properly.

2009-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve docs.

        * doc/Makefile.am (manual.tar.bz2, man-tar): New rules.
        (manual): Mark as phony.
        * doc/gendocs_template: Upgrade for the new webpage style.
        * doc/mailfromd.texi: Minor changes.
        * doc/Config: New file.

2009-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * mfd/deprecation.c (init_fixup_stk): New function.
        (add_fixup_command, add_fixup_command_fmt): Call init_fixup_stk.
        * mfd/lex.l: Rewrite the rule for #pragma without using the 
        trailing context, so it works after yyless(0).
        * mfd/tbf_rate.c: Inlcude inttypes.h.
        * tests/sh-req.at: New testcase.
        * tests/Makefile.am, tests/testsuite.at: Add sh-req.at.
        * NEWS: Update.

2009-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Move pies to a stand-alone project.

        * pies/Remove.
        * doc/pies.texi: Remove.
        * doc/Makefile.am: Update.
        * doc/mailfromd.texi: Update.
        * doc/pmult.texi: Update.
        * po/POTFILES.in: Update.
        * Makefile.am, NEWS: Update.

        * mfd/lex.l: Use %top section to include config.h

2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Begin restructuring the docs.

        * doc/deprecate.texi: New file.
        * doc/Makefile.am: Add deprecate.texi.
        * doc/upgrade.texi: Update.

2009-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix compilation of the `catch' construct.

        * mfd/drivers.c (print_type_catch): Properly indent END CATCH.
        (code_type_catch): Remove adjust kludge (see prog.c).
        * mfd/prog.c (instr_retcatch): Remove 2 args from stack, as per
        env_throw_0.

2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update NEWS


2009-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * mfd/symbols.c (literal_lookup): Initialize only newly
        installed literals.

2009-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * mfd/gram.y: Warn about obsolete ways of declaring function
        parameters (hopefully no one uses them by now).
        * tests/etc/ack.rc, tests/etc/catch01.rc, tests/farg.at,
        tests/prec.at, tests/prec01.at: Update

2009-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve fixup script generation.

        * mfd/gram.y (pragma_database): Print deprecation warning. Issue
        a fixup statement.

2009-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve fixup script generation.

        * mfd/deprecation.c (open_change_conf)
        (close_change_conf): Remove.
        (write_db_config, write_db_config, write_change_conf): Rewrite.
        (add_fixup_command, add_fixup_command_fmt)
        (add_fixup_command_locus): New functions.
        (fixup_create_script): New functions.
        * mfd/gram.y: Issue fix-up statements for every deprecation 
        warning.
        * mfd/lex.l ({IDENT} rule): update locus.point along with each
        call to input and unput.
        * mfd/mailfromd.h (parse_require): Take locus as the 2nd 
        parameter.
        (open_change_conf,close_change_conf): Remove.
        (fixup_op): New enumeration.
        (add_fixup_command,add_fixup_command_fmt)
        (add_fixup_command_locus, fixup_create_script): New functions.
        * mfd/main.c (set_option): Update.
        (main): Call fixup_create_script instead of close_change_conf.
        * mfd/pp.c (parse_require): Issue a fixup statement.

2009-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve locations in diagnostic messages.

        * mfd/deprecation.c (deprecation_warning_locus): New function.
        (deprecation_warning): Use print_parse_message.
        * mfd/gram.y: Improve error diagnostics by using Bison's
        locations feature.
        * mfd/lex.l (advance_line): Set point and leng to 0.
        (YY_USER_ACTION): Set yyloc.
        (keyword): Remove. Rely on YY_USER_ACTION for setting locations.
        (print_parse_message): Change scope of visibility. Print column
        information if location_column_option is set.
        (vparse_warning): Remove.
        * mfd/mailfromd.h (location_column_option): New extern.
        (struct locus): New members: point and leng.
        (LOCUS_EQ): Avoid coredumps on NULL file names.
        (mf_yyltype_t): New typedef.
        (YYLTYPE): New define.
        (vparse_warning): Remove.
        (print_parse_message): New proto.
        (deprecation_warning_locus): New proto.
        * mfd/main.c (location_column_option): New variable.
        (OPTION_LOCATION_COLUMN): New option.
        (options): New option --location-column.
        (parse_opt): Handle OPTION_LOCATION_COLUMN.
        * mfd/pp.c (assign_locus): Reset point and leng.
        * tests/fctx00.at, tests/poll04.at, tests/prec.at: Reflect
        changes in error messages.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * mfd/gram.y: Remove calls to add_xref.
        * mfd/lex.l (variable_or_const): Call add_xref before returning
        a constant.
        (print_parse_message): Bugfix: pass argument to mu_error via
        "%s", to avoid interpretation of
        % sequences in the formatted message.
        * mfd/prog.h (add_xref): New proto.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Use of function or built-in name as a prefix operator is
        deprecated.

        * mfd/gram.y: Issue deprecation warning on use of a function or
        built-in name as a prefix operator.
        * mfd/lex.l (paren_follows): New global.
        * mfd/mailfromd.h (paren_follows): New global.

        * mflib/heloarg_test.mf, mflib/match_rhsbl.mf, 
        mflib/strip_domain_part.mf, tests/etc/dns.rc, 
        tests/etc/relayed.rc, tests/strings.at: Don't use deprecated
        features.

        * tests/prec.at, tests/prec01.at: Account for the new warning.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * doc/mailfromd.texi: Add new keywords.
        * elisp/mfl-mode.el: Add new keywords.
        * tests/prec01.at: Forgotten to add in 1026a8cc51d8c.

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement explicit type casts: TYPE(expr)

        * mfd/gram.y: (atom_expr: T_TYPECAST '(' expr ')'): New rule.
        * mfd/lex.l: New token T_TYPECAST

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement explicit concatenation operator (.)

        * mfd/drivers.c (type strcat): A synonym for concat, used for
        implicit string concatenation.
        * mfd/gram.y: Expect 53 shift/reduces.
        (alloc_node, cast_to): extern
        (T_COMPOSE): New token.
        (concat_expr): New %type.
        (concat_expr): New rule.
        (node_type): handle node_type_strcat.
        (create_node_variable, create_node_argcount)
        (create_node_arg, create_node_symbol)
        (create_node_backref): New functions.
        * mfd/lex.l: Rewrite string handling. Strings with variable
        and/or constant substitutions within them are handled in one run
        and a corresponding NODE* is composed out of them. That node is
        then returned as T_COMPOSE token.
        * mfd/prog.h (alloc_node, cast_to)
        (create_node_variable, create_node_argcount)
        (create_node_arg, create_node_symbol)
        (create_node_backref): New protos.

        * mflib/sa.mf, mflib/spf.mf, tests/alias.at, tests/curmsg.at,
        tests/etc/ack.rc, tests/etc/catch.rc, tests/etc/catch01.rc,
        tests/etc/public.mf, tests/hdr-all.at, tests/hdr-cap.at,
        tests/hdr-count.at, tests/hdr-get.at, tests/hdr-gete.at,
        tests/hdr-getn.at, tests/hdr-itr.at, tests/hdr-mul.at,
        tests/macros.at, tests/next01.at, tests/next02.at,
        tests/prec.at, tests/public.at, tests/shadow.at, 
        tests/static01.at: Use explicit concatenation.

        * tests/prec01.at: New testcase.
        * tests/Makefile.am, tests/testsuite.at: Add prec01.at

2009-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix coredumps on regex used with -O0

        * mfd/drivers.c (save_regexp): New function.
        (optimize_type_regcomp): Call save_regexp.
        (code_type_regcomp): Call save_regexp if regind == -1.
        * mfd/gram.y (input rule): Call regex_layout before or after
        compile_tree, depending on whether optimization is on.
        * tests/regopt0.at: New test.
        * tests/Makefile.am, tests/testsuite.at: Add regopt0.at

2009-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * mfd/gram.y: Improve module ending rules.
        * mfd/lex.l: Add more comments.
        (lex_buffer_push): Rename to inctx_push.
        (lex_buffer_pop): Rename to inctx_pop.
        * mfd/mailfromd.h (module_push): Remove.
        * mfd/symbols.c: Mark module_ functions as statics.

2009-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Treat unquoted literals as errors.

        * mfd/gram.y: Treat unquoted literals as errors.
        * doc/mailfromd.texi: Comment out the description of unquoted
        literals and add a FIXME.

2009-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change (bison-dependent).

        * mfd/gram.y: Uniformly begin all token names with T_. Provide
        symbolic strings to improve error diagnostics.
        * mfd/lex.l: Uniformly begin all token names with T_.
        * tests/module04.at, tests/module06.at, tests/static02.at:
        Reflect the above changes.

2009-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix scoping in imported modules.

        When handling `import' (`require') statements, mailfromd in some
        cases could have closed and popped the module lexical context
        before finishing processing its actual contents. In particular,
        if a module ended with a variable or constant declaration (e.g.
        status.mf), this declaration would end up in the symbol table of
        the importing compilation unit. This happened because yywrap,
        triggered by EOF on the module unit, caused immediate popping of
        the lexical contents, whereas the parser still had some
        unreduced symbols on its stack. The actual reduction (e.g. of
        the rule `stmt: CONST value') happened after the lexer had
        supplied next symbol, but by that time the original module had
        already been removed from stack.

        * mfd/gram.y (BYE): New keyword.
        (MODBEG, MODEND): New (pseudo)keywords.
        (input rule): Allow programs to begin with `module'.
        (modcntl): Fix parsing of the imported files.
        * mfd/lex.l (keyword): Rewrite as a macro.
        (INCTX_MODULE,INCTX_HADINPUT): New defines.
        (struct inctx): New member inctx_flags.
        (inctx_flags, emit_token): New statics.
        (lex_new_source): Change semantics of the second argument.
        (YY_USER_ACTION, YY_INPUT, YY_DECL): New defines.
        (module): Warn if module is used in included file, or if there
        were some statements before it.
        (yylex): New function.
        (lex_close_source): Error checking: yyin may be NULL on entry.
        (lex_drain_input, lex_bye): New functions.
        (yywrap): Set emit_token to MODEND if within a module.
        (LEX_NONE, LEX_ONCE, LEX_MODULE): New defines.
        (lex_bye, lex_drain_input): New functions.
        * mfd/pp.c (begin_module, parse_include): Update calls to
        lex_new_source.
        * mfd/status.mfi: Declare a module.

        * mflib/Makefile.am (install-data-local): Remove.
        * mflib/dns.mf4, mflib/gettext.mf, mflib/heloarg_test.mf, 
        mflib/is_ip.mf, mflib/localdomain.mf, mflib/match_cidr.mf, 
        mflib/match_dnsbl.mf, mflib/match_rhsbl.mf, mflib/rateok.mf, 
        mflib/revip.mf, mflib/sa.mf, mflib/safedb.mf4, mflib/sieve.mf,
        mflib/sockmap.mf, mflib/spf.mf, mflib/strip_domain_part.mf,
        mflib/valid_domain.mf, mflib/verp.mf: Declare as modules.

2009-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix memory overrun.

        * lib/libmf.h (syment_alloc_hook, syment_free_hook): Remove.
        (symtab_create): New argument `alloc_fun'.
        * lib/symtab.c (syment_alloc_hook, syment_free_hook): Remove.
        (struct symtab): New members syment_alloc_fun, syment_free_fun. 
        Remove free_syment.
        (syment_free): Take pointer to the owner struct symtab in first
        argument.
        (syment_alloc): Rewrite.
        (symtab_free_syment): Rewrite.
        (symtab_create): New argument `alloc_fun'.
        * mfd/symbols.c (alloc_entry): Fix memory overrun. Fill
        allocated memory with zeros.
        (xsymtab_create): Reflect changes to symtab_create.
        (module_init, init_symbols): Likewise.

2009-10-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update .gitignores.


2009-10-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add basic test cases for the module system.

        * configure.ac: Remove check for mu_get_auth.
        * mfd/bi_other.m4 [!HAVE_MU_GET_AUTH]: Remove.
        * lib/libmf.h (transform_compile): Take 2 arguments.
        * lib/transform.c (parse_transform_expr)
        (transform_compile): Take regcomp flags in an additional 
        argument.
        * mfd/symbols.c (make_transform_rule): Pass regex_flags to
        transform_compile.
        (import_cpyfun): Make sure new symbol has valid locus.
        * mfd/lex.l: New built-in constant __module__.

        * tests/module01.at, tests/module02.at, tests/module03.at,
        tests/module04.at, tests/module05.at, tests/module06.at, 
        tests/public.at, tests/static01.at, tests/static02.at: New
        testcases.

        * tests/Makefile.am: Add new tests.
        * tests/testsuite.at: Likewise.

        * tests/etc/public.mf, tests/etc/static.mf, tests/etc/mod1.mf,
        tests/etc/mod2.mf: New test programs.
        * tests/etc/Makefile.am (RCFILES): Add new test programs.

2009-09-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve handling of deprecated features.

        * mfd/deprecation.c: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add deprecation.c.

        * mfd/mailfromd.h (vparse_warning): New proto.
        (deprecation_warning, final_deprecation_warning)
        (enable_deprecation_warnings, legacy_script_warning)
        (open_change_conf, write_change_conf, write_db_config)
        (close_change_conf): New functions.
        * mfd/main.c: Move `change_conf' functions to deprecation.c.
        * mfd/gram.y (parse_program): Emit final deprecation warning if
        MAILFROMD_DEPRECATION is set to no.
        * mfd/lex.l: Use deprecation_warning for its purpose.
        (vparse_warning): New function.

2009-09-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix handling of #require.

        * mfd/gram.y (%union): New member `string'.
        (SHARPREQR): New token.
        (require: SHARPREQR): New rule.
        * mfd/lex.l: Fix handling of #require.
        * po/POTFILES.in: Add missing files.

2009-09-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix --dump-code and --dump-tree output.

        * NEWS: Update.
        * configure.ac: Bump version number: 5.9.90
        * lib/libmf.h (symtab_count_entries): New proto.
        * lib/symtab.c (symtab_count_entries): New function.
        * mfd/gram.y (function_enumerator): Process only functions from
        one module.
        (print_syntax_tree): Iterate over all modules.
        * mfd/mailfromd.h (collect_modules): New proto.
        * mfd/prog.c (function_counter): Change closure type. Process
        only functions from one module.
        (function_lister): Process only functions from one module.
        (print_code): Iterate over all modules.
        * mfd/symbols.c (collect_modules): New function.
        (free_module_entry): Pass file name to "top" module creation 
        call.
        * mflib/safedb.mf4: Require status, not "#include" it.

2009-09-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Clean-up file inclusion code.

        * configure.ac: Call AC_PROG_LN_S.
        * mfd/Makefile.am: Rename status.mfh to status.mf
        (install-data-local): Create a link to status.mfh, for
        compatibility.
        * mfd/gram.y (print_syntax_tree): Test attempt to print all
        modules.
        * mfd/mailfromd.h (struct module): New member incl_sources.
        * mfd/pp.c (incl_sources): Removed.
        (source_lookup): Search in top_modules->incl_sources.
        (parse_include): Remove include_once kludge. Both include and
        include_once are now handled by lex_new_source, as previously.
        * mfd/symbols.c (import_confun): Remove spurious diagnostics.
        (module_init): Initialize all members.
        (module_free): Destroy incl_sources.
        * mflib/sieve.mfh: Rename to sieve.mf
        * mflib/Makefile.am: Rename sieve.mfh to sieve.mf
        (install-data-local): Create a link to sieve.mfh, for
        compatibility.
        * tests/Makefile.am: Remove status.mfh to status.mf

        * mflib/match_cidr.mf, mflib/match_dnsbl.mf, 
        mflib/match_rhsbl.mf, mflib/sockmap.mf, tests/etc/catch.rc,
        tests/etc/catch01.rc, tests/etc/poll-1.rc, tests/etc/poll.rc:
        Use require instead of #include_once.

2009-09-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * mfd/gram.y (constdecl): Allow static/public qualifiers before
        const.
        * mfd/mailfromd.h (define_constant): Add `flags' argument.
        (module_push, advance_line): New prototypes.
        * mfd/symbols.c (define_constant): Take `flags' argument.
        * mflib/Makefile.am (check-am): New rule.
        * mflib/match_dnsbl.mf: Include status.mfh
        * mflib/match_rhsbl.mf: Likewise.

2009-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * mfd/main.c (add_pp_option): Initialize ext_pp_options.
        * lib/version.c: Update copyright year.

2009-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement `static' and `public' qualifiers.

        * mfd/gram.y: Handle new keywords: STATIC PUBLIC MODULE
        (moddecl): New rule.
        (decl): Allow qualifiers before FUNC
        (vardecl): Allow qualifiers before TYPE.
        (qualifiers): New rule.
        * mfd/lex.l (static, public, module): New keywords.
        (symbit_to_qualifier): New function.
        * mfd/mailfromd.h (VAR_*): Rename to SYM_*
        (SYM_STATIC, SYM_PUBLIC): New bitmasks.
        (struct mf_symbol): New member `flags'.
        (struct variable): Remove flags.
        (struct module): New members `dclname' and `flags'.
        (symbit_to_qualifier): New proto.

        * mfd/bi_vars.m4, mfd/drivers.c, mfd/pp.c, mfd/snarf.m4: Reflect
        the above changes.
        * mfd/symbols.c (alloc_entry): Properly initialize struct
        mf_symbol.
        (import_selfun): Additional conditions.

        * mflib/dns.mf4, mflib/gettext.mf, mflib/heloarg_test.mf, 
        mflib/is_ip.mf, mflib/match_cidr.mf, mflib/match_dnsbl.mf, 
        mflib/match_rhsbl.mf, mflib/revip.mf, mflib/sa.mf, 
        mflib/sockmap.mf, mflib/spf.mf, mflib/strip_domain_part.mf, 
        mflib/valid_domain.mf: Fix indentation. Use `static' as
        appropriate.

        * doc/mailfromd.texi: Document new keywords.
        * elisp/mfl-mode.el (mfl-keywords): Add new keywords.

2009-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement module system.

        * lib/transform.c: New file.
        * lib/Makefile.am (libmf_a_SOURCES): Add transform.c
        * lib/libmf.h (struct syment): Remove field `data', add
        `refcnt'.
        (syment_free_hook): New extern.
        (symtab_lookup_or_install_entry): New function.
        (symtab_free): Rename to symtab_destroy.
        (symtab_selfun, symtab_errfun, symtab_confun)
        (symtab_cpyfun): New typedefs.
        (symtab_import): New proto.
        (transform_t): New typedef.
        (transform_append_t, transform_reduce_t): New typedefs.
        (transform_error_string, transform_compile)
        (transform_free, transform_string): New functions.
        * lib/symtab.c (syment_alloc): New function.
        (symtab_free_syment): Honor reference count.
        (symtab_rehash): Bugfix.
        (symtab_get_index): New function.
        (symtab_lookup_or_install): Rewrite using symtab_get_index.
        (symtab_lookup_or_install_entry): New function.
        (symtab_create): Allocate tab.
        (symtab_free): Rename to symtab_destroy.
        (symtab_import): New function.

        * mfd/gram.y: Move inclusion of obstack.h to mailfromd.h Reflect
        changes to symbol tables.
        (%union): New member import_rule_list
        (REQUIRE, IMPORT) New tokens.
        (require): New rule.
        (builtin_variable_install): Move to symbols.c
        * mfd/lex.l: Move inclusion of obstack.h to mailfromd.h
        (lex_buffer_pop): Do not increment line number after popping. It
        is done before pushing the context.
        (lex_new_source_0): Argument is const.
        (lex_new_source): First argument is const.
        (advance_line): External.
        (#require): Deprecated.
        (require,import): New keywords.
        (from): New keyword (was in <ONBLOCK> before).
        (yywrap): Pop module.
        * mfd/mailfromd.h: Include obstack.h
        (SYMENT_STRUCT): New define.
        (struct mf_symbol): New structure.
        (struct builtin, struct literal, struct pragma): Use
        SYMENT_STRUCT.
        (struct function, struct variable)
        (struct constant): Inherit from mf_symbol.
        (stab_module): New extern.
        (stab_function, stab_variable, stab_constant): Remove. These are
        now per-module tables.
        (symbol_resolve_alias): New proto.
        (enum import_type, struct import_rule)
        (struct import_rule_list): New data types.
        (import_rule_create): New function.
        (enum module_namespace, struct module)
        (struct module_list): New data types.
        (top_module): New extern.
        (MODULE_SYMTAB, TOP_MODULE_SYMTAB): New defines.
        (require_module): New function.
        (assign_locus, lex_new_source): Change signature.
        * mfd/pp.c: Move inclusion of obstack.h to mailfromd.h
        (begin_module): New function.
        (parse_include): Include_once is synonimous to #require. Use
        begin_module to actually switch contents in this case.
        (parse_require): Call begin_module.
        (require_module): New function.
        (assign_locus): Change signature.
        * mfd/prog.c: Move inclusion of obstack.h to mailfromd.h Reflect
        changes to symbol tables.
        * mfd/symbols.c (alloc_entry): Set refcnt to 1
        (free_entry): New function.
        (import_rule_create, import_rules_free)
        (import_rules_eval): New functions.
        (stab_function, stab_variable, stab_constant): Remove. These are
        now per-module tables.
        (import_builtin_variables, module_import_symbols): New
        functions.
        (top_module, module_stack): New globals.
        (module_init, module_create)
        (module_free, module_add_submodule)
        (module_has_submodule, module_push)
        (module_pop, set_top_module, pop_top_module): New functions.
        (init_symbols): Set syment_free_hook. Initialize top_module.
        (free_symbols, init_variable)
        (function_lookup_or_install,function_install
        (install_alias, literal_lookup, constant_lookup): Reflect
        changes to symbol tables. Handle aliases.
        (builtin_variable_install): New function (from gram.y)

        * mfd/db.c, mfd/engine.c, mfd/main.c, mfd/pragma.c, mfd/spf.c :
        Move inclusion of obstack.h to mailfromd.h

        * mfd/drivers.c: Reflect changes to symbol tables.

        * etc/mailfromd.mf, mflib/heloarg_test.mf,
        * mflib/match_dnsbl.mf, mflib/match_rhsbl.mf,
        * mflib/spf.mf, mflib/valid_domain.mf, tests/etc/catch.rc,
        tests/etc/catch01.rc, tests/etc/cidr.rc: Use `require', without
        #.

2009-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rewrite symbol tables.

        * lib/symtab.c: New file.
        * lib/Makefile.am (libmf_a_SOURCES): Add symtab.c
        * lib/libmf.h: Add symtab prototypes and declarations.
        * mfd/Makefile.am (mailfromd_SOURCES): Replace symtab.c with
        symbols.c.
        * mfd/symtab.c: Removed.
        * mfd/symbols.c: New file (partly based on symtab.c).
        * mfd/db.c (db_format_enumerate): Change signature.
        * mfd/gram.y: Replace calls to symbol_enumerate with 
        symtab_enumerate.
        (forget_autos): Update calls to variable_replace. Use
        symtab_remove directly, instead of the removed function
        find_and_remove.
        * mfd/lex.l (variable_or_const): Rewrite.
        * mfd/mailfromd.h (struct function): New member `alias'. Remove
        owner.
        (SYM_ macros): Remove.
        (symbol_enumerator_t, symbol_enumerate): Remove.
        (stab_builtin, stab_function, stab_variable)
        (stab_literal, stab_constant, stab_pragma): New externs.
        (init_symbols): New proto.
        (variable_replace): Change signature.
        (dbfmt_enumerator_t): New typedef.
        (db_format_enumerate): Change signature.
        * mfd/main.c (db_fixup_name_enumerator)
        (db_proc_enumerator, db_format_enumerator): Change signatures.
        (main): Call init_symbols.
        * mfd/prog.c (function_counter, function_lister): Ignore
        aliases.
        (print_code): Use symtab_enumerate.
        * po/POTFILES.in: Update.
        * NEWS: Update.

2009-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add milter connection patch for Sendmail-8.14.3

        * etc/sendmail-8.14.3.connect.diff: New file.
        * doc/mailfromd.texi: Document new patch.

2009-09-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * doc/upgrade.texi: Document MAILFROMD_DEPRECATION.
        * mfd/main.c: Remove spurious semicolon.
        * mfd/pp.c (pp_extrn_start): Print debug info on level >= 2.
        (preprocess_input): Add missing return.

2009-09-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Rewrite preprocessing algorithm.

        The internal preprocessor is removed. Inclusion directives
        (#include, #include_once and #require) are handled directly in
        the lexer. External preprocessor is called for each input file
        separately. This gives a lot of advantages:
         1. The m4 namespace is kept clean. No unwanted m4 definitions
         propagate between the files.
         2. No need to fixup input line numbers.
         3. End of each compilation unit is handled separately,
         which allows to implement static variables.
         4. Cleaner code.

        * mfd/lex.l (struct inctx): New struct.
        (input_file_id): New variable
        (YY_INPUT): Remove.
        (inctx_locate)
        (lex_buffer_push, lex_buffer_pop): New functions.
        (lex_new_source_0, lex_new_source): New functions.
        (lex_close_source): New function.
        (input_line): Remove variable.
        (is_stdin, source): Remove functions.
        (yywrap): Rewrite.
        (%% - grammar): Remove line number correction. Hanlde #include,
        #include_once and #require directives in place.
        * mfd/mailfromd.h (DEF_EXT_PP): New define (from main.c).
        (ext_pp_options, ext_pp_options_given): New externs.
        (struct input_file_ident): New declaration (from pp.c).
        (pp_extrn_start, pp_extrn_shutdown)
        (parse_include, parse_require): New prototypes.
        (pp_fill_buffer, source, pp_make_argcv)
        (pp_init, pp_done): Remove.
        (pp_extrn_start, pp_extrn_shutdown): Change proto.
        (preprocess_input): Change proto.
        (alloc_ext_pp, assign_locus, lex_new_source): New protos.
        * mfd/main.c (DEF_EXT_PP): Move to mailfromd.h
        (alloc_ext_pp): Incorporate all -I options. Move function to
        pp.c.
        (main): Update call to preprocess_input.
        * mfd/pp.c: Remove internal preprocessor functions.
        (parse_include, parse_require): Use lex_new_source to actually
        load the file.
        (pp_extrn_start, pp_extrn_shutdown, preprocess_input): Rewrite.

        * mfd/gram.y (parse_program): Call lex_new_source.

2009-09-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * pies/pies.c (_cb_action, _cb_redir): Fix arguments to 
        mu_cfg_format_error.

2009-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * NEWS: Document milter_client_* and milter_server_* builtin
        variables.
        * Makefile.am: Silent ChangeLog rule.

2009-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve testsuite.

        * tests/testsuite.at (MF_CHECK_PROG): New macro.
        (MF_CHECK_TEXT, MF_RUN_TEXT): Unify calls to mailfromd.

        * tests/accept.at, tests/arg.at, tests/bctx00.at, 
        tests/bctx01.at, tests/curmsg.at, tests/declvar.at, 
        tests/farg.at, tests/fctx00.at, tests/fctx01.at, 
        tests/macros.at, tests/ml.at, tests/numrcpt.at, tests/prec.at,
        tests/reject.at, tests/shadow.at, tests/strings.at,
        tests/tempfail.at: Rewrite giving the filter script in place.

        * tests/ack.at, tests/catch.at, tests/catch01.at, 
        tests/cidr1.at, tests/cidr2.at, tests/cidr3.at, tests/cond01.at,
        tests/cond02.at, tests/cond03.at, tests/cond04.at,
        tests/cond05.at, tests/cond06.at, tests/invcidr.at,
        tests/invcidr2.at, tests/invip.at, tests/invip2.at,
        tests/relayed01.at, tests/relayed02.at, tests/switchn1.at,
        tests/switchn2.at, tests/switchn3.at, tests/switchn4.at,
        tests/switchs1.at, tests/switchs2.at, tests/switchs3.at,
        tests/switchs4.at: Replace AT_CHECK with the equivalent
        MF_CHECK_PROG

        * tests/hasmx.at, tests/hostname.at, tests/poll.at, 
        tests/poll01.at, tests/poll02.at, tests/poll03.at, 
        tests/rescname.at, tests/resolve.at: Unify calls to mailfromd

        * tests/hdr-cap.at, tests/hdr-mul.at, tests/ismx.at: Use EX_
        codes instead of hardcoded ints.

        * tests/etc/accept.rc: Remove.
        * tests/etc/arg.rc: Remove.
        * tests/etc/farg.rc: Remove.
        * tests/etc/macros.rc: Remove.
        * tests/etc/ml.rc: Remove.
        * tests/etc/numrcpt.rc: Remove.
        * tests/etc/prec.rc: Remove.
        * tests/etc/reject.rc: Remove.
        * tests/etc/sa01.rc: Remove.
        * tests/etc/sa02.rc: Remove.
        * tests/etc/sa03.rc: Remove.
        * tests/etc/sa04.rc: Remove.
        * tests/etc/shadow.rc: Remove.
        * tests/etc/size.rc: Remove.
        * tests/etc/strings.rc: Remove.
        * tests/etc/tempfail.rc: Remove.
        * tests/etc/var.rc: Remove.
        * tests/etc/Makefile.am (RCFILES): Remove the above files.

2009-09-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * mfd/lex.l: Fix handling of variable references starting on new
        line in here-documents.
        * tests/ml01.at: New testcase.
        * tests/Makefile.am, tests/testsuite.at: Add ml01.at.

2009-09-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * mfd/main.c (alloc_ext_pp): Fix coredump.

2009-09-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix ismx and getmx built-ins.

        * mfd/dns.c (comp_ipbuf): Remove.
        (getmxip): Change return type.
        * mfd/mailfromd.h (getmxip): Change prototype.
        * mfd/prog.c (dump_result): Fix output.
        * mfd/bi_dns.m4 (getmx): Rewrite using new getmxip.
        (primitive_ismx): Likewise.
        * NEWS: Update.
        * doc/mailfromd.texi (getmx): Update description.

2009-09-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix --no-preprocess.

        * mfd/main.c (ext_pp_options_given): New variable.
        (alloc_ext_pp): Use ext_pp_options_given to decide whether to
        allocate ext_pp.
        (parse_opt): Set ext_pp_options_given if -D or -U were used.

2009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix testsuite.

        * tests/testsuite.at (MAILFROMD_OPTIONS): New definition
        (MF_CHECK_TEXT, MF_RUN_TEXT, AT_MTA_TEST_X)
        (AT_MTA_TEST): Always pass MAILFROMD_OPTIONS to mailfromd.
        (AT_WITH_MAILFROMD_OPTIONS): Always prepend $MFOPTS $MFADDOPTS

2009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix return from gacopyz_client_sockname


2009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * gacopyz/context.c (gacopyz_server_sockname)
        (gacopyz_client_sockname): Tolerate ctx==NULL.
        * gacopyz/gacopyz.h (gacopyz_client_sockname): change return
        type to int.
        * mfd/engine.c (priv_get): Check return from 
        gacopyz_client_sockname.

2009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        New variables and functions for identifying milter client and
        server addresses.

        * gacopyz/gacopyz_priv.h (struct smfi_str): New members addr and 
        addrlen.
        * gacopyz/context.c (gacopyz_server_sockname)
        (gacopyz_client_sockname): New functions.
        (gacopyz_context_loop): Get connection source address (sockaddr) 
        and its length as arguments. Store them in ctx.
        (gacopyz_handle_connection): Pass connection source address and
        its length to gacopyz_context_loop.
        * gacopyz/gacopyz.h (gacopyz_context_loop): Remove useless
        prototype.
        (gacopyz_client_sockname, gacopyz_server_sockname): New
        prototypes.

        * mfd/bi_vars.m4 (milter_client_family, milter_client_address)
        (milter_server_family, milter_server_address): New built-in
        variables.
        (define_milter_address): New macro.
        * mfd/engine.c (priv_get): Initialize milter_client_* and
        milter_server_* MFL variables.
        (MFAM_STDIO, MFAM_UNIX, MFAM_INET): Move to mailfromd.h
        * mfd/mailfromd.h (MFAM_STDIO, MFAM_UNIX, MFAM_INET): New
        defines.
        (set_milter_client_address)
        (set_milter_server_address): New prototypes.
        * mfd/snarf.m4 (MF_VAR_SET_STRING): Optimize the use of $2.

2009-09-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve configuration and creation of mailfromd-newconf.sh 
        script.

        * NEWS: Update.
        * configure.ac: Produce xz and lzma compressed distributions.
        * doc/mailfromd.texi: Update.
        * mfd/main.c (struct option_cache): New member "conffn".
        (option_cache): Set conffn for negative-, positive-, and 
        rates-expire-interval.
        (set_option): Prefer conffn over write_change_conf.
        (cb_negative_expire_interval, cb_positive_expire_interval)
        (cb_rates_expire_interval): Remove.
        (mf_cfg_param): Remove positive-expire-interval, 
        negative-expire-interval and rates-expire-interval.

2009-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve the upgrade conversion script. Update docs.

        * NEWS: Update.
        * doc/Makefile.am (check-config, check-sub-config): New goals.
        (all-check-docs): Depend on the above.
        * doc/mailfromd.texi: Document syslog-async configuration 
        statement.
        * doc/pragma-option.texi: Move the ignore block to
        doc/mailfromd.texi.
        * doc/upgrade.texi (5x0-600): Describe the changes and the 
        proposed conversion procedure.
        * mfd/main.c (rename_legacy_file): new variable.
        (close_change_conf): Improve the created script.
        (cb_db_expire_interval): Bugfix.
        (database_section_param): File statement is mu_cfg_callback.
        (main): Set rename_legacy_file if necessary.

2009-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.

        * doc/pragma-option.texi: Fix xrefs to conf-database.

2009-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Define the `database' configuration statement. Document new
        configuration.

        * doc/pragma-option.texi: New file.
        * doc/pragma-database.texi: New file.
        * doc/Makefile.am (mailfromd_TEXINFOS): Add new files.
        * doc/mailfromd.texi: Document configuration file.
        * doc/upgrade.texi (5x0-600): New section.
        * mfd/gram.y (pragma_database): Add calls to write_db_config.
        * mfd/main.c (write_db_config): New function.
        (close_change_conf): Handle 'G' records.
        (cb_relay_file): Remove duplicate function.
        (cb_db_expire_interval, cb_db_positive_expire_interval)
        (cb_db_negative_expire_interval): New functions.
        (database_section_param): New configuration file statement:
        "database".
        (database_cfg_init): New function.
        (main): Call database_cfg_init.
        * mfd/mailfromd.h (write_db_config): New prototype.

2009-09-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Expand built-in constants in pragma arguments.

        * mfd/lex.l: Allow %{...} form for built-in constants.
        (builtin_const_value): New function.
        (builtin_const): do not expect null-terminated string as input.
        * mfd/mailfromd.h (builtin_const_value): New function.
        * mfd/pragma.c: (nextword, expand_builtin)
        (find_double_underscore, is_delim)
        (expand_string, expand_text): New functions.
        (parse_pragma): Expand built-in constants in pragma string.

2009-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * mfd/main.c (close_change_conf): Fix warning message.

2009-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement relayed-domain-file configuration statement.

        * mfd/main.c: Implement relayed-domain-file configuration
        statement.

2009-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Mark all `#pragma option's as deprecated. Create a script for
        fixing them.

        * mfd/main.c (option_deprecated): Remove.
        (open_change_conf,write_change_conf)
        (close_change_conf): New functions.
        (config_statement_type): New function.
        (MFD_OPTION_DEPRECATED): Remove. Not used any more.
        (option_cache): All options are deprecated.
        (enable_pragma_deprecation_warning): New function.
        (set_option): Create a script for fixing configuration files.
        (main): Call close_change_conf.
        (mf_cfg_param): New statements: expire-interval, 
        positive-expire-interval, negative-expire-interval, 
        rates-expire-interval.
        * etc/mailfromd.mf: Remove deprecated pragmas.

2009-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * mfd/bi_io.m4 (open): Default open mode is read-only.

2009-08-31  Sergey Poznyakoff  <gray@gnu.org.ua>

        Begin separation of configuration from filter script.

        The purpose is to separate compilation entities (filter script 
        and files included therein), from the actual runtime
        configuration. This changeset introduces a separate mailfromd
        configuration file, located in SYSCONFDIR/mailfromd.conf. The
        filter script is called mailfromd.mf and located in SYSCONFDIR
        as well (but perhaps it should better be located elsewhere?) The
        old script name, mailfromd.rc, was a misnomer since its suffix
        suggested that the file was a configuration file, which as a
        matter of fact it was not. However, if this "legacy" file is
        present and readable, it is used and a warning message is
        issued.

        All `#pragma option' statements are considered deprecated, and
        explicit warnings are issued if they are used in the script
        file.

        * NEWS: Update.
        * mfd/appinit.c: New file.
        * mfd/Makefile.am (mailfromd_SOURCES): Add appinit.c
        * mfd/gram.y (pragma_option): Update call to set_option. Pass
        NULL locus to initialize_variable.
        (initialize_variable): Issue the "variable already initialized" 
        warning only if previous initialization was in a source file, 
        not from command line or a configuration statement.
        * mfd/mailfromd.h (DEFAULT_SCRIPT_FILE): Change definition.
        (LEGACY_SCRIPT_FILE): New define.
        (DEFAULT_CONFIG_FILE): New define.
        (set_option): Takes four arguments.
        (mu_app_rcfile): New extern.
        (mfd_app_init): New prototype.
        * mfd/main.c (need_config): Rename to need_script.
        (struct option_cache): Rename `cumulative' to `flags'. New
        member `confkw'.
        (set_option): Fourth argument specifies whether the function was
        called from a pragma option handler.
        (set_cmdline_option): New define.
        (struct arguments): New data type.
        (init_arguments, flush_trace_module)
        (flush_arguments, destroy_trace_item): New functions.
        (parse_opt): Use set_cmdline_option to set overridable options.
        (cb_trace_program): New callback.
        (mf_cfg_param): New statements: syslog-async, trace-actions, 
        trace-program, transcript.
        (main): Use mfd_app_init instead of mu_app_init. Initialize 
        mu_app_rcfile beforehand. Use legacy filter script
        (mailfromd.rc), if present.
        * mfd/prog.c (enable_module_trace): take 2 args, the 2nd one 
        specifying the length of the first.
        (disable_module_trace): Likewise.
        (toggle_prog_trace): New function.
        (enable_prog_trace,disable_prog_trace): Rewrite using 
        toggle_prog_trace.
        * tests/atlocal.in (MFADDOPTS): New variable.
        (checkstatedir): Define MFADDOPTS.
        (mailfromd_start): Pass $MFADDOPTS to the mailfromd invocation.
        * tests/etc/config.in: Remove.
        * tests/etc/Makefile.am: Remove config.in
        * tests/etc/dns.rc: Remove inclusion of config.rc
        * tests/etc/greylist-ct.rc: Likewise.
        * tests/etc/greylist.rc: Likewise.
        * tests/greylist-ct.at: Likewise.
        * tests/hasmx.at, tests/hostname.at, tests/ismx.at, 
        tests/rescname.at, tests/resolve.at, tests/testsuite.at: Pass
        $MFADDOPTS to mailfromd invocations.
        * tets/invcidr.at: update stderr expectation
        (see changes to initialize_variable in gram.y)
        * tests/invcidr2.at: Likewise.
        * etc/mailfromd.rc: Rename to etc/mailfromd.mf
        * etc/Makefile.am: Rename mailfromd.rc to mailfromd.mf.

2009-08-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update tests/.gitignore


2009-08-28  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix handling of Milter abort commands. Introduce "precious"
        variables.

        * mfd/engine.c (mlfi_abort): Call env_init_dataseg and reset
        md->helostr.
        * mfd/gram.y (variable_count): Initialize to 0.
        (precious_count): New variable.
        (PRECIOUS): New token.
        (vardecl): Opional qualifier may appear before data type.
        (builtin_variable_install): Take 4th argument: addrptr.
        (_ds_variable_fun): Remove function.
        (_ds_variable_count_fun, _ds_variable_fill_fun): New functions.
        (vtab_comp): New function.
        (dataseg_layout): Revamp computation of variable offsets in the
        data segment. Ensure all precious variables are placed after
        non-precious ones. Set dvarsize to the number of the latter.
        * mfd/lex.l: Recognize the `precious' keyword.
        * mfd/mailfromd.h (VAR_PRECIOUS): New constant.
        (struct variable.addrptr): New member.
        (builtin_variable_install): Change proto.
        (env_init_dataseg): New proto.
        * mfd/prog.c (dvarsize): New global.
        (env_init_dataseg): New function.
        (init_dataseg): Take 2 arguments.
        * mfd/prog.h (dvarsize): New extern.
        * mfd/snarf.m4 (MF_VAR): Optional third argument gives 
        additional flags.
        * mfd/symtab.c (init_variable): Initialize addrptr.
        * mtasim/mtasim.c (get_input_line): Call add_history before
        adding \n to the string.
        (smtp): Call gacopyz_srv_abort in reaction to RSET.
        * mfd/bi_vars.m4 (ehlo_domain,mailfrom_address): Mark as
        precious.

        * tests/rset.at: New file.
        * tests/Makefile.am: Add rset.at.
        * tests/testsuite.at (AT_MTA_TEST_FILTER_SCRIPT): Fix 
        definition. Include rset.at.

        * NEWS: Update.
        * configure.ac: Version 5.2.90
        * doc/mailfromd.texi: Document `precious' keyword.

2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix diagnostic and help messages.

        1. Option descriptions in `--help' output do not constitute
          conceptual sentences. Therefore, they should not begin
          with a capital letter, nor end with a final point. 2.
        According to standards.texi, a diagnostic message in a
          non-interactive program "should not begin with a capital
        letter
          when it follows a program name and/or file name, because that
          isn't the beginning of a sentence.  (The sentence conceptually
          starts at the beginning of the line.)  Also, it should not end
          with a period."

        Affected files:

        * gacopyz/gacopyz.c
        * gacopyz/proc.c
        * gacopyz/server.c
        * gacopyz/smfi.c
        * mfd/bi_db.m4
        * mfd/bi_dns.m4
        * mfd/bi_io.m4
        * mfd/bi_ipaddr.m4
        * mfd/bi_mail.m4
        * mfd/bi_other.m4
        * mfd/bi_poll.m4
        * mfd/bi_sa.m4
        * mfd/bi_string.m4
        * mfd/cache.c
        * mfd/db.c
        * mfd/dnscache.c
        * mfd/drivers.c
        * mfd/engine.c
        * mfd/gram.y
        * mfd/lex.l
        * mfd/main.c
        * mfd/mu_dbm.c
        * mfd/optab.opc
        * mfd/prog.c
        * mfd/rate.c
        * mfd/symtab.c
        * mtasim/mtasim.c
        * mtasim/openat-die.c
        * pies/pies.c
        * pies/progman.c
        * pmult/pmult.c
        * smap/smap.c
        * tests/ashadow.at
        * tests/bctx00.at
        * tests/fctx00.at
        * tests/hdr-gete.at
        * tests/invcidr.at
        * tests/invcidr2.at
        * tests/shadow.at

2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.2

        * NEWS, configure.ac: Raise version number.

2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.

        * mfd/main.c (parse_opt): Add missing break.
        (cb_include_path): Fix use of improper variable in MU_CFG_LIST
        branch.
        * am/aggr.m4 (IU_CHECK_MEMBER): Remove improper use of dnl.
        * doc/Makefile.am (check-builtins, check-mflib): Do not split
        sed expressions over multiple lines: Makefile format cannot
        handle it properly.
        * doc/mailfromd.texi: Update.
        * bootstrap: Do not apply `silentize' to gnu/gnulib.mk. Latest 
        gnulib takes care of it itself.

2009-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add mfd/bi_getpw.m4


2009-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix definition of `next'.

        * mfd/drivers.c (struct loop_stack): Replace `begjmp' with
        `nxtjmp'.
        (enter_loop): Reflect this.
        (code_type_next): Likewise.
        (code_type_loop): Rewrite jump fixup for `next' chain.

        * tests/next01.at, tests/next02.at: New testcases.
        * tests/Makefile.am: Add next01.at and next02.at
        * tests/testsuite.at: Likewise.

        * NEWS, doc/mailfromd.texi: Update

2009-06-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement getpw.* interfaces

        * mfd/bi_getpw.m4: New file.
        * mfd/Makefile.am (M4_FILES): Add bi_getpw.m4
        * doc/Makefile.am (check-builtins): Take into account
        @deftypefnx
        * NEWS, doc/mailfromd.texi: Update

2009-06-15  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes

        * mfd/bi_io.m4 (read): Add terminating zero.
        * mflib/match_dnsbl.mf (match_dnsbl): Return 0 if address is not
        resolved.
        * mflib/sockmap.mf (sockmap_single_lookup): Fix typo.

2009-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve conditional building of pmult.

        * configure.ac (PMULT_COND): New condition
        (ENABLE_PMULT): Rename subst variable.
        * pmult/Makefile.am: Remove subst variable.
        * Makefile.am (SUBDIRS): Include pmult conditionally
        (ChangeLog rule): Improve formatting.
        * NEWS: Improve wording.

2009-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * mfd/bi_dns.m4 (dns_getname): Missed call to MF_OBSTACK_BEGIN.
        * mfd/prog.c (runtime_stack_trace): Prevent coredump on arriving
        to pc == 0.

2009-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix.

        * mfd/bi_db.m4 (db_prop_lookup): Fix conditional. Reported by
        Jan Rafaj.

2009-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement e_eof exception code (based on patch by Jan Rafaj).

        * doc/mailfromd.texi: Document e_eof.
        * mfd/Makefile.am (status.mfh): Define dependencies.
        * mfd/bi_io.m4 (read_stream_delim): Return number of bytes read.
        (read, getdelim, getline): Raise e_eof on EOF.
        * mfd/mailfromd.h (mfe_eof): New exception code.
        * tests/eof.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add eof.at
        * tests/testsuite.at (MF_RUN_TEXT): New define. Include eof.at.

2009-06-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * configure.ac: Check for struct pmilter_S.pmfi_fdmax
        * doc/pmult.texi: Document new pmult configuration statements.
        * pmult/pmult.c: Make pmilter.pmfi_fdmax configurable.

2009-06-17  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * pies/pies.c (main): Change main loop to do..while, otherwise a
        signal arriving before entering the loop might cause the program
        to terminate.
        * pmult/pmult.c (internal_macro_p): New function.
        (collect_stage_symbols): Do not report internal macros as
        untranslatable.
        * mfd/gram.y (register_macro): Copy macro name to allocated
        storage.

2009-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fixes.

        * mfd/engine.c (child_start): modify program title.
        * mfd/main.c (environ): extern.

2009-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix and improve termination actions in pies.

        * pies/pies.h (MAX_RETURN_CODE): Remove.
        (STATUS_SIG_BIT, STATUS_CODE): New defines
        (struct action): New fields next, nstat, status, command.
        (struct component): Keep singly-linked list of termination 
        actions.
        * pies/progman.c (run_command): New function.
        (progman_cleanup): Redo iteration over termination actions.
        * pies/pies.c (return_code_cfg_param): Pass offsets in struct
        component.
        (create_action): Accept signal numbers (SIG.* or SIG\+[0-9]+) in
        tag.
        (return_code_section_parser): Update.
        (pies_check_status): Set *pid before returning
        pies_status_stale.
        * doc/pies.texi: Document changes.
        * NEWS: Updated.

2009-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement socket I/O and sockmaps in mflib.

        * mfd/bi_io.m4 (struct io_stream): Add cleanup and cleanup_data.
        (close_stream): Use those members.
        (read_stream_line): Remove.
        (read_stream_delim): New function.
        (open_program_stream): Add the `env' argument.
        (open_file_stream): Likewise.
        (open_parsed_inet_stream, open_inet_stream): New functions.
        (alloc_streams): Update declaration of opf and the call thereof.
        (open): Prefix @ in first argument designates the connection
        URL.
        (read,getdelim): New functions.
        * mflib/Makefile.am (inc_DATA): Add sockmap.mf
        * mflib/sockmap.mf: New function.
        * doc/mailfromd.texi: Document new functions.
        * NEWS: Update.

2009-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>

        Reflect program state in the ps(1) output.

        * mfd/main.c (main): Call mf_proctitle_init
        * mfd/engine.c (mlfi_connect, mlfi_helo, mlfi_envfrom)
        (mlfi_envrcpt, mlfi_data, mlfi_header, mlfi_eoh)
        (mlfi_body, mlfi_eom)
        (mlfi_abort, mlfi_close): Call mf_proctitle_format to reflect 
        the program state in the ps output.
        * NEWS: Update.

2009-06-05  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * pmult/pmult.c (client_block_begin): Set default logmask to
        '>info'
        (pmult_connect): Close gsrv if pmult_std_reply fails. This fixes
        FD leak.
        * gacopyz/gacopyz.c, mfd/dns.h, mfd/dnsbase.c, mfd/engine.c,
        mtasim/mtasim.c, pmult/pmult.c: Add typecasts between 
        signed/unsigned char*.

2009-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.1.91

        * configure.ac, NEWS: Version 5.1.91
        * pmult/pmult.c: Bugfix

2009-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        MeTA1-related improvements.

        * configure.ac: Check for pmilter_S.pmfi_thrmax_[sh]. Requires 
        28/0009-pmilter-configurable-maxthr.diff.
        * pmult/pmult.c: New configuration statements: max-threads-soft 
        and max-threads-hard.
        * pies/pies.c (_cm_include_meta1): Fix coredump on syntax errors 
        in meta1.conf.

2009-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement `localdomain' function + several improvements.

        * NEWS: Update.
        * etc/mailfromd.rc: Use localdomain to determine the domain 
        name. Remove the `#error' statement.  Hopefully, this file can
        be used as is.
        * mfd/bi_gethostname.m4 (gethostname): Add an optional argument.
        * mfd/gram.y: Handle function declarations with only optional 
        arguments, e.g.: func foo(; string bar)
        (mailfromd_test): Add missing env_init calls.
        * mfd/lex.l: Remove trailing newline before displaying the
        `#error' diagnostics.
        * mflib/localdomain.mf: New file.
        * mflib/Makefile.am (inc_DATA): Add localdomain.mf.
        * mflib/safedb.mf4 (safedb_verbose): New variable.
        (safedbmap, safedbdel): New function.
        (safedbget, safedbput): Verbosely print exceptions caught if 
        safedb_verbose is set.

2009-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add new debugging function.

        * mfd/bi_mudebug.m4: New file.
        * mfd/Makefile.am (M4_FILES): Add bi_mudebug.m4
        * NEWS, doc/mailfromd.texi: Update.

2009-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor organizational changes.

        * elisp/Makefile.am (LISPSRC): Add obfemail-mode.el
        * elisp/mfl-mode.el (mfl-mode): Fix docstring.
        * THANKS: Use obfemail mode to encode emails.

2009-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor fix


2009-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        More work on `silent rules' mode

        * bootstrap (silent_rules_prog): Preserve leading whitespace
        verbatim, when inserting the AM_V variables. Suggested by Ralf
        Wildenhues. Optionally insert the definitions of 
        AM_DEFAULT_VERBOSITY, AM_V_GEN and AM_V_at: useful for 
        po/Makefile.in.in
        (silentize): New function.
        (slurp): Call silentize Call silentize on po/Makefile.in.in.
        * doc/Makefile.am, etc/Makefile.am, pies/Makefile.am,
        pmult/Makefile.am, tests/Makefile.am, tests/etc/Makefile.am: Add
        silent rule markers.

2009-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Switch to `silent rules' mode

        * bootstrap (slurp): Convert gnulib Makefile.am to support
        silent rules.
        * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules. Enable
        silent rules by default.
        * gacopyz/Makefile.am, mfd/Makefile.am: Add silent rules
        markers.

2009-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfix

        * mfd/mu_dbm.c (mu_dbm_errcall_fcn): Fix arguments for BDBv4.

2009-05-20  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * am/gcc.m4: New file.
        * configure.ac: Raise autotools requirements to 2.63/1.11 Call
        MF_GCC_QUIRKS.
        * gacopyz/gacopyz.c (ctx_free): Change return type.

2009-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement GeoIP support.

        * NEWS: Update.
        * configure.ac: Version 5.1.90 New option --with-geoip
        (GEOIP_LIBS): New AC_SUBST
        * doc/mailfromd.texi: Document geoip functions.
        * mfd/bi_geoip.m4: New file.
        * mfd/Makefile.am (M4_FILES): Add bi_geoip.m4
        (LDADD): Add GEOIP_LIBS.
        * mfd/mailfromd.h (pp_define): New function.
        * mfd/main.c (pp_define): New function.
        * mfd/snarf.m4 (MF_DEFINED, MF_OPTVAL): Fix error diagnostics.
        (MF_COND): New macro.
        (MF_INIT): Handle MF_COND sources.

2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix typo in docs


2009-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Raise version to 5.1


2009-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change

        * mfd/bi_db.m4: Fix comment.
        * pies/progman.c: Use _exit in child processes.  This is a work
        over a fault in MU design: it registers the pidfile removal
        function via atexit.

2009-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Bugfixes.

        * doc/mailfromd.texi: Fix declaration of `uname'
        * mtasim/mtasim.c: Fix handling of header continuation. When
        sending headers and body to the milter, consistently use \r\n
        line terminators.

2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix diagnostics spelling


2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.0.94

        * NEWS, configure.ac: Update.
        * mfd/prog.c (env_free_captured): env->bi_priv_array can be
        NULL.

2009-05-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement functional notation for reply actions

        * NEWS, doc/mailfromd.texi: Update.
        * mfd/drivers.c (print_type_result, mark_type_result)
        (optimize_type_result, code_type_result): Rewrite.
        * mfd/gram.y: Rewrite action rules.
        * mfd/lex.l (CODE,XCODE): Remove.
        * mfd/opcodes (RESULT): Takes one immediate parameter.
        (instr_result): Get arguments from stack.

2009-05-11  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement some system information functions.

        * mfd/bi_gethostname.m4: New file.
        * NEWS, doc/mailfromd.texi: Update.
        * mfd/Makefile.am (M4_FILES): Add bi_gethostname.m4.
        * mfd/bi_system.m4 (uname): New function.
        * mfd/prog.c (heap_obstack_cancel, heap_obstack_base): New
        function.
        * mfd/prog.h: Likewise.
        * mfd/snarf.m4 (MF_OBSTACK_BASE, MF_OBSTACK_CANCEL): New defuns.
        * mtasim/mtasim.c (stop_mailfromd): Reset signal handler before 
        doing kill, so that waitpid works on hosts with BSD signal
        semantics.

2009-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement current header access functions.

        * mfd/bi_curhdr.m4: New file: implementation of current header
        functions.
        * mfd/Makefile.am (M4_FILES): Add bi_curhdr.m4
        * mfd/bi_mbox.m4 (mailbox_open): Work over MU lossage.
        * mfd/bi_msg.m4 (bi_drop_current_message): Remove.
        (drop_current_message): New function.
        * mfd/mailfromd.h (env_reposition): New prototype.
        * mfd/msg.h (bi_drop_current_message): Remove.
        * mfd/prog.c (struct eval_environ.reposition): New member.
        (env_reposition): New function. Work over MU lossage.
        (env_capture_start): Call env_free_captured to release any 
        module private captured data. Reset env->reposition to 0.
        (env_capture_write): If env->reposition is set, move stream
        pointer to the end of stream.
        (struct builtin_priv.free_capture): New member.
        (builtin_priv_register): Take 3 arguments.
        (env_free_captured): New function.
        * mfd/prog.h (builtin_priv_register): Update proto.
        * mfd/snarf.m4 (MF_DECLARE_DATA): Get at most 3 arguments.

        * NEWS, doc/mailutils.texi: Document new functions.
        * tests/etc/hdr.mts: New file (message transfer session).
        * tests/etc/hdr2.mts: Likewise.
        * tests/etc/Makefile.am (EXTRA_DIST): Add new files.
        * tests/hdr-all.at: New testcase.
        * tests/hdr-cap.at: New testcase.
        * tests/hdr-count.at: New testcase.
        * tests/hdr-gete.at: New testcase.
        * tests/hdr-getn.at: New testcase.
        * tests/hdr-itr.at: New testcase.
        * tests/hdr-mul.at: New testcase.
        * tests/Makefile.am (TESTSUITE_AT): Add new testcase.
        * tests/atlocal.in (TESTDIR): New variable.
        * tests/testsuite.at (MTASIM_DEFS): New define.
        (AT_MTA_TEST): Rename to AT_MTA_TEST_FILTER.  All uses updated.
        (AT_MTA_TEST_SCRIPT,AT_MTA_TEST_FILTER_SCRIPT): New defines. 
        Include new testcases.
        * tests/arg.at, tests/curmsg.at, tests/numrcpt.at, 
        tests/reject.at, tests/tempfail.at: Updated.

2009-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix the docs


2009-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs.

        * NEWS: Document Milter v.6 support.
        * doc/mailfromd.texi: Likewise.
        * doc/smap.texi: Document smap.

2009-05-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix exception handling code (saveex/restex).

        * mfd/drivers.c (code_type_funcdecl): Exmask handling and jump
        fixups are handled within codegen.
        (code_type_progdecl): Update call to codegen.
        * mfd/gram.y (codegen): Take an extra argument specifying the
        exception mask to handle.  Unless it is zero, code saveex/restex
        pair around the main code.  This makes sure local allocations do
        not disturb exception handling code. Also, take care of jump
        fixup here.
        (mailfromd_test): Fix bug in numeric argument passing.
        * mfd/prog.c (instr_saveex): Provide additional debugging 
        diagnostics (temporary).
        (dump_saveex): Fix retrieving of the exmask (seftover from
        earlier version).
        (instr_memstk, instr_xmemstk, instr_deref)
        (instr_ston, instr_ntos, instr_cmp)
        (instr_logand, instr_logor, instr_logxor)
        (instr_add, instr_sub, instr_mul)
        (instr_div, instr_regex, instr_regcomp)
        (instr_funcall): Make sure PC and stack adjustments occur after
        outputting trace info.

2009-05-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement v6 negotiation in pmult.

        * pmult/pmult.c (define_single_macro): Check for table overflow.
        (collect_stage_symbols, collect_symlists): New functions.
        (pmult_negotiate) [HAVE_SM_PMFI_SETMACS]: Call collect_symlists.

2009-05-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement v6 negotiation on the server side.

        * gacopyz/stagenames.c: New file.
        * gacopyz/Makefile.am (libgacopyz_a_SOURCES): Add stagenames.c.

        * gacopyz/gacopyz.c (gacopyz_context_loop): Free req_macros.
        (gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
        * gacopyz/gacopyz.h (SM_LM_VRS_MAJOR, SM_LM_VRS_MAJOR)
        (SM_LM_VRS_PLVL, GACOPYZ_SM_MKVER): New macros.
        (macro_index): Rename to gacopyz_stage. All uses updated.
        (smfi_version): New proto.
        (gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
        (gacopyz_stage_name): New declaration.
        (gacopyz_srv_get_required_macros): New proto.
        (gacopyz_srv_set_version, gacopyz_srv_set_protocol)
        (gacopyz_srv_set_actions): 2nd argument is unsigned long.
        * gacopyz/server.c (struct gacopyz_srv): New member req_macros.
        (gacopyz_srv_get_required_macros): New function.
        (gacopyz_srv_destroy): Free req_macros.
        (gacopyz_srv_negotiate): Read macros.
        * mfd/gram.y (milter_state_name): Removed. Use
        gacopyz_stage_name instead.

        * mtasim/mtasim.c: New options: --gacopyz-log, --milter-proto,
        --milter-acts.

        * doc/mtasim.texi, doc/mailfromd.texi: Update.

2009-05-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement v6 negotiation on the server side.

        * gacopyz/stagenames.c: New file.
        * gacopyz/Makefile.am (libgacopyz_a_SOURCES): Add stagenames.c.

        * gacopyz/gacopyz.c (gacopyz_context_loop): Free req_macros.
        (gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
        * gacopyz/gacopyz.h (SM_LM_VRS_MAJOR, SM_LM_VRS_MAJOR)
        (SM_LM_VRS_PLVL, GACOPYZ_SM_MKVER): New macros.
        (macro_index): Rename to gacopyz_stage. All uses updated.
        (smfi_version): New proto.
        (gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
        (gacopyz_stage_name): New declaration.
        (gacopyz_srv_get_required_macros): New proto.
        (gacopyz_srv_set_version, gacopyz_srv_set_protocol)
        (gacopyz_srv_set_actions): 2nd argument is unsigned long.
        * gacopyz/server.c (struct gacopyz_srv): New member req_macros.
        (gacopyz_srv_get_required_macros): New function.
        (gacopyz_srv_destroy): Free req_macros.
        (gacopyz_srv_negotiate): Read macros.
        * mfd/gram.y (milter_state_name): Removed. Use
        gacopyz_stage_name instead.

        * mtasim/mtasim.c: New options: --gacopyz-log, --milter-proto,
        --milter-acts.

        * doc/mtasim.texi, doc/mailfromd.texi: Update.

2009-05-07  Sergey Poznyakoff  <gray@gnu.org.ua>

        Implement Milter protocol version 6.

        * gacopyz/Makefile.am (trans.h): Pass -vheader_file argument to
        the trans.awk script.
        * gacopyz/dummy.c (smfilter): Update initialization.
        * gacopyz/gacopyz.c (trans_fixup): New function.
        (convert_sfsistat): Handle new codes.
        (make_optneg_buf): New function.
        (send_reply): Handle SMFIP_NR_* flags. Update SMFIC_OPTNEG case.
        (shan_optneg): Implement milter 1.0 (proto 6)
        (gacopyz_context_loop): Call trans_fixup.
        (ok_to_send): Use the negotiated aflags.
        (gacopyz_addrcpt_par, gacopyz_chgfrom)
        (gacopyz_setsymlist): New functions.
        * gacopyz/gacopyz.h (GACOPYZ_VERSION_MAJOR): Raise to 2.
        (SMFI_VERSION): Set to 0x01000000
        (SMFI_PROT_VERSION, SMFI_PROT_VERSION_MIN): New defines.
        (SMFIR_ADDRCPT_PAR, SMFIR_CHGFROM): New defines.
        (SMFIP_NR_HDR, SMFIP_SKIP, SMFIP_RCPT_REJ): New defines.
        (SMFIP_NR_CONN, SMFIP_NR_HELO, SMFIP_NR_MAIL)
        (SMFIP_NR_RCPT, SMFIP_NR_DATA, SMFIP_NR_UNKN)
        (SMFIP_NR_EOH, SMFIP_NR_BODY, SMFIP_HDR_LEADSPC)
        (SMFI_DEFAULT_PROT, SMFIF_CHGFROM)
        (SMFIF_ADDRCPT_PAR): New defines.
        (SMFIS_NOREPLY, SMFIS_SKIP, SMFIS_ALL_OPTS): New constants.
        (enum macro_index): New data type, from gacopyz_priv.h
        (SMFIM_CONNECT, SMFIM_HELO, SMFIM_ENVFROM)
        (SMFIM_ENVRCPT, SMFIM_DATA, SMFIM_EOM)
        (SMFIM_EOH): New defines.
        (struct gacopyz_milter_descr): New member: xxfi_negotiate
        (smfi_addrcpt_par, smfi_chgfrom, smfi_setsymlist)
        (gacopyz_addrcpt_par, gacopyz_setsymlist)
        (gacopyz_chgfrom): New protos.
        * gacopyz/gacopyz_priv.h (struct macro_assoc): Rename flags to
        pflags. New members: aflags, version, mta_pflags, req_macros.
        * gacopyz/server.c (struct gacopyz_srv): Remove flags.
        (struct gacopyz_srv.version, acts, proto): Change type.
        (gacopyz_srv_create): Change defaults.
        (gacopyz_srv_negotiate): Rewrite.
        * gacopyz/smfi.c (smfi_addrcpt_par, smfi_chgfrom)
        (smfi_setsymlist): New functions.
        * gacopyz/trans.awk (END): Print the state_nr_mask array.

        * mfd/bi_db.m4: Add missing includes.
        * mfd/engine.c: Implement mlfi_negotiate.
        * mfd/gram.y (register_macro): Arrange stored macros by gacopyz
        macro index. All uses updated.
        (get_stage_macro_string): New function.
        * mfd/mailfromd.h (get_stage_macro_string): New proto.
        (check_tbf_rate): Add proto.

2009-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Update docs


2009-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor changes.

        * NEWS: Update.
        * doc/mailfromd.texi: Reorder material.
        * doc/upgrade.texi: New file.
        * doc/fdl.texi, doc/gacopyz.texi, doc/strftime.texi: Move 
        sectioning commands to the main source.
        * etc/mailfromd.rc: Reflect recent changes.
        * mfd/lex.l: Change semantics of __statedir__ and __preproc__.
        Introduce __defstatedir__ and
        __defpreproc__.

2009-05-04  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.0.93

        * NEWS, configure.ac: Raise patchlevel to 93.
        * doc/mailfromd.texi: Document new features.
        * mfd/tbf_rate.c (tbf_rate_format_struct): Change dbid to
        `tbf'.

2009-05-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Improve the rate function.

        * mfd/bi_other.m4 (rate): Add second optional parameter: a
        threshold.
        * mfd/mailfromd.h (get_rate): Change prototype.
        * mfd/rate.c (get_rate): Take two more parameters: threshold and
        interval. Return rate as long. Do not increment the hit counters
        if the observed rate is higher than the threshold. Expire the
        record if no mails were sent during a time longer than
        `interval' seconds.
        * mflib/rateok.mf: New file.
        * mflib/Makefile.am (inc_DATA): Add rateok.
        * NEWS: Update

2009-05-03  Sergey Poznyakoff  <gray@gnu.org.ua>

        Minor change.

        * NEWS: Update.
        * .gitignore: Update.

2009-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>

        Add an alternative implementation of the greylist function.

        * mfd/bi_db.m4: Add a new implementation of the greylist
        function, proposed by Con Tassios. In this implementation, the
        database keeps the time the greylisting period is set to expire, 
        rather than the time the greylisting was activated. This allows
        to implement is_greylisted function. The implementation to use
        is selected by #pragma greylist.
        * tests/greylist-ct.at: New file. Testcase for Con Tassios style
        greylist.
        * tests/Makefile.am (TESTSUITE_AT): Add greylist-ct.at.
        * tests/greylist.at: Update.
        * tests/testsuite.at: Include greylist-ct.at.
        * tests/etc/greylist-ct.rc: New file.
        * tests/etc/Makefile.am (RCFILES): Add greylist-ct.rc.
        * THANKS: Fix alphabetical ordering.

2009-05-02  Sergey Poznyakoff  <ben@netservers.co.uk>

        Implement token bucket filter.

        * mfd/tbf_rate.c: New file.
        * gnulib.modules: Add inttypes.
        * mfd/Makefile.am (mailfromd_SOURCES): Add tbf_rate.c.
        * mfd/bi_other.m4 (tbf_rate): New function.
        * mfd/mailfromd.h (tbf_rate_format): New global.
        * mfd/main.c (db_format_setup): Set tbf_rate_format.

2009-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.0.92


2009-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

        Do not use RFC822 filter.

        * mfd/bi_sa.m4 (write_822): New function to replace MU's
        "rfc822" filter, which is a pile of junk (sorry). Improves
        performance, besides.
        (spamd_send_stream): Use write_822 instead of the filter. See
        above.
        * mfd/engine.c: Fix comment.
        * mfd/mailfromd.h (mem_search): New proto.
        * mfd/prog.c (env_capture_write): Use mem_search.

2009-04-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Version 5.0.91


2009-04-18  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix CRLF/LF inconsistencies. Fix bug in SAVEEX/RESTEX.

        * mfd/prog.c (instr_restex): Bugfix. Use pop to restore catch 
        addresses. This also fixes the resulting tos value.
        * mfd/bi_body.m4 (current_message): Use mf_stream_to_message
        * mfd/bi_sa.m4 (spamd_send_stream): Return int. Recode
        delimiters to
        "\r\n".
        (sa): Check return from spamd_send_stream. Adjust reported
        stream size.
        (clamav): Check return from spamd_send_stream.
        * mfd/bi_sieve.m4 [MAILUTILS_VERSION_NUMBER < 1290]: Remove
        * mfd/mailfromd.h (env_get_line_count, mf_stream_to_message):
        New functions.
        * mfd/prog.c (struct eval_environ.line_count): New member.
        (env_get_line_count): New function.
        (env_capture_start): Init eval_environ.line_count
        (env_capture_write): Recode "\r\n" -> "\r". Update
        eval_environ.line_count.

        * mtasim/mtasim.c (send_body): New function.
        (smtp): Use CRLF as line terminator in message body.
        * pmult/pmult.c (collect_headers): strip off \r's.

2009-04-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Document #pragma dbprop


2009-04-09  Sergey Poznyakoff  <gray@gnu.org.ua>

        Fix strict callout method.

        * mfd/engine.c (check_mx_records): Propagate mf_failure,
        mf_temp_failure, and mf_not_found returns to the caller.
        (method_strict): Dismiss return mf_not_found from
        check_mx_records, if there were no MXs.

2009-04-08  Sergey Poznyakoff  <gray@gnu.org.ua>

        The `dbprop' pragma allows to define database properties.

        * mfd/Makefile.am (mailfromd_SOURCES): Add pragma.c
        * mfd/pragma.c: New file.
        * mfd/bi_db.m4: New pragma `dbprop'.
        (dbmap, dbget, dbput, dbdel): take database properties from
        dbprop settings.
        (dbfirst): Open database for reading only.
        * mfd/gram.y (pragma_regex, pragma_option, pragma_stacksize)
        (pragma_database): Rewrite to match new pragma interface.
        (pragma_setup): New function.
        * mfd/mailfromd.h (SYM_PRAGMA): New symbol type.
        (install_pragma, lookup_pragma): New protos.
        (parse_pragma): Arg is const.
        * mfd/main.c (main): Call pragma_setup.
        * mfd/snarf.m4 (MF_PRAGMA): New define.
        * mfd/symtab.c ((install_pragma, lookup_pragma): New functions.

        * .gitignore, tests/.gitignore: Update.

2009-03-19  Sergey Poznyakoff  <ct@swin.edu.au>

        Bugfix

        * mfd/bi_db.m4 (greylist): Initialize greylist_seconds_left for
        expired records.

2009-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>

        Finish migration to Git.

        * Makefile.am (dist-hook): Create ChangeLog.
        (ChangeLog): New rule.
        * NEWS, README-alpha, README-hacking: Update
        * gnulib.modules: Add gitlog-to-changelog
        * ChangeLog: Rename to ChangeLog.svn

        * tests/hasmx.at, tests/hostname.at, tests/ismx.at, 
        tests/poll.at, tests/poll01.at, tests/poll02.at, 
        tests/poll03.at, tests/rescname.at, tests/resolve.at, 
        tests/testsuite.at: Skip tests if the network is down.

2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the current_message function and subprocess handling in mtasim.
	
	* mtasim/mtasim.c (stop_mailfromd): Wait for the mailfromd child
	to terminate and analyze its return status.

	* mfd/bi_msg.m4 (bi_drop_current_message): New function.
	* mfd/prog.c (env_capture_start): Call bi_drop_current_message if
	the capture stream already exists (i.e. when starting processing
	2nd or later message in a session).
	* mfd/msg.h (bi_drop_current_message): New prototype.
	* gacopyz/server.c (srv_connect): Retry attempts to connect
	if they fail with ECONNREFUSED. Implement 5-second timeout.
	
	* tests/testsuite.at (MAILFROMD_OPTIONS): New define.
	(AT_MTA_TEST): Pass MAILFROMD_OPTIONS to mtasim invocation.
	(AT_WITH_MAILFROMD_OPTIONS): New macro.
	Include curmsg.at.
	* tests/curmsg.at: New file
	* tests/etc/Makefile.am (RCFILES): Add size.rc
	* tests/etc/size.rc: New file

2009-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/prog.c (env_capture_start): Do not create the stream if it
	already exists. Bug reported by Con Tassios.
	* mfd/bi_sieve.m4 (sieve): Don't free unexistend Sieve machines.
	* THANKS: Update
	* NEWS: Update
	
2009-02-20  Sergey Poznyakoff  <gray@mirddin.farlep.net>

	* mfd/bi_io.m4 (write): Fix spurious runtime exceptions, raised if
	the third argument was not given.

2009-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/engine.c (concat_args): Do not print debugging info, it is
	done by the caller.
	(mlfi_envfrom, mlfi_envrcpt): Include argv[0] in the debugging
	info. This complements the yesterday's change.

2009-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/engine.c (mlfi_envfrom, mlfi_envrcpt): Fix second argument,
	so that it does not include $1.
	* THANKS: Update.
	* mflib/sa.mf (sa_format_report_header): Improve formatting.

2009-02-18  Sergey Poznyakoff  <gray@mirddin.farlep.net>

	* mfd/gram.y (state_parms): Fix number of arguments to
	envfrom and envrcpt.  Bug reported by Patrick Dalais
	<patrick AT depari.co.za>.
	
	* tests/fromargs.at, tests/rcptargs.at: New tests.
	* tests/testsuite.at, tests/Makefile.am: Add new tests.
	* tests/etc/ack.rc: Increase stack allocation.

2008-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 5.0
	
	* configure.ac, NEWS: Version 5.0.
	* doc/mailfromd.texi, doc/pies.texi, doc/pmult.texi: Update.
	* doc/Makefile.am (check-builtins): Account for
	MF_DEFUN_VARARGS_NO_PROM.
	
2008-12-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix sprintf, accidentally broken on 2008-07-14.
	
	* mfd/symtab.c (va_builtin_install): Initialize flags to 0.
	(va_builtin_install_ex): Remove capture and varargs, replace them
	with flags.
	* mfd/snarf.m4 (__mf_defun,MF_DEFUN_VARARGS): Reflect changes to
	va_builtin_install_ex.
	(MF_DEFUN_VARARGS_NO_PROM): New defun.
	* mfd/gram.y (cast_arg_list): Add 4th argument, controlling
	argument type promotion.
	* mfd/drivers.c (code_type_builtin): Use builtin.flags.
	* mfd/mailfromd.h (MFD_BUILTIN_*): New defines.
	(struct builtin): Remove capture and varargs, replace them
	with flags.
	* mfd/bi_sprintf.m4: Define sprintf as MF_DEFUN_VARARGS_NO_PROM.

2008-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Documentation and minor fixes.

	* pies/pies.c, pies/progman.c, pies/meta1gram.y, pies/pies.h,
	pies/meta1lex.l: Normalize output redirection terminology, fix the
	debug levels.
	* pmult/pmult.c: Fix error message
	* doc/pies.texi: Document the configuration.

2008-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/engine.c, mfd/gram.y, mfd/mailfromd.h, mfd/prog.c,
	mfd/prog.h, gacopyz/gacopyz.h, gacopyz/context.c,
	gacopyz/gacopyz.c: Add const qualifiers to gacopyz_getsymval,
	gacopyz_replace_body and derived functions.

	Emulate Sendmail behavior for SMFIR_REPLBODY.
	
	* pmult/pmult.c (struct pmult_priv_data): New members hdrbuf and
	body_itr. Remove body_off.
	(pmult_append_body_chunk): Set bucket size to PMILTER_CHUNK_SIZE.
	(pmult_clear): Free new pmult_priv_data members.
	(pmult_free): Call pmult_clear first.
	(pmult_eom): Initialize pmult_priv_data members for eventual body
	replacement.
	(pmult_msg_rplc): First send headers, then body.
	
2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Initial implementation of body replacement.
	
	* mfd/engine.c (run_msgmod): Handle body_repl
	* mfd/gram.y (msgmod_opcode_str): Likewise.
	* mfd/mailfromd.h (enum msgmod_opcode): New constant body_repl.
	* mfd/bi_body.m4 (replbody): New function (proof-of-concept).
	
	* pmult/pmult.c (struct pmult_priv_data): New fields body_off,
	body_chunks.
	(pmult_append_body_chunk): New function.
	(cb_reply): Handle SMFIR_REPLBODY
	(pmult_std_reply): Likewise.
	(pmult_clear): Destroy body_chunks
	(pmult_eom): Request body replacement if body_chunks is not NULL.
	(pmult_msg_rplc,pmult_msg_rplc_stat): New functions.
	(pmilter): Register pmult_msg_rplc and pmult_msg_rplc_stat.

2008-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (component_cfg_param): New statement settle-timeout.
	* pies/progman.c (recompute_alarm): New static;
	(prog_start): Start the component only if all of its prerequisites
	are running.
	(progman_recompute_alarm): New function.
	(progman_start): Reset recompute_alarm to 0.
	(check_stopping): New function.
	(progman_wake_sleeping): Handle also status_stopping and
	status_enabled. Recompute alarm before leaving.
	(prog_start_prerequisites): Return 0 or 1 depending on whether all
	prerequisites have been started.
	(prog_stop): Raise recompute_alarm for stopping components.
	(progman_cleanup): Force status_enabled before attepmting to
	start a component.
	(progman_cleanup): Add a \n after debugging message.
	Run progman_wake_sleeping unlsess expect_term is set.
	* pies/meta1gram.y (translate_node_list): Force settle-timeout =
	1.
	* pies/pies.h (struct component.settle_timeout): New member.

	* pies/pies.c (main): New options --force, --dump-prereq and
	--dump-depmap.
	Refuse to start if another instance is already running.
	(pies_check_status): New function.
	(pies_status): Rewrite using pies_check_status.
	* pies/progman.c (component_fixup_depend): Bugfix: move
	mu_list_append off the conditional.
	(progman_dump_prereq, progman_dump_depmap): New functions.
	* pies/meta1gram.y (yyerror): Return 0.
	* pies/pies.h (progman_dump_prereq, progman_dump_depmap): New
	protos.
	(meta1_parser_set_debug, meta1lex, meta1error)
	(meta1parse): Likewise.
	
	* pies/progman.c (print_dep): New function.
	(progman_build_depmap): Call print_dep to facilitate fixing cyclic
	dependencies.
	(prog_start_prerequisites): Fix debugging output.
	Remove spurious second loop (was it a typo or copy-paste
	leftover?)
	(prog_stop_dependents): Fix debugging output.
	(progman_dump_stats): Avoid race conditions between running and
	querying instances.

2008-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Document and improve pmult.
	
	* pmult/pmult.c (debug_level): Remove.
	(struct pmult_priv_data): Remove debug. Use pmult_debug instead.
	(macro_trans): Define Sendmail compatibility macros cn_issuer and
	cn_subject.
	(builtin_macros): Fix typo in "multiplexer".
	(define_macros): Rewrite.  The "define-macros" statement takes
	exactly two arguments, each of which can be either a string or a
	list of strings.
	* doc/values.texi, doc/mailfromd.texi, doc/pmult.texi: Update.

	* doc/Makefile.am (check-fixmes): Scan all texinfo documents.
	
	Fix handling of retranslators.
	
	* pies/pies.c (main): Call progman_build_depmap and
	progman_create_sockets before starting up components.
	* pies/progman.c (struct prog): New member `retr'.
	(destroy_prog): New function.
	(retr_tag): Change signature. Fix erroneous condition for
	xalloc_die.
	(register_retr): Return prog. Make static. Initialize idx
	with -1.
	(update_retr): Register retranslator, if necessary.
	(progman_register_retranslators): Remove.
	(register_prog0): 2nd argument: index.
	(register_prog): Do not create socket at once.
	(prog_start): Remove debugging fprintf.
	(progman_accept): Update call to register_prog0.
	(progman_create_sockets): New function.
	(progman_start): Remove calls to progman_register_retranslators
	and progman_build_depmap. They must be done only once.
	(prog_stop_retranslators): New function.
	(prog_stop_dependents): Call prog_stop_retranslators.
	(progman_cleanup): Remove dangling retranslators.
	* pies/pies.h (progman_create_sockets): New prototype.

2008-11-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve pies.
	
	* pies/pies.h (create_socket): Change proto to 3 arguments.
	* pies/socket.c (create_socket): Take two additional arguments.
	Allow to configure ownership and mode of created UNIX sockets.
	* pies/progman.c (register_prog, prog_start): Update calls to
	create_socket.

	Implement ctype functions.
	
	* mfd/bi_ctype.m4: New function.
	* mfd/Makefile.am (inc_DATA): Add bi_ctype.m4.
	* doc/Makefile.am (check-builtins): Update source sed expression.
	* doc/mailfromd.texi, NEWS: Document ctype functions.

2008-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve handling of program privileges.
	
	* lib/libmf.h (struct mf_privs): New data type.
	(get_user_groups, mf_priv_setup, mf_epriv_setup): New prototypes.
	* lib/userprivs.c (get_user_groups, mf_priv_setup)
	(mf_epriv_setup): New functions.
	
	* smap/smap.c: If user is specified, switch to effective uid/gid,
	in order for msrv to create files with right privileges, on one
	hand, and to be able to create pidfile in root-owned directories
	(e.g. /var/run), on the other hand. This requires todays snapshot
	of Mailutils.

	* pies/pies.h (struct pies_privs_data): Remove
	(struct component): Change type of `privs' to struct mf_privs.
	(priv_setup): Remove.
	* pies/pies.c: Use mf_priv* stuff to manipulate privileges.
	* pies/progman.c: Likewise.
	* pies/meta1gram.y (list): allow for trailing comma.

2008-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mfd/bi_string.m4 (index) (rindex): Third argument (start index)
	can equal string length.
	* pies/Makefile.am (LDADD): Add MF_PROCTITLE_LIBS
	* lib/proctitle.c (mf_proctitle_format):
	* pies/progman.c (progman_register_retranslators): Register
	retranslators only for retr_syslog.
	(open_retranslator): Do not prepend program name to the proctitle.
	It is done automatically by the library.
	* lib/proctitle.c: Declare environ.
	Define __progname if not defined in libc.
	(mf_proctitle_init): Set __progname.
	(mf_proctitle_format): Prepend program name to the proctitle.

	Implement file output redirection.
	
	* pies/pies.h (enum retr_type): New constants.
	(struct retranslator): New type.
	(struct component): Change type of retr to struct retranslator.
	All uses updated.
	* pies/pies.c (_cb_retr): Takes two arguments:
	redirection type and file name or syslog priority.
	(make_full_name): New function.
	(component_verify): Check retr file names.
	* pies/progman.c (redirect_to_file): New function.
	(open_retranslator): Handle file redirects.
	(prog_start): Open /dev/null in wronly mode.
	* pies/meta1gram.y (create_retr_node): New function.
	(translate_node_list): Create default "stderr" statement.

	* lib/libmf.h (mf_proctitle_init): New prototype.
	* lib/proctitle.c: Include stdio.h
	* bootstrap: Fix invocation of aclocal.

	Implement setproctitle functionality for pies.
	
	* am: New directory.
	* am/aggr.m4, am/debug.m4: New files (from acinclude.m4)
	* am/proctitle.m4: New file.
	* acinclude.m4: Removed.
	* configure.ac: Call MF_PROCTITLE.
	* lib/libmf.h (mf_proctitle_format): New prototype.
	* lib/proctitle.c: New file.
	* lib/Makefile.am (libmf_a_SOURCES): Add proctitle.c.
	* Makefile.am (ACLOCAL_AMFLAGS): Add -I am
	
	* pies/pies.c (main): Call mf_proctitle_init.
	* pies/progman.c (retr_tag): Rewrite in a safer way.
	(open_retranslator): Set program title in child.
	
	Allow to complement existing components (useful for MeTA1
	includes).
	
	* pies/pies.c (component_verify): New function.
	(component_section_parser): Call component_verify.
	(_cm_include_meta1): Reduce the tree at once.
	(parse_meta1_conf): Not needed any more.
	* pies/progman.c (progman_register_retranslators): New function.
	(pies/progman.c): Do not register retranslators: wait until the
	entire config is parsed and do that in progman_start.
	(progman_start): Call progman_register_retranslators.

2008-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement dependencies/prerequisites in MeTA1.
	
	* pies/pies.c (component_cfg_param): Rename "depend" to
	"prerequisites". Add new keyword "dependents".
	(pies_cfg_param): New keyword "limits".
	* pies/progman.c (struct prog): Rename "depend" to "prereq".
	(prog_start_dependencies): Rename to prog_start_prerequisites
	(register_prog0): Do not fill prereq. This will be done later,
	when all dependencies are resolved.
	(prog_rebuild_prerequisites): New function.
	(prog_start): Per-component limitis override system-wide ones.
	(component_fixup_depend, fixup_prerequisites)
	(rebuild_prerequisites): New functions.
	(progman_build_depmap): Call fixup_prerequisites and
	rebuild_prerequisites.
	(prog_stop_dependent): Rename to prog_stop_dependents.
	* pies/meta1gram.y: Implement restart_dependencies.
	* pies/pies.h (struct component): Rename "depend" to "prereq". Add
	new member "depend".
	(pies_limits): New extern.
	
	Implement MeTA1 configuration file parser. 
	
	* configure.ac: Require Mailutils 1.9.93
	* doc/mailfromd.texi, NEWS: Update.
	* pies/pies.c (_cb_depend): Accept list argument.
	(component_cfg_param): New statement: program.
	(pies_cfg_param): New statements: include-meta1 and
	meta1-queue-dir.
	(parse_meta1_conf, pies_cfg_verifier): New functions.
	(main): Set mu_app_cfg_verifier. Call parse_meta1_conf.
	* pies/progman.c (progman_lookup_component): New function.
	(prog_start): Pass program name (eventually differing from
	argv[0]).
	* pies/pies.h (struct component): New member `program'.
	(progman_lookup_component): New prototype.
	* pies/meta1gram.y, pies/meta1lex.h, pies/meta1lex.l: New files.
	* pies/Makefile.am (pies_SOURCES): Add meta1gram.y and
	pies/meta1lex.h.
	(noinst_HEADERS, AM_YFLAGS, AM_LFLAGS): New variables.

2008-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (component_cfg_param, pies_cfg_param): New keyword:
	allgroups.
	(pies_add_allgroups): New function.
	* pies/limits.c: Fix debug statements.
	* pies/progman.c (build_depmap): Rename to
	progman_build_depmap. Make extern, for future use. All callers
	updated.
	* pies/pies.h (progman_build_depmap): New proto.

	* pies/pies.c: Fix ACTION_COMPRELOAD
	* pies/progman.c (open_retranslator): (child) close all open
	sockets, except p[0] (pipe input).
	(prog_start): Bugfix: mark sleeping components with
	status_sleeping.
	(prog_start): stdout retranslation works for pies_comp_pass_fd.
	Mark started processes with status_enabled.
	(progman_start): Start enabled processes if pid is 0.
	(progman_stop_component): Correctly handle various status types.
	(progman_dump_stats): Mark processes being stopped.
	
	* pies/pies.c (component_cfg_param): Bugfix.
	(component_section_parser): Initialize comp->pass_fd_socket
	* pies/progman.c (prog_start): Listen on the socket, if in pass_fd
	mode. Avoid closing it.
	(prog_stop_all): Kill programs being stopped.

	* pies/socket.c (pass_fd): Check return from open_unix_socket.
	
2008-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite pies to incorporate into it the functionality of inetd and
	mcp.
	
	* pies/pies.c (pmult_debug): Rename to pies_debug.
	(pies_acl): New global.
	(component_cfg_param): New statements: mode, socket,
	pass-fd-socket, acl, limits.
	(component_section_parser): Allocate comp. Check its consistency
	on mu_cfg_section_end.
	(pies_cfg_param): New statement: acl.
	(main): Call mu_acl_cfg_init. Use pies_pause instead of pause.
	* pies/limits.c: New file.
	* pies/progman.c (enum prog_status): New status: status_listener.
	(struct prog): Keep a pointer to the original struct component,
	instead of copying its fields (except for depend, which is copied
	anyway). All uses updated.
	(prog_lookup_by_socket, unlink_prog, register_prog0): New
	functions.
	(prog_start, progman_cleanup, progman_stop_component): Rewrite to
	take into account various component modes.
	(pies_check_acl): New function.
	(progman_accept): New function.
	* pies/pies.h (limits_record_t): New typedef.
	(enum pies_comp_mode): New constants.
	(struct component): New members: mode, limits, socket_url,
	pass_fd_socket, acl.
	(progman_accept): New proto.
	(pies_pause, register_listener, pass_fd, open_socket)
	(parse_limits, set_limits): New protos.
	* pies/Makefile.am (pies_SOURCES): Add limits.c and socket.c
	* pies/socket.c: New file.

	* configure.ac: Check for msg_control and msg_accrights in struct
	msghdr.
	* acinclude.m4 (IU_CHECK_MEMBER, IU_CHECK_MEMBERS): New macros
	(from inetutils).
	
	* pies/progman.c (prog_start): Bugfix.
	* pmult/pmult.c (pmult_cfg_param): New configuration statement
	pmilter-debug.
	(main): Call sm_pmfi_setdbg.

2008-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add built-in functions for accessing Sendmail macros.
	
	* mfd/mailfromd.h (env_get_macro): New proto.
	* mfd/prog.c (env_get_macro): New function.
	* mfd/bi_macro.m4: New file.
	* mfd/Makefile.am (M4_FILES): Add bi_macro.m4.
	* NEWS: Update.
	* doc/mailfromd.texi (Macro access): New subsubsection.

2008-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/bi_mbox.m4 (mailbox_open): Take 2nd optional argument,
	specifying the permissions of the mailbox, if it is to be created.
	* doc/mailfromd.texi, NEWS: Update.

2008-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (collect_headers): Rewrite state machine to ensure
	each state either advances off or switches to the new state.
	(builtin_macros): New variable.
	(translate_macros0): Add builtin macros.
	(pmult_connect): Do not free priv_data even if some milters
	returned rejects.

2008-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/lex.l: Fix default condition for ML state, introduced on
	2008-11-02.

2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mflib/verp.mf (verp_extract_user): Pass email as the first
	argument.
	* doc/mailfromd.texi: Update.
	* doc/Makefile.am: Add pmult.texi
	* doc/pmult.texi: New file.
	* mfd/lex.l: %% and $$ in quoted strings are replaced by single %
	and $, correspondingly.
	* NEWS: Update.

	Improve docs.
	
	* doc/mailfromd.texi, NEWS: Document `getopt' and run (script)
	mode. 
	* mfd/lex.l: Octal characters can contain 1 to 3 octal characters.
	* mfd/bi_getopt.m4: Allow to specify long options (without short
	option equivalents) that take arguments.
	* mfd/main.c (options): Document optional argument to the `--run'
	option.

2008-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor improvement in the lexer.
	
	* mfd/lex.l (start_locus): New variable.
	(BEGIN_X): New macro.
	Add a rule to ignore any characters at EOF in ML state.
	(yywrap): Report an error if the file is left not in the INITIAL
	state, i.e. EOFs in comments or strings.

	Improve the docs.

	* doc/mailfromd.texi, NEWS: Update.
	
	Minor fix.
	
	* mfd/drivers.c (mark_type_asgn): Mark variable as referenced if
	it is assigned a value.

	Get rid of ml_header.  Gacopyz takes care about the header
	formatting. 
	
	* gacopyz/gacopyz.h (gacopyz_safe_header_value): New proto.
	* gacopyz/gacopyz.c (gacopyz_safe_header_value): New function.
	(gacopyz_header_command): Use gacopyz_safe_header_value to format
	header value.
	* mfd/bi_sa.m4 (sa): Remove unused variable.
	* mfd/bi_string.m4: Remove ml_header.
	* doc/mailfromd.texi: Remove ml_header.
	
	New functions: replstr, ml_header, sa_format_score,
	sa_format_report_header.
	
	* mflib/sa.mf: New file.
	* mflib/Makefile.am (inc_DATA): Add sa.mf
	* mfd/bi_string.m4 (replstr): New function.
	
	* doc/mailfromd.texi: Document new functions.
	* NEWS: Update.

2008-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/bi_string.m4 (rindex): Fix bug introduced on 2008-10-29.

	Implement spamd REPORT in sa.
	
	* mfd/snarf.m4 (MF_OBSTACK_FINISH): New macro.
	* mfd/bi_string.m4 (ml_header): New function.
	* mfd/bi_sa.m4 (spamd_read_line0): New function.
	(spamd_read_line): Remove last argument. Use spamd_read_line0.
	(sa): Take a 3rd optional argument, specirying whether to
	return spam report in sa_keywords.

	Bugfix.
	
	* mfd/gram.y (ADD,REPLACE): Cast 2nd argument to string.
	* mfd/bi_system.m4 (strftime): Add missing MF_OPTVAL.

2008-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (pmult_eom): Get macros from PM_SMST_DOT list.

	* gnulib.modules: Add inttostr
	* smap/smap.c, pies/progman.c, pies/pies.h: Use umaxtostr, instead
	of mu_umaxtostr.

	* pmult/pmult.c (struct pmult_priv_data): New members: argc,
	argv.
	(macro_trans, meta_stage_trans, macrotab, macronames): New
	globals.
	(translate_macros0, translate_macros): New functions.
	(define_macros, define_macros_iter): New functions.
	(_cb_define, request_auth_macros): New functions.
	(pmult_cfg_param): New keyword `define-macro'.
	(pmult_free): Free argv.
	(pmult_negotiate): Use sm_pmfi_setmacs, if available.
	(pmult_connect, pmult_helo, pmult_mail, pmult_rcpt)
	(pmult_data, process_headers, pmult_eom): Use translate_macros.
	(main): Handle want_auth_macros.

	* configure.ac: Check for sm_pmfi_setmacs. This function should
	appear in meta1-1.0.PreAlpha28.0.

2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (collect_headers): Bugfix, following changes
	dated 2008-10-14.

2008-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/bi_string.m4 (index, rindex): Take an optional third
	argument, indicating where to start searching.
	* NEWS, doc/mailfromd.texi: Document changes to index and rindex.
	
2008-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (pmult_std_reply): Handle SMFIR_ACCEPT.
	* configure.ac, NEWS: Raise version patchlevel to 96
	* mfd/drivers.c (mark_type_asgn): Add a comment.
	* mfd/main.c (main): Do not try to start up if script_dump_xref
	was given.

2008-10-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mflib/verp.mf: New file.
	* mflib/Makefile.am: Add verp.mf.

2008-10-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* gacopyz/server.c (gacopyz_srv_abort): Reset state to srv_ready.
	(gacopyz_srv_helo): If called in srv_msgproc, reset the milter
	state by calling gacopyz_srv_abort before sending the command.
	(gacopyz_srv_envfrom): Likewise.

2008-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c: New configuration statement auth-macros.
	(pmult_negotiate): Request auth macros for PM_SMST_MAIL if
	auth-macros was requested.
	(pmult_mail): Translate auth macros if present.

	* gacopyz/server.c (gacopyz_srv_negotiate): Additional
	diagnostics.
	(gacopyz_srv_send_macros): Send macros only for those commands
	that do require them.
	(gacopyz_srv_send_command): Additional diagnostics.
	* gacopyz/gacopyz.c (gacopyz_context_loop): Additional diagnostics.

2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (_cb_log_level): Handle > level specifier (all
	levels from the given one up).
	* gacopyz/gacopyz.h (SMI_LOG_FROM): Handle n==0.

2008-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/progman.c (env_setup): Port new implementation from Rush.
	
	* gnulib.modules: Add c-ctype
	* mtasim/mtasim.c, pies/pies.h, pmult/pmult.c, lib/parsetime.c,
	mfd/lex.l, mfd/gram.y, mfd/mailfromd.h, mfd/spf.c,
	mfd/bi_sprintf.m4, mfd/bi_io.m4, mfd/pp.c, mfd/main.c: Use c-ctype,
	instead of ctype. 

2008-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (enum pmult_msg_state): Add more states.
	(collect_headers): Correctly handle end-of-message marker,
	even though it should never appear here.
	(pmult_msg_handler): Make sure the handler always processes first
	handlers, then body, even if some of these two is missing.

2008-10-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* gacopyz/server.c (gacopyz_srv_eom): Reset state to srv_ready.

	* mfd/engine.c (mlfi_eom): Destroy md->hdr.
	* pmult/pmult.c: Fix comment.
	* NEWS: Update.

2008-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/main.c (read_domain_file): Select first word from each
	line.  This allows to use meta1/mt.

2008-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (component_cfg_param): New configuration statement
	`precious'.
	* pies/progman.c (struct prog): New member `precious'.
	(register_prog): Set precious.
	(prog_start_dependencies): Do not mark disabled precious
	dependencies of a disabled component.
	* pies/pies.h (pies/pies.h): New member `precious'.
	* pies/pies.rcin (mcp): Mark as precious.

	* pies/pies.c (return_code_section_parser): Fix to work with tag
	of any type.
	* pies/pies.rcin: Minor change.

	* configure.ac, NEWS: Raise version number to 4.9.95.

	* pies/pies.c (main): Do cleanup after main action processing and
	only if action == ACTION_CONT.
	* pies/progman.c (struct prog): New member `prev'.
	(link_prog): Maintain doubly-linked list.
	(prog_stop_dependent): Avoid printing diagnostics if there are
	no dependencies to be stopped.
	(prog_stop): Do nothing if prog->pid is zero.
	Do not call prog_stop_dependent, it will be done by
	progman_cleanup. 
	(prog_stop_all): Terminate components from last to first.
	* pies/pies.rcin: Improve example, by adding mcp component.
	
	* pies/pies.c (_cb_depend): Handle single string value.
	(_cb_retr): Fix diagnostic message.
	(_cb_facility): New function.
	(component_cfg_param): New statement `facility'.
	(component_section_parser): Initialize comp.facility to the
	default value.
	* pies/progman.c (struct prog): New member `facility'.
	(register_prog): Initialize facility.
	(open_retranslator): Use master->facility.
	* pies/pies.h (struct component): New member `facility'.

2008-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/progman.c (register_prog): Remove stray semicolon.
	(retr_exit): Use _exit.
	(prog_stop_dependent): Bugfix: stop retranlators as well as
	components.

2008-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac, NEWS: Set patchlevel 94.

	Fix MU configuration file support.
	
        * lib/libmf.h (config_array_to_argv)
	(config_array_to_string, config_cb_timeout): new prototypes.
        * lib/utils.c: New
	* lib/Makefile.am (libmf_a_SOURCES): Add utils.c
	* mfd/gram.y (defer_initialize_variable): Both args are const.
	* mfd/mailfromd.h (defer_initialize_variable)
	(add_include_dir): Change signatures.
	* mfd/pp.c (add_include_dir): Arg is const.
        * pies/pies.c, pmult/pmult.c, mfd/main.c: Rewrite configuration
	file support to match changes in Mailutils.

2008-09-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve stack memory management.

	* mfd/gram.y (strtosize, get_stack_max, get_stack_incr)
	(get_stack_size): New functions.
	(pragma_stacksize): Rewrite. Take maximum stack size as an
	optional third argument.
	* mfd/mailfromd.h (stack_max_size): New declaration.
	(stack_max_size): New function.
	(expand_dataseg): Signal exception if new memory size would be
	greater than the stack size limit.
	* NEWS, doc/mailfromd.texi: Update.

2008-09-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/gram.y (pragma_stacksize): Implement two stack growth
	policies.
	* mfd/mailfromd.h (enum stack_expand_policy): New enum.
	(stack_expand_incr, stack_expand_policy): New global variables.
	* mfd/prog.c (stack_expand_incr)
	(stack_expand_policy): New global variables.
	
	* NEWS: Update.
	* doc/mailfromd.texi (stacksize): Document changes to pragma
	stacksize. 
	* doc/values.texi (STACK-INCR): New value.
	
2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* Makefile.am: Implement a dist-hook, preventing distributing
	an unfinished NEWS file.
	* doc/mailfromd.texi: Document new mfl-mode customization
	variables.
	Add missing index entries.
	* NEWS: Update.
	* elisp/mfl-mode.el: Improve auto-indentation support.
	(mfl-compute-line-indentation): Fix typo.

2008-09-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* Makefile.am (dist-hook): New rule. Test for leftover FIXMEs in
	NEWS.

	* mfd/bi_getopt.m4 (opterr, optopt): New globals.
	(getopt): Handle opterr and optopt.
	(MF_INIT): Initialize opterr to 1.

	* mfd/bi_getopt.m4 (getopt): Use | as a short/long option
	separator.
	Make sure optind/optarg are set before returning EOF.
	* mfd/gram.y (mailfromd_run): Remove superfluous call to
	env_leave_frame.
	* mfd/drivers.c (mark_type_argx, mark_type_vaptr): New functions.
	* mfd/prog.c (env_vaptr): Cast the result.
	* mfd/main.c (argpflag): Understand abbreviated forms of the --run
	option.
	
	* mfd/bi_db.m4 (dbfirst, dbnext, dbkey, dbvalue): New functions
	(proof of concept).

2008-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement functions with variable number of arguments and 'run' mode.
	
	* mfd/symtab.c (function_install): Take additional argument.
	* mfd/lex.l: New tokens `vaptr', `...' and ARGX.
	* mfd/snarf.m4 (MF_VASTRING): New define.
	* mfd/gram.y: Handle functions with variable number of arguments,
	$(expr), and vaptr() expressions.  This raises shift/reduce
	expectation to 29 conflicts. 
	(parmtype_function): Return dtype_string for
	arguments from vararg list.
	(FUNC_HIDDEN_ARGS): Return 1 if f->varargs is set.
	(type_to_string): Handle pointer argument.
	(function_call): Handle function->varargs.
	(node_type): Handle node_type_argx, and node_type_vaptr.
	(cast_arg_list): Handle variable number of arguments.
	(cast_to): Handle dtype_pointer as dtype_number.
	* mfd/drivers.c (argx, vaptr): New node types.
	(code_type_call): Handle variable number of arguments.
	(code_cast): Handle dtype_pointer as dtype_number.
	* mfd/mailfromd.h (MAILFROMD_RUN): New define.
	(struct argx_node): New type.
	(struct node): Add argx_node.
	(struct function): New member `varargs'.
	(function_install): Add varargs.
	(mailfromd_run): New prototype.
	* mfd/prog.c (env_vaptr, env_get_reg): New functions.
	(env_make_frame0): New function.
	(instr_xmemstk): New instruction handler.
	* mfd/opcodes (XMEMSTK): New opcode.
	* mfd/prog.h (env_get_reg, env_vaptr): New protos.
	* mfd/main.c (options): New option `--run'.
	(main): Handle `run' mode.
	* mfd/Makefile.am (M4_FILES): Add bi_getopt.m4.
	* NEWS: Update.

2008-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* tests/alias.at: New file.
	* tests/Makefile.am (TESTSUITE_AT): Add alias.at 
	* tests/testsuite.at: Add alias.at
	
	* elisp/mfl-mode.el (mfl-next-line-indentation)
	(mfl-find-line-indentation): Fix computations for `alias',
	`returns' and for comment lines.
	(mfl-returns-offset, mfl-comment-offset): New customization
	variables. 

	* mflib/sav.mf: New file. Initial implementation of SAV functions
	entirely in MFL.

	* elisp/mfl-mode.el (mfl-mode): Make compile-command buffer-local.
	
	* mfd/symtab.c (struct alias): New data type.
	(union symentry): New member `alias'.
	(lookup_or_install): Remove erroneous condition, introduced in
	r1627 (branches/release_4_3_patches), which caused third
	argument (install) to be ignored if SYM_BITS was set in state.
	(function_install, function_lookup): Account for aliases.
	(install_alias): New function.
	* mfd/lex.l (alias): New keyword.
	* mfd/gram.y: Allow to define function aliases.
	* mfd/mailfromd.h (SYM_ALIAS): New define.
	(install_alias): New proto.

	* doc/mailfromd.texi: Document function aliases.
	* doc/NEWS: Likewise.

	* elisp/mfl-mode.el (mfl-mfd-command): Change command name.
	(mfl-keywords): Add alias.
	
2008-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Version 4.9.93
	* NEWS: Likewise.
	* pies/pies.c: Change description.

2008-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/prog.c (instr_stkalloc): Expand stack segment if needed.

2008-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mflib/pp-setup (_, N_): If used without arguments, insert
	_ and N_ verbatim.
	* README: Update.
	* tests/Makefile.am (clean-local): Fix rule.
	* configure.ac: Fix check for res_query.

	* mfd/engine.c (mailfromd_daemon): Use mailfromd_umask instead of
	a hardcoded value.
	* mfd/mailfromd.h (mailfromd_umask): New prototype.
	* mfd/main.c (mailfromd_umask): New variable.
	* mfd/bi_system.m4 (umask): New built-in function.
	* gacopyz/gacopyz.c (do_connect): Ensure umask 0117 when binding
	the socket.
	
	* doc/mailfromd.texi: Improve usage of @deffn.
	(System functions): Document umask.
	
2008-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement mailbox_append_message built-in function.

	* NEWS, doc/mailfromd.texi: Document mailbox_append_message.
	Document new semantics of `a' and `a+' in mailbox_open.
	* mfd/bi_msg.m4 (bi_message_from_descr): New function.
	* mfd/bi_body.m4 (current_message): Fix return value.
	* mfd/bi_mbox.m4 (mailbox_open): Discern between `a' and `a+'.
	(mailbox_append_message): New function.
	* mfd/msg.h (bi_message_from_descr): New prototype.

2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.h: Include stdint.h
	* configure.ac: Fix checking for libresolv.

2008-06-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.
	
	* doc/mailfromd.texi: Fix a typo.
	* mfd/prog.c: Fix comment.
	* gacopyz/server.c: Fix erroneous range checking condition.

2008-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fixup C variables that point to dataseg after expanding it.
	Bug reported by Sergey Afonin.
	
	* mfd/snarf.m4 (mf_c_argdcl): Produce only C declarations.
	(mf_c_arginit): New macro.
	(__mf_c_argdcl_list,__mf_c_arginit_list): New auxiliary macros.
	(__mf_c_arglist): Rewrite using the above macros.
	(mf_c_arglist,MF_VA_ARG): Reflect changes to get_.*_arg functions.
	* mfd/bi_sprintf.m4: Update invocations of MF_VA_ARG.
	* mfd/prog.c (struct eval_environ): New members auto_ptr and
	numautos.
	(env_register_auto, env_unregister_autos, env_fixup_autos): New
	functions.
	(expand_dataseg): Call env_fixup_autos.
	(get_literal, get_string_arg): Change signature. Call
	env_register_auto. All callers updated.
	(get_numeric_arg): Change signature for consistency with other
	get_ functions. All callers updated.
	(get_pointer_arg): New function.
	(eval_environment): Call env_unregister_autos after running each
	instruction.
	* mfd/prog.h (get_pointer_arg): New function.
	(get_string_arg, get_numeric_arg): Change prototypes.
	* mfd/bi_sieve.m4: Minor stylistic fix.
	* NEWS: Update.
	
	* mfd/drivers.c (code_cast): Handle dtype_pointer

2008-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Require Mailutils 1.9.90
	* doc/mailfromd.texi: Update.
	* mfd/bi_msg.m4 (message_size, message_body_size)
	(message_header_size): New functions.
	* NEWS: Update.

2008-04-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mtasim/mtasim.c: New command line options --user and --group.
	* doc/mailfromd.texi, doc/mtasim.texi, NEWS: Update.

	Introduce MU interface functions.
	
	* mfd/bi_msg.m4, mfd/bi_mbox.m4, mfd/msg.h: New files.
	* mfd/Makefile.am: Add new files.
	* mfd/bi_string.m4 (substring): 3rd argument can be negative.
	* mfd/bi_body.m4 (current_message): New function.
	* NEWS: Update.
	* doc/mailfromd.texi: Update.
	
2008-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add new MFL datatype `POINTER' and convert `body' handler to
	take first argument of that type. Provide a function for
	converting POINTER to STRING.
	
	* mfd/Makefile.am (M4_FILES): Add bi_body.m4
	* mfd/bi_body.m4: New file.

	* mfd/engine.c (mlfi_body): Pass bodyp as a generic pointer.
	* mfd/snarf.m4 (__mf_argtype, __mf_ctype, __mf_c_getarg)
	(__mf_printf_type): Handle new data type POINTER.
	* mfd/gram.y (state_parms): Change type of the first parameter
	to body to dtype_pointer.
	(cast_to): Handle dtype_pointer.
	* mfd/mailfromd.h (data_type_t): New type dtype_pointer.
	(env_push_pointer): New function.
	* mfd/prog.c (env_push_pointer): New function.
	* mfd/prog.h (get_pointer_arg): New macro.
	* NEWS: Update.	
	* doc/mailfromd.texi: Document changes to prog body. 

	Bugfixes:
	
	* mtasim/mtasim.c (get_input_line): Make sure the return line 
	always terminates with a newline.
	(smtp): Remove erroneous break.
	* mfd/symtab.c (variable_replace): Maintain correct value of
	newvar->owner.
	* mfd/pp.c (push_source): Prevent coredump on the first call.

2008-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/Makefile.am (check-refs, check-fixmes): Print correct
	locations for multiple input files. Return a meaningful error
	code.
	* TODO: Update.

	Rewrite the bootstrap suite.
	
	* README-alpha: Rewritten.
	* bootstrap.conf: Rewritten.
	* bootstrap: Slightly modified version from gnulib.
	* gnulib.modules, README-hacking: New files.
	* doc/mailfromd.texi: Minor fix.

2008-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix handling of handler/handler name clashes. 
	
	* mfd/drivers.c (code_type_progdecl): Warn if a header is
	redeclared.
	* doc/mailfromd.texi: Document resolving of handler/handler name
	clashes. 

2008-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mflib/strip_domain_part.mf, mflib/heloarg_test.mf,
	mflib/gettext.mf, mflib/valid_domain.mf, mflib/spf.mf,
	mflib/match_cidr.mf, mflib/is_ip.mf, mflib/safedb.mf4,
	mflib/dns.mf4: Indent using mfl-mode.

	* mflib/match_dnsbl.mf, mflib/match_rhsbl.mf: Indent using
	mfl-mode. Remove m4 conditionals.

	Port r1632 of branches/release_4_3_patches.

	* configure.ac, NEWS: Version 4.4

	* mfd/mailfromd.h (enum mf_status_code): Add a comma and a count
	definition, needed for `make check-exceptions' in docs.
	* mfd/status.mfi (m4_ifdef): Use OLD_EXCEPTION_CODES instead of
	COMPAT_4_3.
	* mfd/main.c: New command line options: -D (--define), and -U
	(--undefine).
	* mflib/match_dnsbl.mf (match_dnsbl): Use LAZY_MATCH_RBL instead of
	COMPAT_4_3.
	Throw e_invip if address is invalid.
	* mflib/match_rhsbl.mf (match_rhsbl): Use LAZY_MATCH_RBL instead
	of COMPAT_4_3.
	* doc/mailfromd.texi: Document variable shadowing and new
	features.
	* doc/Makefile.am (check-exceptions): Update the rule.
	* NEWS: Update.
	Fix the test suite. The file status.mfh now contains m4 statements,
	yet the test suite uses --no-preproc files, so we have to use an
	already preprocessed version of that file.
	
	* tests/atlocal.in (MFOPTS): Add -I@abs_builddir@
	* tests/Makefile.am (status.mfh): New rule.
	(check_local): Depend on status.mfh
	(clean-local): Remove status.mfh
	* NEWS: Raise version number.
	
	Prefix all exception codes with `e_'.
	
	* mfd/mfstat.awk: Look for mf_exception_code/mf_exception_count.
	* mfd/lex.l (variable_or_const): Add type cast.
	* mfd/mailfromd.h (enum mf_status_code): Retain only first four proper
	status codes.
	(enum mf_exception_code): New type.
	(mf_status_to_exception): New macro
	(mf_exception_str,string_to_exception): New functions
	(mf_status_str): Rewrite as macro.
	(string_to_stat): Remove.
	* mfd/mf-status.mfi: Prefix codes with e_
	* mfd/status.mfi: Prefix exception codes with e_. Retain
	succes, not_found, failure, and temp_failure for backward
	compatibility.
	Retain old exception names if m4 symbol COMPAT_4_3 is defined.
	* mfd/gram.y, mfd/snarf.m4, mfd/bi_poll.m4, mfd/bi_string.m4,
	mfd/drivers.c, mfd/bi_dns.m4, mfd/bi_system.m4, mfd/bi_spf.m4,
	mfd/prog.c, mfd/bi_ipaddr.m4, mfd/bi_sa.m4, mfd/bi_io.m4,
	mfd/bi_sieve.m4, mfd/bi_vars.m4, mfd/bi_other.m4, mfd/bi_mail.m4,
	mfd/bi_gettext.m4, mfd/bi_db.m4, : Use new exception names.
	* configure.ac (MF_VERSION_PATCH): Set to 90
	* doc/mailfromd.texi: Document changes.

	Name clashes between constants and variables went unnoticed by the
	compiler. Bug reported by Thomas Lynch.
	Fix this and rename exception codes to minimize chances of such
	clashes.
	
	* mfd/symtab.c (lookup_or_install): Allow to search using state
	masks.
	(variable_or_constant_lookup): New function.
	(constant_lookup): Return const struct constant *.
	(constant_lookup_value): New function.
	* mfd/lex.l (get_const): Remove.
	(variable_or_const): New function.
	* mfd/gram.y: Display warnings on a clash of constant and variable
	names.
	(VARIABLE): Change union type to var. Modify `variable' production
	accordingly.
	* mfd/mailfromd.h (_SYM_COUNT,SYM_MASK,SYM_BITS): New defines.
	(constant_lookup): Return const struct constant *.
	(constant_lookup_value): New function.
	(variable_or_constant_lookup): New function.
	* mfd/status.mfi: Prefix exception codes with `e_' to avoid name
	clashes.
	Provide backward-compatible constants.
	* mflib/match_dnsbl.mf (match_dnsbl): Rename range to iprange to
	avoid name clashes with the exception code.
	Remove buggy conditions. Provide a correctly working replacement
	for them if the m3 symbol `COMPAT_4_3' is defined.
	* mflib/match_rhsbl.mf (match_rhsbl): Rename range to iprange to
	avoid name clashes with the exception code.
	Remove buggy conditions. Provide a correctly working replacement
	for them if the m3 symbol `COMPAT_4_3' is defined.
	* mflib/match_cidr.mf, mflib/safedb.mf4, tests/etc/catch.rc,
	tests/etc/catch01.rc: Use new exception codes.
	
	
2008-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Ported r1619 from branches/release_4_3_patches.

	* src/prog.c, src/prog.h (advance_pc): Fix type of the 2nd
	argument.
	* configure.ac: Use AC_TRY_LINK to check for libresolve.
	* THANKS: Update	
	* NEWS: Update
	
	* mfd/main.c: Minor changes in doc string.
	
2008-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c: New configuration statement "chdir".
	* pies/progman.c (struct prog.v.p): New member `dir'.
	(register_prog): Initialize newp->v.p.dir;
	(prog_start): Change to the working directory, if required by
	config.

2008-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/main.c (mf_error_on_locus): Mark as printflike.
	(cb_milter_timeout): Fix format.
	(mf_cfg_param): Fix erroneous description of include-path.

2008-02-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Merged HEAD from branches/gmach.

2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* THANKS: Add Tom Lynch. Obfuscate email addresses.
	* pmult/pmult.c: Remove kludges that were necessary to include
	files from meta1 source tree. Assume PreAlpha24.1 at least.
	* pmult/Makefile.am (INCLUDES): Remove @META1_INCLUDES@
	* configure.ac (--enable-pmilter option): Assume all the necessary
	libraries are installed under ${path}/include/sm, and libraries
	under ${path}/lib/meta1.

2008-02-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Ported r1606 from trunk.
	
        * src/dnsbase.c: Define MAX, if necessary.
        * src/mailfromd.h: Define INADDR_NONE.
        * configure.ac: Check for librt.
        Add auth to AM_GNU_MAILUTILS.
        * gacopyz/server.c (srv_connect): Fix typo.
	* gacopyz/gacopyz.c (do_connect): Fix typo.
        * bootstrap (MODLIST): Add vasprintf.
        * configure.ac: Check for libsocket and libnsl.
        * src/dnsbase.c (dns_resolve_hostname,a_lookup): Change
	initialization of domainbuf.
        * src/syslog_async.c: Include fcntl.h.

2008-02-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (progman_wake_disabled): Renamed to
	progman_wake_sleeping.
	* pies/progman.c: Implement proper handling of dependencies.
	* pies/pies.h ((progman_wake_disabled): Renamed to
	progman_wake_sleeping.
	(pies_depmap_t,pies_depmap_pos_t,enum pies_depmap_direction): New
	types.
	(depmap_alloc,depmap_copy,depmap_set,depmap_isset,depmap_tc)
	(depmap_first,depmap_next): New functions.
	* pies/depmap.c: New file.
	* pies/Makefile.am (pies_SOURCES): Add depmap.c.

	* smap/smap.c (version): Fix indentation.
	* pies/pies.c (return_code_section_parser): Allow to use symbolic
	exit codes.
	(priv_setup): Exit with EX_CONFIG if the user does not exist.
	(main): Catch early sigchlds as well.
	* pies/progman.c (progman_cleanup): Fix notice wording.
	* pies/pies.rcin: Add sample return-code section.
	(component pmult): Redirect stderr/stdout to syslog.

2008-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement configurable actions depending on the exit code of
	a component.
	
	* pies/pies.c: New configuration file section "return-code".
	(capa): Add mailer and debug.
	(main): Register "return-code" section and all mailer formats.
	* pies/progman.c (enum prog_status): New type.
	(struct prog): Remove `disabled'. New fields `status' and `act'.
	(register_prog): Initialize act.
	(prog_start): Exit with EX_SOFTWARE code if the component cannot
	be started.
	(progman_start): Do not start disabled components.
	(progman_wake_disabled): Wake only components marked as
	status_stopped.
	(notify): New function.
	(progman_cleanup): Act in accordance with the `act' field if the
	component terminates.
	(progman_stop_component,progman_dump_stats): Take into account
	prog->v.p.status.
	* pies/pies.h (MAX_RETURN_CODE): New define.
	(enum return_action): New type.
	(struct component.act): New member.
	(default_component): New global.

2008-01-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mfd/bi_db.m4 (dbdel): Fix format arguments.

2008-01-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Document header_insert and sleep.
	* mfd/bi_header.m4 (header_insert): New function.
	* NEWS: Update.

2008-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c: Handle signals in the main thread by default.
	Remove --sigthread option, introduce --no-signal-handler option.
	(struct pmult_client): New member hdr
	(cb_reply): Fully implement header modification commands in their
	Sendmail semantics (as far as bugs of MeTA1 do not impede for it
	to work).
	(pmult_runlist0): New function.
	(pmult_runlist): Rewrite using pmult_runlist0.
	(pmult_clear): New function.
	(pmult_shutdown,pmult_eom): Call pmult_clear.
	(process_headers): Populate p->hdr.
	(pmult_msg_handler): New function.
	(pmult_msg): Rewrite using pmult_msg_handler.

	* mfd/mailfromd.h (enum msgmod_opcode): New value header_insert.
	* mfd/bi_header.m4 (header_add): Implement optional index
	argument.
	* mfd/engine.c (run_msgmod): Handle header_insert.
	* mfd/gram.y (msgmod_opcode_str): Likewise.
	
	* doc/mailfromd.texi: Update.
	* NEWS, TODO: Update.

	* pmult/pmult.c (wait_for_signal): Handle SIGABRT and SIGSEGV.
	(pmult_msg): Print body text at debug level trace7.

2008-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c (pmult_runlist,pmult_shutdown,pmult_connect): Lock
	context before proceeding.
	* mfd/bi_system.m4: New function `sleep'.

2008-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c, pmult/pmult.c: Fix handling of the --log-tag option.

	* pies/progman.c (prog_start): Remove unconditional debugging
	output.
	* gacopyz/gacopyz.h (SMI_LOG_PROTO): New debugging level.
	(gacopyz_io_logdump): Remove useless level argument.
	* gacopyz/log.c, gacopyz/io.c, gacopyz/gacopyz.c: Dump protocol
	traces only if SMI_LOG_PROTO is set.

	* pmult/pdbg.hm4, pmult/debugdef.m4: New files. Provide serialized
	versions of MU_DEBUG macros.
	
	* pmult/pmult.c: Use debugging macros from pdbg.h
	Do not protect accesses to p->srvlist by mutexes, they should not
	be concurrent anyway.
	(pmult_abort): Do not shutdown priv_data.

2008-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mtasim/mtasim.c: Do not use gacopyz_srv_define_macro0.
	* pmult/pmult.c: (log_setup): Always set mu_debug_default_printer
	to override bug in libmailutils.
	(client_block_end): Bugfix.
	(pmult_connect): Do not use gacopyz_srv_define_macro0.
	* mfd/main.c (log_setup): Always set mu_debug_default_printer to
	override bug in libmailutils.

	* gacopyz/gacopyz.h (gacopyz_srv_define_macro0): Remove.
	* gacopyz/log.c (gacopyz_io_logdump): Bugfix.
	* gacopyz/server.c (gacopyz_srv_define_macro0): Remove.
	(gacopyz_srv_define_macro): Do not use gacopyz_srv_define_macro0.
	
	* pies/pies.c (log_setup): Always set mu_debug_default_printer to
	override bug in libmailutils.
	(component_cfg_param): New keyword `env'.
	(main): Bugfix: It is -R that allows arguments, not -r.
	* pies/progman.c (struct prog): New member env.
	(register_prog): Avoid unnecessary allocations. Copy env.
	(env_setup): New function.
	(prog_start): Set up environment.
	* pies/pies.h (struct component): New member env.

2008-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi, NEWS: Update.
	* doc/Makefile.am: Rename /src/ to /mfd/.

	* mfd/symtab.c (rehash): Bugfix: Update variable owner.
	* mfd/mailfromd.h (SP): New macro.
	(struct locus.line): Change type to unsigned long.
	(enum header_opcode): Replace with enum msgmod_opcode.
	(struct old_header_node): Replace with struct msgmod_closure.
	(header_command_str): Replace with msgmod_opcode_str.
	(parse_error,parse_warning,parse_warning_locus): Mark as
	printflike.
	(env_throw,env_throw_bi): Likewise.
	(logmsg,trace): Likewise.
	(create_environment): Change proto.
	(env_msgmod): New function.

	* mfd/bi_rcpt.m4: New file. Envelope modification functions.
	* mfd/bi_qrnt.m4: New file. Quarantine functions.
	* mfd/bi_header.m4: New file. Header modification functions.
	* mfd/Makefile.am (M4_FILES): Add bi_rcpt.m4, bi_header.m4 and
	bi_qrnt.m4.
	* mfd/engine.c, mfd/gram.y, mfd/drivers.c, mfd/prog.c
	
	* gacopyz/server.c: Minor changes in debug diagnostics.
	
2008-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pmult/pmult.c: Use callback to handle header modification
	commands.
	* gacopyz/gacopyz.h (gacopyz_srv_set_callback)
	(gacopyz_srv_set_callback_data): New function.
	* gacopyz/server.c (struct gacopyz_srv.cb_reply,cb_data): New
	members.
	(gacopyz_srv_set_callback)
	(gacopyz_srv_set_callback_data): New functions.
	(gacopyz_srv_send_command): Read all header, recipient and body
	modification replies. 
	* doc/mailfromd.texi: Update.

	* tests/testsuite.at: Skip MTA tests if running with root privileges.
	* tests/Makefile.am: Add missing depedency.

	* */*: Roll back the latest rename. Changing a well-known program
	name doesn't pay.

2008-01-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	IV. Emulate more milter macros:
	
	* pmult/pmult.c: Emulate more milter macros.

	III. Bugfix

	* gacopyz/server.c (gacopyz_srv_con): Pass port number.

	II. Move mtasim into a separate directory.
	
	* mtasim: New directory.
	* mtasim/openat-die.c, mtasim/mtasim.c: Move from src/
	* mtasim/Makefile.am: New file.
	* configure.ac, Makefile.am: Add mtasim. 
	* tests/atlocal.in: Add mtasim to PATH.
	* po/POTFILES.in: Add missing files.

	I. Rename mailfromd to mfd.

	* src, src/mfstat.awk, src/symtab.c, src/lex.l, src/mu_dbm.c,
	src/engine.c, src/stack.c, src/snarf.m4, src/dnscache.c,
	src/mu_dbm.h, src/opcode.awk, src/gram.y, src/debug.cin,
	src/drivers.c, src/bi_poll.m4, src/bi_string.m4, src/mailfromd.h,
	src/dnsbase.c, src/debug.hin, src/dns.c, src/openat-die.c,
	src/db.c, src/spf.c, src/dns.h, src/drv.awk, src/bi_system.m4,
	src/bi_dns.m4, src/spf.h, src/bi_sprintf.m4, src/bi_spf.m4,
	src/init.m4, src/debugdef.m4, src/cache.c, src/optab.opc,
	src/prog.c, src/optab.oph, src/bi_ipaddr.m4, src/bi_sa.m4,
	src/opcodes, src/mf-status.mfi, src/prog.h, src/status.mfi,
	src/bi_io.m4, src/pp.c, src/builtin.def, src/bi_sieve.m4,
	src/bi_vars.m4, src/main.c, src/Makefile.am, src/bi_other.m4,
	src/bi_mail.m4, src/mtasim.c, src/rate.c, src/bi_gettext.m4,
	src/bi_db.m4: Move to mfd.
	* configure.ac, Makefile.am, mfd/mtasim.c, mfd/Makefile.am: Use
	mfd instead of src. 
	* mfd: New directory.
	
	* mfd/engine.c (milter_conn_accept): Take a third argument,
	specifying the actual length of the sa structure.
	Return 0 if mailfromd_acl is not given.
	* gacopyz/gacopyz.h, gacopyz/gacopyz.c: xxfi_accept takes third
	argument, specifying the actual lengthof the sa structure.

	* tests/farg.at, tests/ismx.at, tests/atlocal.in, tests/catch.at,
	tests/catch01.at, tests/cond02.at, tests/shadow.at,
	tests/version.at, tests/ashadow.at, tests/cond04.at,
	tests/relayed02.at, tests/cond06.at, tests/testsuite.at,
	tests/ack.at, tests/invcidr.at, tests/switchn1.at,
	tests/bctx00.at, tests/switchn3.at, tests/greylist.at,
	tests/cidr2.at, tests/fctx00.at, tests/switchs1.at,
	tests/switchs3.at, tests/invip2.at, tests/poll02.at,
	tests/poll04.at, tests/hostname.at, tests/resolve.at,
	tests/invcidr2.at, tests/hasmx.at, tests/declvar.at,
	tests/cond01.at, tests/macros.at, tests/invip.at, tests/cond03.at,
	tests/relayed01.at, tests/cond05.at, tests/prec.at,
	tests/strings.at, tests/rescname.at, tests/bctx01.at,
	tests/switchn2.at, tests/cidr1.at, tests/switchn4.at,
	tests/cidr3.at, tests/fctx01.at, tests/poll.at, tests/switchs2.at,
	tests/poll01.at, tests/ml.at, tests/switchs4.at,
	tests/poll03.at: Rename mailfromd to mfd.

2008-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c, src/mailfromd.h, src/main.c: Implement ACLs.
	* NEWS: Update.

	* src/main.c, smap/smap.c, pies/pies.c, pies/progman.c,
	pies/pies.h, pmult/pmult.c: Sync with MU CVS: Use mu_log_facility
	and mu_log_tag.
	* gacopyz/gacopyz.h (struct gacopyz_milter_descr): New member
	xxfi_accept.
	* gacopyz/gacopyz.c (gacopyz_handle_connection): Close connection
	immediately if conn->desc.xxfi_accept returns 1.

	* src/mailfromd.h, src/engine.c, src/smap.c: Use uniform startup
	and shutdown messages.

2008-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (_cb_group): Bugfix: store group number in the list,
	not its name.
	(component_section_parser): Initialize retr to default values.
	* pmult/pmult.c: New option --sigthread: handle SIGHUP and SIGTERM
	in the main thread. Necessary (at least) for Linux 2.4.*

	* src/lex.l, src/mailfromd.h (parse_warning, parse_warning_locus)
	(parse_error,parse_error_locus): fmt is const.
	* src/gram.y (dbg_dict_getsym): Auxiliary function.
	* src/prog.c, src/prog.h (pushs): 2nd argument is const.
	* src/bi_gettext.m4 (bindtextdomain): Minor fix.
	* pies/Makefile.am, smap/Makefile.am,
	pmult/Makefile.am (LDADD): Place libgnu.a after
	MAILUTILS_LIBS. 
	* pmult/pmult.c: Fix indentation.
	* lib/libmf.h: Include stdio.h
	* lib/userprivs.c: Include libmf.h.
	* lib/parsetime.c: Includestring.h and time.h
	
	* pies: New directory.
	* pies/Makefile.am: New file.
	* pies/pies.c, pies/progman.c, pies/pies.h, pies/pies.rcin: New
	files.
	* smap/smap.c (switch_to_privs): Remove. Use library version instead.
	* pmult/pmult.c: New configuration file statement `pidfile'.
	(pmult_connect): Ignore gsrv if its remote milter is not
	listening.
	* configure.ac, Makefile.am: Add pies.
	* lib/libmf.h (getmaxfd): New define.
	* NEWS: Update.
	
2008-01-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* lib/libmf.h: Add switch_to_privs.
	* lib/userprivs.c: New file.
	* lib/Makefile.am: Add userprivs.c.
	* src/gram.y (time_multiplier): Remove forward dcl.
	* src/main.c: Move switch_to_privs to lib.

	* src/prog.c (instr_header): Improve trace output.
	* pmult/pmult.c: Implement recipient and header modifications.
	* configure.ac: Link libmta/libcstrr.a (for pmult).
	* TODO: Update.

	* gacopyz/server.c (gacopyz_srv_send_command): Do not bail out on
	message modification responses.
	* gacopyz/gacopyz.c (gacopyz_header_command): Improve trace output.
	
	* src/gram.y (DELETE string): Initialize hdr.value.
	* src/drivers.c (code_type_header): Value can be NULL.
	
	* pmult/pmult.c: Implement most of the SMTP functionality.

	* src/mailfromd.h, lib/libmf.h (dict_init, dict_install)
	(dict_destroy, dict_getsym): Move to lib/libmf.h.
	* src/prog (dict_init, dict_install, dict_destroy)
	(dict_getsym): Move to lib/dict.c.
	* lib/dict.c: New file.
	* lib/Makefile.am: Add dict.c.
	
	* pmult/pmult.c: Implement framework for milter macros.

2008-01-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* gacopyz/gacopyz.c (parse_url): Bugfix.
	* pmult/pmult.c: Update.
	
	* pmult/pmult.c: Update.
	* gacopyz/gacopyz.h, gacopyz/server.c: Implement gacopyz_srv_conn.

	* src/gram.y (parse_time_interval): Move to lib/parsetime.c.
	* src/mailfromd.h (parse_time_interval): Move to lib/libmf.h
	* lib/libmf.h (parse_time_interval): New proto.
	* lib/Makefile.am: Add parsetime.c.
	* lib/parsetime.c: New file.
	* smap/smap.c: Include mailutils/daemon.h.
	* pmult: New directory.
	* pmult/pmult.c: New file. A framework for pmilter multiplexer.
	* pmult/Makefile.am: New file.
	* configure.ac: New option --enable-pmilter.
	* Makefile.am (SUBDIRS): Add pmult.	

2008-01-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (check_pidfile): Bugfix.
	* src/gram.y (mailfromd): dict is mu_assoc_t.
	* src/mailfromd.h (dict_init,dict_install,dict_destroy)
	(dict_getsym): dict is mu_assoc_t.
	* src/prog.c: Likewise.
	* src/main.c (mf_diag_syslog_printer): Return 0.
	* smap/smap.c (expand_reply_text): Tolerate arg==NULL.
	(--foreground,--inetd,--daemon): New options.
	(argp_capa): Add debug.
	* lib/nls.c (mf_init_nls): Bind "mailfromd" domain.

	* gacopyz/smfi.c, gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h,
	gacopyz/log.c, gacopyz/proc.c, gacopyz/server.c,
	gacopyz/gacopyz.c: Move logmask and ctx_timeout from
	gacopyz_conn_t to gacopyz_milter_descr. Fix some minor issues.

	* src/db.c, src/bi_dns.m4, src/bi_sprintf.m4, src/prog.c,
	src/bi_db.m4: Fix format strings/arguments.
	* src/bi_sieve.m4: Minor fixes.
	* src/mtasim.c: Include libmf.h
	* smap/smap.c: Include mailutils/server.h. Minor bugfixes.
	* tests/version.at, tests/macros.at: Use mailfromd canonical name,
	not AT_PACKAGE_NAME (in message patterns).
	
2008-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y, src/main.c: Remove deprecated features.
	* doc/mailfromd.texi, NEWS: Update.
	* gacopyz/gacopyz.c: Support URLs.
	
	* lib/libmf.h (mf_init_nls): New proto.
	* lib/nls.c: New file.
	* lib/Makefile: Add nls.c.
	* bootstrap: Fix TP issues.
	* src/main.c, src/mtasim.c, smap/smap.c: Use mf_init_nls.
	* lib/version.c: Update year.

	* configure.ac (AC_INIT): Rename to gmach (working name).
	(MF_VERSION_PATCH): Raise to 91
	Require at least MU-1.2.90
	(AC_CONFIG_FILES): Add gnu/Makefile and smap/Makefile.
	* NEWS: Update.
	
	* bootstrap: Place gnulib files in gnu/
	
	* lib: New directory.
	* lib/libmf.h: New file.
	* src/daemon.c, src/syslog_async.c, src/syslog_async.h,
	src/version.c: Moved to lib
	* src/mailfromd.h: Incude sysexits.h unconditionally.
	Include libmf.h
	* src/bi_sa.m4: Rewrite using mu_socket_stream_t.
	* src/main.c: Remove pre-mu-1.2.90 dependencies.

	* Makefile.am (SUBDIRS): Add gnu and smap.
	* src/Makefile.am, gacopyz/Makefile.am: Update.
	
	* src/mtasim.c (main): Remove (now superfluous) invocation of
	mu_error_set_print.

	* smap/smap.c: Rewrite using MU-1.2.90

	* po/POTFILES.in: Update.
	
2007-12-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am (libmf_a_DEPENDENCIES): Add BUILD_SYSLOG_ASYNC

2007-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (mf_cfg_param): Add docstrings.

2007-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Ported r1536 from branches/release_4_2_patches (= r1535 from
	tags/release_4_2):
	
	* src/syslog_async.c: Include config.h, netinet/in.h and signal.h
	Conditionally include paths.h, provide replacements for _PATH_LOG
	and _PATH_CONSOLE if it is absent.
	Provide dummy replacement for MSG_NOSIGNAL and LOG_PERROR.
	(log_write_async): Ignore SIGPIPE if MSG_NOSIGNAL is not defined.
	* src/main.c: Conditionally compile syslog-async stuff.
	* src/Makefile.am: Likewise.
	* configure.ac: Check for paths.h.
	Restore previous meaning of --enable-syslog-async.
	(DEFAULT_SYSLOG_ASYNC): New variable.
	
	* doc/mailfromd.texi: Reflect above-mentioned changes.

	* src/main.c: Reflect recent changes to Mailutils.
	
2007-11-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c: Implement MU configuration statements.
	* tests/atlocal.in (MFOPTS): Ignore site-wide and per-user
	configuration files.
	* doc/mailfromd.texi: Document sieve interface.

2007-11-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update

2007-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_io.m4 (write): Implement optional third argument.
	* src/bi_sieve.m4: New file.
	* src/mailfromd.h (vlogmsg): New proto.
	* src/main.c (capa): Request "common" capability.
	(main): Register all mailbox formats (needed for sieve).
	* src/Makefile.am (M4_FILES): Add bi_sieve.m4
	* src/mtasim.c (process_header): chop trailing newline.
	* mflib/sieve.mfh: New file.
	* mflib/Makefile.am (inc_DATA): Add sieve.mfh.
	* configure.ac: Set patchlevel 90.
	(AM_GNU_MAILUTILS): Request 'all' and 'sieve' link flags.
	* doc/mailfromd.texi: Document 3rd argument of write.
	* NEWS: Update.
	
2007-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* README-alpha: Update
	* configure.ac: Use AM_GNU_MAILUTILS.
	* acinclude.m4: Minor fix.

	* smap: New directory.
	* smap/smap.c: New file. A general-purpose socket map for MeTA1 
	(for future use).

	* src/mu_dbm.c [WITH_GDBM]: do not bail out if the database does
	not exist.
	* src/mailfromd.h: Add argp.h
	* src/bi_sa.m4: Minor fixes.
	* src/main.c: Support for Mailutils CVS HEAD.
	* configure.ac: Likewise.

2007-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (check_on_host): Wait for an answer to QUIT.
	Fix courtesy of Nacho Gonzalez Lopez.
	* src/bi_sa.m4: Revert the changes inadvertently pushed on
	2007-10-21.
	* doc/Makefile.am: Use texi2html to produce HTML version of the
	manual.
	* doc/gendocs_template: Likewise
	* doc/gendocs.sh: Remove. Changes incorporated into the Texinfo
	repository.
	* doc/gendocs_template: Use conditionals, introduced in the 
	Texinfo CVS.

2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dnsbase.c (domain_name_cmp): Allow for trailing dot after
	the domain.

2007-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Do not use subheading commands inside of
	deffn.
	* doc/Makefile.am
	* doc/gendocs.sh: New file. A customized version.
	* doc/gendocs_template: Update

	* configure.ac, src/syslog_async.c, src/syslog_async.h,
	src/main.c, src/Makefile.am: Reimplement syslog-async. Thanks
	Simon Kelley for relicensing it under GPLv3.
	* doc/mailfromd.texi, NEWS: Update
	
2007-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dnsbase.c (cname_loop_body): Return TXT only if explicitly
	required. Bug reported by Jan Rafaj.

	* src/engine.c: Fix timeout calculations
	(struct timeout_ctl): New data type
	(UPDATE_TTW,smtp_stream_wait,smtp_wait): Operate on struct timeout_ctl.
	All callers updated.
	(init_timeout_ctl): New function.

2007-10-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mtasim.c (_def_read): Return 0 if zero bytes were read
	(get_input_line): Fix counting of input bytes.
	(smtp): Fix checking for returns from process_data_reply.
	* gacopyz/server.c (srv_format_macros): Do not add trailing zero
	to the packet.

2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mailfromd.h [!ENABLE_NLS] (bindtextdomain): Fix definition.
	* src/cache.c (cache_get2): Fix misplaced variable definition.

	* src/dnsbase.c (dns_resolve_hostname): Remove stray free, left
	over after 2007-09-03.

2007-09-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c (heap_obstack_grow): Bugfix. The condition didn't
	take into account usignedness.
	(get_numeric_arg): Extra safety fix.

	* configure.ac (MAILUTILS_VERSION): Bugfix.

2007-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (log_setup): Set up gacopyz_syslog_log_printer when
	logging to syslog.

2007-09-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c [WITH_GDBM] (mu_dbm_firstkey,mu_dbm_nextkey):
	Return MU_ERR_NOENT instead of MU_ERR_FAILURE.
	* src/mailfromd.h (get_rate): New argument mincount
	* src/rate.c: Likewise
	* src/bi_other.m4 (rate): Optional argument mincnt
	* src/mtasim.c: Accept MAIL FROM: and RCPT TO: without extra space
	after `:'.
	* doc/mailfromd.texi, NEWS: Update
	
2007-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dnsbase.c (dns_resolve_hostname): Make name buffer big
	enough to hold eventual CNAME expansions. Reported by Jan Rafaj.
	* configure.ac: Improve to compile with the latest MU CVS.

2007-08-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac (check_slackware_bdb): Add heuristics to find the
	correct include directory.

2007-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (on_cond): Fix coredump if target address is not
	specified.
	(vardecl): Signal error if an auto variable is doubly defined.
	* tests/testsuite.at (EX_OK--EX_CONFIG): New defines
	(MF_CHECK_TEXT): New macro
	Add poll04.at and ashadow.at
	* tests/ashadow.at, tests/poll04.at: New files
	* doc/mailfromd.texi: Minor fixes
	* src/dnsbase.c (a_lookup): Make name buffer big enough to hold
	eventual CNAME expansions.
	
2007-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (check_on_host): Do not send space character after
	MAIL FROM: and RCPT TO:
	* doc/mailfromd.texi, TODO: Minor fixes.
	* NEWS: Update
	
2007-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Relicense everything under the GPLv3.

	* src/syslog_async.c, src/syslog_async.h: Removed
	
2007-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac, NEWS: Version 4.1
	* doc/mailfromd.texi: Update
	* src/pp.c (next_line): Bugfix

2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi (NLS Functions): Update
	* elisp/mfl-mode.el (mfl-mode-syntax-table): Update

2007-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Fix line counting within here-documents

2007-05-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* elisp/mfl-mode.el: Initial implementation
	* tests/shadow.at, tests/bctx00.at, tests/fctx00.at,
	tests/macros.at, tests/etc/reject.rc, tests/etc/farg.rc,
	tests/etc/cidr.rc, tests/etc/catch.rc, tests/etc/catch01.rc,
	tests/etc/cond.rc, tests/etc/dns.rc, tests/etc/macros.rc,
	tests/etc/shadow.rc, tests/etc/relayed.rc, tests/etc/var.rc,
	tests/etc/numrcpt.rc, tests/etc/strings.rc, tests/etc/prec.rc,
	tests/etc/ack.rc, tests/etc/accept.rc, tests/etc/switch.rc,
	tests/etc/tempfail.rc, tests/etc/greylist.rc, tests/etc/poll-1.rc,
	tests/etc/sa01.rc, tests/etc/sa02.rc, tests/etc/poll.rc,
	tests/etc/sa03.rc, tests/etc/sa04.rc, tests/etc/ml.rc,
	tests/etc/arg.rc, etc/mailfromd.rc: Use MFL Emacs mode
	
2007-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* Makefile.am: Update
	* elisp: New directory
	* elisp/mfl-mode.el: New file 
	* elisp/Makefile.am: New file

2007-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/snarf.m4 (MF_OPTVAL): Fix a leftover bug
	* src/gram.y (on_cond): Reverse selector argument list.
	* src/drivers.c (code_type_call): Provide placeholders for 
	missing optional arguments, so they can be safely accessed and
	assigned.
	* src/bi_dns.m4, src/bi_db.m4: Use MF_OPTVAL insted of MF_DEFINED.
	* src/bi_sa.m4: Avoid splitting strings within NLS markers,
	because M4 inserts line directives in between, which causes grief
	for many compilers.
	* src/Makefile.am (.m4.c): Fix the sed rule
	* src/mtasim.c (recursive_rmdir): Do not complain when attempting
	to delete a non-existing file.

2007-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_gettext.m4: Built-in NLS support
	* mflib/gettext.mf: NLS support; library level.
	* src/Makefile.am, mflib/Makefile.am, mflib/pp-setup: Implement
	NLS support

	* src/snarf.m4 (mf_c_arglist,MF_RETURN_TEMP_SPACE):  Fix stack
	offset calculation for adjust_stack and unroll_stack
	(MF_VA_ARG): Raise an exception if the argument number is out of
	range.
	(MF_THROW): Avoid outputting extra newlines
	(MF_ASSERT): Remove spurious semicolon
	* src/bi_sprintf.m4: Implemented xXu.
	* src/Makefile.am (.m4.c): Fix the sed rule.
	* mflib/pp-setup (printf): New macro

	* src/snarf.m4 (MF_GROW_TEMP_SPACE): Take optional 3rd argument
	* src/bi_sprintf.m4: Implement all modifiers, flags and basic
	conversions
	* src/prog.c (struct eval_environ.temp_start): New field.
	(heap_tempspace_begin,heap_tempspace_finish)
	(heap_tempspace_grow): Update tos in sync with temp_size so that
	heap_tempspace() can be used.
	* src/Makefile.am (builtin.h): Depend on Makefile.am

2007-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/symtab.c (va_builtin_install_ex): Extra argument: varargs

	* src/snarf.m4 (MF_DEFUN_VARARGS,MF_VA_START,MF_VA_END)
	(MF_VA_COUNT,MF_VA_ARG): New macros: Support for variable number
	of arguments to built-in functions
	(MF_BEGIN_TEMP_SPACE,MF_GROW_TEMP_SPACE,MF_1GROW_TEMP_SPACE)
	(MF_END_TEMP_SPACE): New macros. Improved growable heap space
	support.
	(m4wrap): Use m4_m4wrap.

	* src/gram.y (cast_arg_list): Take extra argument
	(funcall: BUILTIN): Allow for builtins taking varying number of
	arguments.
	* src/drivers.c (code_type_builtin): Allow for builtins taking
	varying number of arguments.
	* src/mailfromd.h (struct builtin.varargs): New field
	(va_builtin_install_ex): Change signature.
	* src/bi_dns.m4 (dns_getaddr, dns_getname, getmx): Use new heap
	allocation macros.
	* src/bi_system.m4 (strftime): Rewrite using MF_ALLOC_HEAP
	* src/prog.c (struct eval_environ.temp_size): New field
	(unroll_stack): New function
	(expand_dataseg): If errtext is NULL return 1/0 isntead of raising
	a runtime error.
	(push): Fix expansion condition
	(heap_tempspace_begin, heap_tempspace_finish)
	(heap_tempspace_grow): New functions
	(heap_max_tempspace): Remove
	(env_vsprintf): Rewrite.
	* src/prog.h (heap_max_tempspace,heap_fix_tempspace): Remove
	(heap_tempspace_begin,heap_tempspace_finish)
	(heap_tempspace_grow,unroll_stack): New functions
	* src/bi_sprintf.m4: New file. Sprintf support (limited at the time)
	* src/Makefile.am: Add bi_sprintf.m4
	* doc/mailfromd.texi: Update

2007-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* mflib/dns.mf: Rewritten as
	* mflib/dns.mf4: .. this
	* mflib/safedb.mf: Rewritten as
	* mflib/safedb.mf4: .. this
	* mflib/Makefile.am (.mf4.mf): New rule

	* src/lex.l: Discontinue supporting &code form.
	New lexical entities: $# with the usual meaning and @parm,
	for getting ordinal number of parameter `parm' in the parameter
	list.
	New built-in constant __preproc__.  Expands to the command name of
	the preprocessor.
	* src/snarf.m4 (MF_THROW): Bugfix: do not output ": " after the
	function name, it is done automatically by the error reporting
	routines.
	* src/gram.y: Support $# and @parm.  Fix missing occurrences of
	`reverse' (yesterday's changes).
	* src/drivers.c (code_type_builtin): Fix passing $#
	(code_type_call): Implement $# (a hidden first argument) for MFL
	functions.
	(type offset): New node type
	* src/mailfromd.h (struct variable.ord): New field.
	* mflib/dns.mf, mflib/safedb.mf: Reflect the recent changes in
	optional argument handling.
	* mflib/pp-setup (defined): New macro
	* NEWS: Update

	* src/snarf.m4 (__mf_has_optarg): New macro
	(__mf_defined_argname,__mf_defined_argnames)
	(mf_defined_argnames,mf_argpos): New macro
	(__mf_optarg_defined,__mf_defined,MF_DEFINED,MF_OPTVAL)
	(__mf_c_arglist,mf_c_arglist)
	Fix typo (m4_errprint)
	* src/gram.y: Arguments are passed the in the same order for both
	built-in and MFL-level functions.
	(print_node_list_reverse): New function
	* src/bi_string.m4 (substr): Bugfix: Use MF_DEFINED
	* src/drivers.c (print_type_builtin): Use print_node_list_reverse
	(code_type_builtin): Pass total number of arguments in a hidden
	argument if the built-in takes optional parameters.
	* src/mailfromd.h: Fix typo
	* src/main.c: Make sure logging goes to stderr for --dump-*
	options.
	* TODO: Update
	
2007-05-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Fix input file location tracing
	* src/pp.c (try_file): extra argument err_not_found controls
	whether to bail out if the file is not found. 

	* src/lex.l: Use pp_extrn_start/pp_extrn_shutdown to launch the
	external preprocessor.
	* src/mailfromd.h (pp_extrn_start, pp_extrn_shutdown, pp_init)
	(pp_done): New functions
	* src/pp.c (pp_extrn_start, pp_extrn_shutdown): New functions
	(preprocess_input): If a file named "pp-setup" is found in the
	include path, feed its contents to the preprocessor first.
	* mflib/pp-setup: Default preprocessor setup file.
	* mflib/Makefile.am (inc_DATA): Add pp-setup
	* configure.ac: Install default pp-setup file if the preprocessor
	is m4

	Implement built-in and external preprocessors.
	
	* src/pp.c: New file.  Built-in preprocessor
	* src/lex.l, src/gram.y, src/mailfromd.h, src/main.c: Use
	preprocessor feature.
	* src/Makefile.am (mailfromd_SOURCES): Add pp.c
	(AM_CPPFLAGS): Define DEFAULT_PREPROCESSOR
	* tests/atlocal.in (MFOPTS): Disable external preprocessor
	* configure.ac: New option --with-preprocessor and variable
	DEFAULT_PREPROCESSOR
	
	* src/engine.c (listens_on): port argument was ignored

2007-05-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_dns.m4 (listens): Bugfix

	* po/pl.po, po/uk.po: Move to
	http://svn.gnu.org.ua/sources/mailfromd/trunk/po. Mailfromd is now
	officially registered at TP.
	* po/LINGUAS: Remove. The file is generated automatically
	* bootstrap: Get translations from the TP.
	* README-alpha: Update
	
2007-05-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/snarf.m4, src/init.m4, src/Makefile.am: Save namespace from
	pollution: Use m4_ prefixed keywords.
	* src/main.c: Add missing NLS markers

	* src/Makefile.am (EXTRA_DIST): Add daemon.c
	* src/prog.c (instr_symbol): Add missing NLS marker.
	* src/engine.c (mailfromd_daemon): Leave the first three
	descriptors open before attemtping to restart.

2007-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/debug.cin (debug_level_p): Change logic so that per-module
	specification takes precedence over the global one.

2007-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* po/uk.po: Ukrainian translation
	* po/pl.po: Minor fixes
	* po/LUNGUAS: Add uk
	* src/lex.l, src/gram.y, src/bi_dns.m4, src/mtasim.c,
	gacopyz/gacopyz.c: Minor fixes.

2007-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/symtab.c, src/lex.l, src/mu_dbm.c, src/engine.c,
	src/snarf.m4, src/dnscache.c, src/gram.y, src/debug.cin,
	src/drivers.c, src/bi_string.m4, src/bi_poll.m4, src/dnsbase.c,
	src/mailfromd.h, src/db.c, src/openat-die.c, src/spf.c,
	src/bi_dns.m4, src/cache.c, src/optab.opc, src/prog.c,
	src/bi_ipaddr.m4, src/bi_sa.m4, src/mf-status.mfi, src/bi_io.m4,
	src/main.c, src/Makefile.am, src/bi_other.m4, src/bi_mail.m4,
	src/mtasim.c, src/rate.c, src/bi_db.m4, tests/shadow.at,
	tests/invcidr.at, tests/invcidr2.at, configure.ac, gacopyz/smfi.c,
	gacopyz/gacopyz_priv.h, gacopyz/proc.c, gacopyz/server.c,
	gacopyz/io.c, gacopyz/Makefile.am, gacopyz/gacopyz.c,
	bootstrap: Add i18n framework 

	* po: New directory
	* po/POTFILES.in: New file
	* po/LINGUAS: New file
	* po/pl.po: New translation
	
2007-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	-= Release 4.0 =-
	
2007-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* bootstrap: Avoid importing openat-die.  This needs the following
	patch:
	http://lists.gnu.org/archive/html/bug-gnulib/2007-05/msg00056.html
	* README-alpha: Update
	* src/openat-die.c: New source
	* src/Makefile.am (mtasim_SOURCES): Add openat-die.c
	* doc/mailfromd.texi, doc/mtasim.texi: Update

2007-05-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac, NEWS: Raise version number to 4.0.  Ready for the
	release.
	* src/version.c: New file.
	* src/Makefile.am (libmf.a): New library
	* bootstrap (MODLIST): Add version-etc
	* src/mailfromd.h (mailfromd_version): New function
	* src/main.c, src/mtasim.c: Use mailfromd_version to display
	program version/license.  Remove --license option, because
	--version does the job.
	* tests/version.at: Fix version format to match that of version-etc
	output. 

	* doc/mailfromd.texi: Final polish.
	
2007-05-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Up to v.4.1 there were no
	txn argument to db->open.
	* src/engine.c (check_on_host): Clear last_poll_* values before
	startning the new poll.

2007-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (check_portspec): Bugfix

	* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Locking mode
	depends on the open flags.

2007-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mtasim.c: \E can take 1 and 2 digit codes.
	Correctly close the milter server before exiting
	* configure.ac: Call MU_DEBUG_MODE
	* doc/mailfromd.texi, doc/mtasim.texi: Update
	* acinclude.m4: New file
	* gacopyz/gacopyz.h, gacopyz/server.c (gacopyz_srv_abort)
	(gacopyz_srv_quit): New functions
	* gacopyz/gacopyz.c: Do not complain if the socket does not exist.

2007-05-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mailfromd.h (DEFAULT_PIDFILE): Use file name relative to
	the state directory
	* src/main.c (portspec,pidfile): Initialize dynamically.
	(init_names): New function
	(state_dir_fixup,portspec_fixup,fixup_state_dir_names): New
	functions
	(main): Call init_names and fixup_state_dir_names
	(mailfromd_show_defaults): Use variables, not defines (hmmm)

2007-05-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (convert_rate): Bugfix.
	* src/main.c: --predict implies --format=rate --list
	Update copyright years
	* doc/mailfromd.texi: Update
	* etc/Makefile.am (.in.mailfromd): Set executable bit on the
	target.

	* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): install errcall fn if
	debug level >= 1
	* src/engine.c (save_cmdline,sig_restart): New function
	(mailfromd_daemon): SIGHUP causes restart (if the program is
	invoked using the absolute file name)
	* src/mailfromd.h (getmaxfd): New macro from bi_io.m4
	(script_file,mtasim_option): New globals
	(log_setup,save_cmdline): New functions
	* src/bi_io.m4 (getmaxfd): move to src/mailfromd.h
	* src/main.c: New option --mtasim for mtasim interaction
	(log_setup): New function
	(main): Initial logging stream depends on whether stderr is closed
	or not.
	Save command line unless script file is not an absolute file name
	* src/mtasim.c (start_mailfromd): Use --mtasim instead of
	--foreground (mainly for further use.
	* configure.ac: Check for sysconf and getdtablesize
	* doc/mailfromd.texi: Update
	* doc/Makefile.am (check-fixmes): The rule missed multiline fixmes
	* etc/rc.in (mailfromd_status): remove trailing space from the
	first grep pattern
	(mailfromd_reload): New function
	New option `reload'

	* gacopyz/gacopyz_priv.h (struct gacopyz_conn): New members
	cleanup and cleanup_data.
	* gacopyz/proc.c (gacopyz_cleanup_conn): Call conn->cleanup
	* gacopyz/gacopyz.c (do_connect): Install a cleanup handler to
	remove the UNIX socket.
	* NEWS: Update
	
2007-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c (mu_dbm_strerror): Improve error logging.

2007-05-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c (lock_file): fcntl can return non-null values.
	Retry if F_GETLK returns F_UNLCK 
	(mu_dbm_open): Always use O_RDWR if the file could need to be
	locked for writing afterwards.

	Ensure begin blocks can set exception handlers:
	
	* doc/mailfromd.texi: Update
	* src/engine.c (xeval): Call env_save_catches after running begin
	blocks
	* src/prog.c (struct eval_environ.defcatch): New field

2007-04-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Use inner context to check for action usage in
	begin/end blocks.  This allows to define global catches.

2007-04-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c: Use F_SETLKW
	* src/engine.c (priv_get, filter_cleanup): Add missing env_init
	* src/gram.y: Reset state_tag after reducing prog rules
	(sendmail_action, header_action): Additional checks
	* src/main.c: New option --gacopyz-log
	* doc/mailfromd.texi: Document --gacopyz-log
	
	* gacopyz/smfi.c (smfi_setlogmask): Do what its name suggests.
	* gacopyz/gacopyz.h (SMI_LOG_UPTO, SMI_LOG_FROM): New macros
	(gacopyz_string_to_log_level, gacopyz_log_level_to_string): New
	functions
	* gacopyz/log.c (gacopyz_string_to_log_level)
	(gacopyz_log_level_to_string): New functions.

2007-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mailfromd.h (smtp_state_begin,smtp_state_end): New
	(pseudo)states.
	(struct db_format.enabled): New field
	* src/lex.l (begin,end): New keywords
	* src/gram.y (begin,end): New statements
	* src/engine.c (priv_get, filter_cleanup): call `begin' and `end'
	handlers.
	(mlfi_abort): Clear session-specific information

	* src/dnscache.c, src/cache.c, src/rate.c: Honor `.enabled' field 
	* src/bi_db.m4: Honor `.enabled' field
	(db_get_active,db_set_active): New builtins
	(greylist): Remove spurious debugging info
	* doc/mailfromd.texi: Update
	* NEWS: Update
	
	* src/mu_dbm.c [WITH_BDB]: Improve locking algo: yield control to
	the system before locking DB for writing to give other processes a
	chance to get the DB.
	* src/engine.c: Use SIGUSR1 to let the siblings know we changed
	lock status.
	(mailfromd_daemon,child_start): Ignore SIGUSR1.

2007-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* src/lex.l (parse_require): Bugfix
	* mflib/heloarg_test.mf, mflib/spf.mf: Begin the names of the static
	functions with __
	* doc/Makefile.am (check-refs): Scan all texi sources
	(check-mflib): Ignore static names (__.*)
	* doc/mailfromd.texi, doc/mtasim.texi, doc/macros.texi: Update.

2007-04-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l (parse_require): Bugfix
	* src/bi_mail.m4: Bugfix
	* src/mtasim.c: Implement help, fix directory removal at exit,
	implement readline history file.  Bugfixes in smtp()
	* tests/testsuite.at, tests/accept.at, tests/greylist.at,
	tests/arg.at, tests/reject.at, tests/numrcpt.at,
	tests/tempfail.at: Use mtasim -Xauto when necessary
	* configure.ac, NEWS: Raise patchlevel to 92
	* doc/mailfromd.texi: Update
	* doc/mtasim.texi: mtasim documentation
	* doc/Makefile.am: Add mtasim.texi
	* gacopyz/gacopyz_priv.h (struct gacopyz_conn): Keep information
	about children pids
	* gacopyz/proc.c (gacopyz_register_child)
	(gacopyz_unregister_child): New functions
	(cleanup_children): Call gacopyz_unregister_child
	(gacopyz_cleanup_conn): Terminate children individualy instead of
	sending TERM to the whole process group, because we might be not
	the group leader.
	* gacopyz/gacopyz.c (gacopyz_handle_connection): Register child
	pid after startup.
	* bootstrap: Require save-cwd.  Test if lib/daemon.c exists before
	attempting to create it.

2007-04-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mtasim.c: Implement --port=auto, a special mode, where
	mtasim starts the mailfromd on an agreed-upon port and terminates
	it before exiting.
	* bootstrap: Require mkdtemp

	* mflib/mx.mf: Remove.  Superceded by the `getmx' builtin function.
	* mflib/Makefile.am: Remove mx.mf
	* doc/mailfromd.texi, NEWS: Update

	* src/debug.cin, src/debugdef.m4 (debug_spec_string): New function
	(modname): Redefine as char *[]
	* src/lex.l, mflib/match_dnsbl.mf, mflib/heloarg_test.mf,
	mflib/mx.mf, mflib/valid_domain.mf, mflib/match_rhsbl.mf,
	mflib/spf.mf, tests/etc/cidr.rc, tests/etc/catch.rc,
	tests/etc/catch01.rc, tests/etc/poll-1.rc, etc/mailfromd.rc,
	NEWS: Introduce module system 

	* src/main.c: Minor wording fixes
	* src/Makefile.am (.cin.c): Require line info from m4
	* src/bi_other.m4 (debug_spec, debug_level): New functions.

2007-04-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/debugdef.m4, src/debug.cin, src/debug.hin: Debugging macros
	and supporting functions.
	* src/snarf.m4 (MF_SOURCE_DEBUG_NAME): New macro
	* src/lex.l, src/engine.c, src/dnscache.c,
	src/gram.y, src/dnsbase.c, src/mailfromd.h, src/dns.c, src/db.c,
	src/spf.c, src/cache.c, src/prog.c, src/main.c, src/rate.c: Use
	new debugging system.
	* src/Makefile.am: Build debug.[ch]
	* src/bi_other.m4 (cancel_debug): Removed
	
	* etc/sendmail-8.13.7.connect.diff: New file.  Patch for Sendmail
	to honor extended codes and textual messages returned by the connect
	handler.
	* etc/Makefile.am: Add sendmail-8.13.7.connect.diff

	* gacopyz/smfi.c, gacopyz/gacopyz.h (smfi_setlogmask): New function
	* gacopyz/gacopyz.c (gacopyz_handle_connection): Log an info
	message before finishing.

2007-04-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/syslog_async.c, src/syslog_async.h: Async syslog
	implementation by Simon Kelley
	* src/mailfromd.h, src/main.c, src/Makefile.am,
	configure.ac: Implement async syslog.
	
	* doc/mailfromd.texi, NEWS: Document syslog-async

	* gacopyz/gacopyz.c (gacopyz_handle_connection): Print connection
	info after forking, so the actual PID is displayed.

2007-04-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c: When possible lock BDB databases directly.
	For version 2.x fall back to external lock method.
	
	* src/snarf.m4 (MF_DEFINED, MF_OPTVAL): New macros
	* src/bi_string.m4, src/bi_dns.m4, src/bi_mail.m4,
	src/bi_db.m4: Use MF_DEFINED and MF_OPTVAL to test values of
	the optional variables.
	* src/main.c: New option --state-directory
	* doc/mailfromd.texi: Revert the description of `#pragma option'

	* src/gram.y (apply_deferred_init): Fix error messages
	* src/mailfromd.h, src/prog.c, src/main.c, src/bi_other.m4,
	NEWS: Implement stack traces.
	
	* mflib/match_dnsbl.mf, mflib/heloarg_test.mf,
	mflib/valid_domain.mf, mflib/match_rhsbl.mf, mflib/spf.mf,
	mflib/match_cidr.mf, doc/mailfromd.texi: Use <> in #include
	statements  

2007-04-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (mailfromd_daemon): Do not call
	mu_daemon_remove_pidfile, this results in a duplicate free at
	exit (compensate for mailutils bug)
	* src/bi_dns.m4 (getmx): Fix iteration over mxbuf

2007-04-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c, src/mu_dbm.h: Use external lock file for Berkeley
	DB (argghh)
	* src/mailfromd.h, src/db.c, src/main.c: Implement pragma option
	state-directory
	* tests/etc/config.in: Use #pragma option state-directory
	* doc/mailfromd.texi: Document #pragma option state-directory

	* gacopyz/gacopyz.c (shan_connect): Fix packet length calculation.
	* NEWS: Update
	
	* src/prog.c (instr_restex): Fix stack addressing (broken after 
	2007-04-01).  Add trace output.
	
2007-04-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mu_dbm.c: Re-implement database locking for Berkeley DB

        * src/mu_dbm.c, src/mu_dbm.h (mu_dbm_strerror): New function
        (mu_dbm_firstkey, mu_dbm_nextkey): Change signature
	* src/dnscache.c, src/db.c, src/cache.c, src/rate.c,
	src/bi_db.m4: Update for new mu_dbm interface.

2007-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c, src/mailfromd.h, src/prog.c, src/main.c,
	TODO, doc/mailfromd.texi: Provide a special exception type for
	unresolved sendmail macros. 

2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi, NEWS: Document SPF functions

2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (concat_args): Print all arguments in debuging
	mode.
	(mailfromd_daemon): Set single-process mode if requested
	(mlfi_abort): Do not call filter_cleanup.

	* src/mailfromd.h (single_process_option): New variable
	* src/prog.c: Fix initialization of toh and computation of
	heap bounds in gc.
	* src/main.c: New option --single-process (Do not use, unless you
	know what you are doing!)
	* gacopyz/smfi.c, gacopyz/gacopyz.h (smfi_set_foreground): New
	function.

2007-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (FOR ..) takes a stmtlist
	* src/bi_string.m4 (substr): Extra argument check
	* src/bi_dns.m4 (dns_getaddr, dns_getname): New functions
	* src/prog.c (expand_dataseg): Update `base'
	* doc/mailfromd.texi: Update

	* src/gram.y (loop_parm): Is a stmtlist
	* src/prog.c (instr_echo): Pop the argument

2007-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l, src/stack.c, src/gram.y, src/drivers.c,
	src/mailfromd.h, src/prog.h, doc/mailfromd.texi, NEWS: Implement
	loop statement.
	* etc/mailfromd.rc: Replace `next' with `pass'

	* src/prog.c (s_off_cmp): Revert sorting order to match that of
	heap growth.

	* src/drivers.c (code_memref, code_type_arg),
	src/prog.c (struct eval_environ, adjust_stack, env_base, get_arg)
	(push, pop, heap_reserve_words, heap_tempspace, heap_max_tempspace)
	(heap_fix_tempspace, instr_xchg, instr_dup, env_init)
	(env_make_frame, env_leave_frame, eval_environment, env_final_gc),
	src/prog.h, NEWS, doc/mailfromd.texi: Revert stack growth
	direction. Expand stack as the need arises.

	* src/gram.y (dataseg_layout): Make sure all global variables are
	subject to final_gc

2007-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to flat address space model. Data space (and stack) contain
	only references to objects within the data space (virtual
	addresses), no actual pointers are passed.
	
	* src/snarf.m4 (MF_ALLOC_HEAP, MF_COPY_STRING): Take two arguments
	(MF_BEGIN_TEMP_SPACE): Use env_data_ref
	(MF_VAR_SET_STRING): New macro
	* src/bi_poll.m4, src/bi_string.m4, src/bi_dns.m4, src/bi_spf.m4, 
	src/bi_sa.m4, src/bi_vars.m4, src/bi_db.m4: Use new heap
	allocation macros.
	* src/drivers.c (code_memref, code_type_string): Use opcode_push
	(code_type_variable): Remove opcode_svalidate. This time for good
	* src/mailfromd.h (env_throw_0): Change signature
	* src/prog.c (struct eval_environ.stack): Remove. Use plain
	addressing model. All references updated.
	(env_reference,env_var_ref): Remove
	(heap_reserve_words, heap_reserve): Return offset into the data
	space instead of the pointer. All uses updated.
	(env_data_ref): New function
	* src/opcodes (MEMEXT,MEM,SVALIDATE): Remove
	* src/prog.h (env_data_ref): New function
	(heap_reserve_words): New function
	(heap_reserve): Return size_t
	* TODO: Update
	
	* src/snarf.m4, src/prog.c, src/prog.h: Use different argument
	accessors for different argument types.

	* src/drivers.c (code_type_bin, code_type_regex,
	optimize_type_regcomp, code_type_regcomp), src/mailfromd.h (struct
	regcomp_data), src/prog.c (register_regex, instr_regex,
	instr_regcomp, instr_regmatch, instr_regmatch_mx): Use reserved
	rt_regex slots for dynamically compiled regular expressions.

2007-03-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am, src/mtasim.c: mtasim supports standard options.

	* src/drivers.c, src/prog.c, src/opcodes: Prepare the instruction
	set for array data type: remove PUSH_LITERAL, PUSH_IMMEDIATE,
	VARIABLE, AUTO, ARG; introduce instead MEM, MEMSTK, MEMEXT, DEREF;
	Change semantics of ASGN

2007-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/symtab.c, src/lex.l, src/gram.y, src/drivers.c,
	src/mailfromd.h, src/optab.opc, src/prog.c, src/opcodes,
	src/prog.h, src/main.c: Reimplement pre-compiled regular
	expressions.

2007-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac, Makefile: Switch to Autotest based testsuite
	* testsuite/: Remove
	* tests/: New directory
	* tests/farg.at, tests/ismx.at, tests/atlocal.in, tests/catch.at,
	tests/catch01.at, tests/version.at, tests/cond02.at,
	tests/shadow.at, tests/cond04.at, tests/relayed02.at,
	tests/cond06.at, tests/testsuite.at, tests/invcidr.at,
	tests/ack.at, tests/accept.at, tests/bctx00.at,
	tests/switchn1.at, tests/greylist.at, tests/switchn3.at,
	tests/cidr2.at, tests/fctx00.at, tests/switchs1.at,
	tests/invip2.at, tests/switchs3.at,  tests/poll02.at,
	tests/arg.at, tests/reject.at, tests/hostname.at,
	tests/resolve.at, tests/hasmx.at, tests/invcidr2.at,
	tests/macros.at, tests/cond01.at, tests/invip.at, tests/cond03.at,
	tests/relayed01.at, tests/numrcpt.at, tests/cond05.at,
	tests/prec.at, tests/strings.at, tests/rescname.at,
	tests/tempfail.at,   tests/bctx01.at, tests/switchn2.at,
	tests/cidr1.at, tests/switchn4.at, tests/cidr3.at,
	tests/fctx01.at, tests/Makefile.am, tests/poll.at,
	tests/switchs2.at, tests/poll01.at, tests/ml.at, tests/switchs4.at,
	tests/poll03.at: New files
	* tests/etc: New directory
	* tests/etc/reject.rc, tests/etc/farg.rc, tests/etc/cidr.rc,
	tests/etc/catch.rc, tests/etc/catch01.rc, tests/etc/cond.rc,
	tests/etc/dns.rc, tests/etc/macros.rc, tests/etc/relayed.rc,
	tests/etc/shadow.rc, tests/etc/var.rc, tests/etc/numrcpt.rc,
	tests/etc/strings.rc, tests/etc/prec.rc, tests/etc/relayed.list,
	tests/etc/ack.rc, tests/etc/accept.rc, tests/etc/tempfail.rc,
	tests/etc/switch.rc, tests/etc/greylist.rc, tests/etc/poll-1.rc,
	tests/etc/sa01.rc, tests/etc/sa02.rc, tests/etc/poll.rc,
	tests/etc/sa03.rc, tests/etc/config.in, tests/etc/sa04.rc,
	tests/etc/ml.rc, tests/etc/arg.rc: Move from testsuite/etc

2007-03-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y, srv/drivers.c: Remove `next' node type

	* src/drivers.c: New file. Code generation drivers.
	* src/gram.y: Include drivers.c and node-tab.c.
	* src/drv.awk: New file. Generate node-type.h and node-tab.c
	headers.
	* src/mailfromd.h: Include node-type.h instead of defining
	node_type.
	* src/Makefile.am: Add drivers.c, drv.awk and build rules for
	node-type.h and node-tab.c

2007-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mailfromd.h (getmxip): New function
	* src/dns.c (getmxip): New function
	* src/bi_dns.m4: (getmx): New built-in
	* doc/mailfromd.texi: Document getmx
	
	* src/prog.c (mx_match): Do not raise exception if mf_not_found is
	returned.
	* src/bi_sa.m4 (open_connection): Raise mf_url if unknown protocol
	is specified in the URL.
	* src/mtasim.c: Minor fix
	
2007-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c, src/gram.y, src/status.mfi, doc/mailfromd.texi:
	Implement connect handler. Pass additional argument to envfrom and
	envrcpt.
	* gacopyz/gacopyz.c (shan_connect): Bugfix
	* NEWS: Update

	* src/mtasim.c (process_gacopyz_reply): Do not switch to quit
	state unless SMFIR_SHUTDOWN is received.

	* testsuite/lib/mailfromd.exp: Use mtasim instead of sendmail
	* testsuite/etc/ml.pat, testsuite/etc/reject.pat: Adopt for
	mtasim.
	* gacopyz/server.c (gacopyz_srv_send_command): Bugfix

	* src/gram.y, src/mailfromd.h, src/prog.c, src/opcodes: Code
	regex_flags along with regcomp.
	* src/bi_dns.m4 (primitive_hasmx): Do not free mxbuf if the lookup
	failed. 
	* testsuite/mailfromd/hasmx.exp: Modify	
	
	* src/lex.l: Fix handling of double % and $ in literals
	* src/bi_ipaddr.m4 (len_to_netmask): Raise mf_range if n is out of
	range.
	* mflib/heloarg_test.mf: Fix typo
	* mflib/revip.mf: Revrite using IP built-ins
	* mflib/match_dnsbl.mf, mflib/strip_domain_part.mf,
	mflib/is_ip.mf, mflib/match_rhsbl.mf: Move detailed descriptions
	to the docs 
	* mflib/revip.mf: Rewrite using ntohl().

	* doc/mailfromd.texi: Update
	* doc/Makefile.am (check-mflib): New rule
	* NEWS: Update

2007-03-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/stack.c: New file
	* src/Makefile.am: Add stack.c
	* src/gram.y, src/mailfromd.h, doc/mailfromd.texi: Implement
	`#pragma regex push|pop'
	* mflib/match_dnsbl.mf,  mflib/strip_domain_part.mf,
	mflib/heloarg_test.mf, mflib/is_ip.mf, mflib/revip.mf,
	mflib/match_rhsbl.mf, mflib/spf.mf, mflib/match_cidr.mf: preserve
	user regex settings.

	* configure.ac, Makefile.am: Add mflib
	* NEWS: Update

	* mflib: New subdirectory
	* mflib/match_dnsbl.mf, mflib/strip_domain_part.mf,
	mflib/heloarg_test.mf, mflib/is_ip.mf, mflib/safedb.mf,
	mflib/mx.mf, mflib/dns.mf, mflib/revip.mf, mflib/valid_domain.mf,
	mflib/match_rhsbl.mf, mflib/spf.mf, mflib/Makefile.am,
	mflib/match_cidr.mf: New files

	* doc/Makefile.am: Remove extract.awk
	* doc/extract.awk: Remove
	* doc/mailfromd.texi: Update

	* src/symtab.c, src/gram.y, src/mailfromd.h: Implement optional
	arguments for user functions 
	* src/lex.l: Implement #include_once
	* src/prog.c (name_destroy): Free the object
	* src/bi_ipaddr.m4 (match_cidr): Remove. The function is
	implemented in MFL (mflib/match_cidr.mf)

	* testsuite/lib/mailfromd.exp, testsuite/etc/cidr.rc,
	testsuite/etc/catch.rc, testsuite/etc/catch01.rc,
	etc/mailfromd.rc: Use includes when necessary

2007-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/snarf.m4, src/bi_dns.m4, src/bi_dns.m4, src/bi_sa.m4,
	src/bi_other.m4, src/bi_mail.m4, src/bi_db.m4: Use MF_THROW
	instead of MF_CATCH

	* src/gram.y, src/mailfromd.h,  src/prog.c, src/opcodes,
	src/prog.h, TODO: Provide access for outermost auto variables and
	parameters from catch blocks.
	
	* testsuite/etc/hasmx.rc, testsuite/etc/dns.rc: Use primitive_
	functions.

	* src/lex.l, src/gram.y, src/mailfromd.h, src/prog.c,
	src/opcodes: Implement throw statement 
	* src/bi_dns.m4 (match_cidr): Move into bi_ipaddr.m4
	* src/bi_ipaddr.m4: New module
	* src/Makefile.am: Add bi_ipaddr.m4
	* doc/mailfromd.texi: Initial doc for IP functions
	* NEWS: Update
	
2007-03-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dnsbase.c (comp_pref): Secondary ordering by MX name
	* src/main.c, testsuite/lib/mailfromd.exp, doc/mailfromd.texi:
	Discontinue support for the old semantics of options -c, -l and -L.
	* doc/Makefile.am (check-exceptions): Fix the rule 
	* NEWS: Update

	* src/engine.c, src/gram.y, src/dnsbase.c, src/mtasim.c: Minor
	stylistic and bug fixes.

2007-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi (Data Types): Fix description of numeric
	data type implementation.

	* etc/Makefile.am (DEFAULT_PIDFILE): Fix the leftover usage of
	MAILFROMSTATEDIR
	* src/engine.c (check_on_host): Break sender email iteration if
	the server tempfails.

2007-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mtasim.c: Implement basic milter support
	Implement long options.
	* gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h, gacopyz/server.c: Update

2007-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c, src/gram.y, src/mailfromd.h: Implement prog data
	* src/mtasim.c: Implement headers
	* gacopyz/gacopyz_priv.h, gacopyz/gacopyz.c: Fix processing of
	data and eoh
	* gacopyz/server.c: Implement most of the stuff
	
	* src/mtasim.c: Implement mail from and rcpt to
	* gacopyz/gacopyz.h: Likewise
	* gacopyz/gacopyz_priv.h: Likewise
	* gacopyz/log.c: Likewise
	* gacopyz/server.c: Likewise
	* gacopyz/io.c: Likewise

2007-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am: Allow to specify the m4 binary.

	* src/prog.c (env_push_string): Use pushs. This makes sure that
	the handler arguments are allocated in heap, which is necessary
	for normal functioning of the gc.
	* src/engine.c (mlfi_body): Pass bodyp as number. This is a
	temporary kludge.
	* testsuite/etc/ack.rc: The above change needs extra 2 words for
	the stack allocation.

	* NEWS: Update


2007-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/symtab.c (function_install): Init statemask
	* src/gram.y: Fix builtin context checks. Implement function
	context checks.
	* src/mailfromd.h (struct function): New member `statemask'
	* src/Makefile.am: Exempt mtasim from installcheck
	* testsuite/mailfromd/functx.exp: New testcase
	* testsuite/mailfromd/DISTFILES: Add functx.exp
	* testsuite/etc/Makefile.am: Add sa*.rc
	* testsuite/etc/sa01.rc, testsuite/etc/sa02.rc,
	testsuite/etc/sa03.rc, testsuite/etc/sa04.rc: New files.
	
	* NEWS: Update

	Start implementing test MTA simulator.
	
	* src/mtasim.c: New file
	* src/gram.y: Minor fixes
	* src/main.c: New option --gacopyz-debug
	* src/Makefile.am: Build nullmta
	* gacopyz/io.c: New file
	* gacopyz/server.c: New file
	* gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h, gacopyz/log.c, 
	gacopyz/gacopyz.c, gacopyz/Makefile.am: Start implementing server
	code. 

2007-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/spf.c (spf_data): Add mech
	(parse_record): Always allocate expr_space
	* src/bi_spf.m4 (update_spf_vars): Bugfix
	* src/prog.c (instr_backref): Allow to reference optional groups
	* src/Makefile.am (noinst_HEADERS): Add spf.h

	* src/lex.l: New built-in macro __statedir__
	* NEWS: Update
	* src/mailfrom.h: Finally renamed to 
	* src/mailfromd.h: this

	Affected files:
	
	* src/symtab.c, src/mu_dbm.c, src/engine.c, src/snarf.m4,
	src/dnscache.c, src/gram.y, src/dnsbase.c, src/dns.c, src/db.c,
	src/spf.c, src/spf.h, src/cache.c, src/optab.opc, src/prog.c,
	src/mf-status.mfi, src/main.c, src/Makefile.am, src/rate.c

2007-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (constdecl): Return NULL. Fixes coredump if const is
	used within a code block.

2007-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/mailfrom.h (node_type_noop): New node type
	* src/gram.y: Allow declarations of initialized variables.
	(print_node) <node_type_return>: Fix coredump on void returns
	(optimize_node): Fix coredump on `if 0 <expr>'
	* NEWS: Update
	
	* src/spf.c: Change handling of modifiers.

	* src/dnsbase.c, src/spf.c, src/dns.h, src/spf.h,
	bi_spf.m4: Change calling convention for the interface
	functions (spf_query_t, spf_answer_t); fix IP address comparisons;
	implement builtin spf variables

2007-02-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/spf.c: Implement all modifiers, improve debugging.

2007-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dnsbase.c (_getmx, dns_get_mx_records): ttl can be NULL
	* src/spf.c: Implement all mechanisms

	* src/spf.c, src/spf.h: Templates for SPF support
	* src/bi_spf.m4: Interface definitions for SPF support
	* src/dns.c: Move generic DNS calls to dnsbase.c. Retain only
	interface calls.
	* src/dnsbase.c, src/dns.h: Generic DNS support

	* src/mailfrom.h: Move generic DNS declarations to dns.h
	* src/engine.c, src/bi_dns.m4, src/prog.c: Rename freemx to
	dns_freemx
	* src/main.c: Fix warning message wording
	* src/Makefile.am: Add new sources
	* bootstrap (MODLIST): Add memrchr

2007-02-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* gacopyz/trans.awk: Always quote /dev/stderr

2007-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Move version control under SVN. Remove .cvsignore files.
	CVS copy kept around for references.

2007-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* src/gram.y: Change deprecation warning.

	* gacopyz/proc.c (gacopyz_cleanup_conn): Print debugging message;
	Do not display spurious 'signal 15' messages
	* src/engine.c (mailfromd_daemon): Improve logging

	* src/main.c: Hide deprecated command line options

	* src/bi_vars.m4 (builtin_post_setup): Use string_alloc to
	allocate literals
	* src/mailfrom.h (DEFAULT_FROM_ADDRESS): New define
	* src/main.c: Use DEFAULT_FROM_ADDRESS

	* src/gram.y: Store xlat tables in the data segment.
	* src/prog.c: Likewise
	* src/mailfrom.h (struct switch_stmt): Additional fields to help
	code generation
	* src/opcodes (XLAT, XLATS): instruction data has 2 words
	* src/optab.opc (scan_code): Remove special handling for xlat(s)

	Create a relocatable code. Fixup relocatable references before
	entering the working mode.
	
	* src/optab.opc: New file
	* src/optab.oph: New file
	* src/opcode.awk: New file
	* src/opcodes: New file
	* src/Makefile.am: Add optab.opc, optab.oph, opcode.awk
	* src/gram.y: Use code_op instead of code_instr
	* src/mailfrom.h (instr_*): Remove prototypes.
	(code_op, fixup_code): New prototypes.
	* src/main.c (main): Call fixup code
	* src/mf-status.mfi: Indicate c mode for emacs.
	* src/prog.c (prog): Remove static qualifier
	(code_op): New function
	(dump_*): Change number of arguments
	(optab,find_op): Remove
	(dump_code): Rewrite using scan_code
	(fixup_code): New function
	(print_code): Rewrite using dump_code
	* src/prog.h (struct optab): New data type
	(scan_code): New function
	(prog): extern decl

2007-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* etc/mailfromd.rc: Remove pragma option mailfrom and ehlo
	* src/gram.y,src/symtab.c: Use parse_warning where appropriate
	* src/lex.l, src/mailfrom.h (parse_warning)
	(parse_warning_locus): New functions
	* src/main.c: Print informative warning messages where
	(pragma or command line option) ehlo or mailfrom is used

2007-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* src/bi_vars.m4 (builtin_post_setup): smtp_domain and
	postmaster_email removed.
	* src/gram.y: Bugfix
	* src/main.c (smtp_domain,postmaster_email): Remove
	--ehlo and --mailfrom deprecated

	* gacopyz/context.c (smfi_setpriv, smfi_getpriv): Rename to
	gacopyz_*
	* gacopyz/gacopyz.h (gacopyz_setpriv, gacopyz_getpriv): New
	functions.
	* src/bi_other.m4, src/bi_sa.m4: Minor fixes.
	* src/db.c (db_format_enumerate, db_format_install)
	(db_format_lookup): New functions
	* src/dns.c (_resolve_ipstr): Always copy ipstr to namebuf
	* src/engine.c (MLFIPRIV): Remove unused macro. Use gacopyz_
	calls instead of smfi_ ones, except for initialization functions.
	* src/gram.y: Provide for deferred variable initialization (to
	initialize variables from the command line).
	* src/lex.l (free_string_space, mf_strdup): New functions
	* src/mailfrom.h (struct old_header_node.name): const
	(SYM_DB_FORMAT): Remove macro
	(free_symbols,defer_initialize_variable,free_string_space)
	(db_format_enumerate): New functions.
	* src/main.c (options, parse_opt): New option -v
	(mailfromd_expire, mailfromd_compact)
	(mailfromd_show_defaults): Use db_format_enumerate instead of
	symbol_enumerate
	(main): Free symbol and string space after compiling the script.
	* src/prog.c (env_reference): Minor enhancement
	(env_set_variable): Fix call to mu_error
	* src/symtab.c (union symentry): Remove v.db
	(free_symbols): New function
	(db_format_install, db_format_lookup): Remove. Reimplement in db.c
	* testsuite/mailfromd/catch.exp: Update invocations of mailfromd

2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* src/prog.c (struct optab): Fix opname for instr_asgn
	(env_final_gc): Bugfix

	* doc/Makefile.am (check-exceptions): Fix rule
	* doc/mailfromd.texi: Update
	* src/gram.y (asgn:): Remove erroneous flag assignement
	(branch:): Warn about legacy constant usage only once
	(LOCUS_EQ): Moved to mailfrom.h
	(code_node): Restore svalidate - synch with 3.1 branch.
	Call MARK_LOCUS under node_type_result
	* src/lex.l: Warn about legacy constant usage only once
	Implement #error.

	* etc/mailfromd.rc: Update
	* src/main.c (main): Remove call to builtin_post_setup.
	* src/prog.c (instr_variable): Print more trace info
	(instr_svalidate): Restore - synch with 3.1 branch.
	
2007-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Do not compile autogenerated functions at once.
	Expand unprefixed named constants only when a value is expected
	* src/lex.l: Likewise
	* src/mailfrom.h (struct stmtlist): New data type

2007-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* configure.ac: Raise patchlevel to 91
	* doc/mailfromd.texi: Update
	* src/Makefile.am (status.mfh, mf-status.c): New built sources
	* src/mfstat.awk: New file
	* src/status.mfi: New file
	* src/mf-status.mfi: New file
	* src/mailfrom.h, src/bi_dns.m4 (mf_resolve): Rename to mf_noresolve
	* src/gram.y (string: STRING): Fix incorrect argument to parse_error
	(parse_program): Remove call to post_parse
	(branch: WHEN): Issue deprecation warning if &const is used.
	(string_to_stat, mf_status_str): Defined in separate source
	* src/lex.l (lex_setup): Change default include path
	Issue deprecation warning if &const is used.
	Allow to use constants both in the program text and in literals
	* src/prog.c (string_off,string_count): Removed. Relocation table
	is used instead.
	* src/prog.h (post_parse): Remove
	* testsuite/etc/catch.rc: Include <status.mfh>, do not use &const.
	* testsuite/etc/catch01.rc: Likewise
	* testsuite/etc/hasmx.rc: Likewise
	* testsuite/etc/poll-1.rc: Likewise
	* testsuite/etc/poll.rc: Likewise
	* testsuite/lib/mailfromd.exp: Update include path

2007-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y, src/lex.l, src/mailfrom.h, src/prog.c: Store
	locus.file in the dataseg.

	* src/gram.y: Implement const declarations
	* src/lex.l: Likewise
	* src/mailfrom.h: Likewise
	* src/symtab.c: Likewise
	* src/main.c: Minor change
	* src/prog.c: Minor change
	
2007-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* gacopyz/gacopyz.h (GACOPYZ_VBUFSIZE): New define
	(gacopyz_format_vbuf): New decl
	* gacopyz/log.c (VBUFSIZE): Rename to GACOPYZ_VBUFSIZE
	(format_vbuf): Rename to gacopyz_format_vbuf; make extern
	* src/bi_mail.m4, src/bi_sa.m4, src/bi_system.m4, src/cache.c,
	src/dns.c, src/dnscache.c, src/engine.c, src/main.c,
	src/rate.c: Minor fixes
	* src/bi_vars.m4 (builtin_post_setup): Change initialization of
	ehlo_domain and mailfrom_address.
	* src/gram.y, src/mailfrom.h, src/prog.c, src/symtab.c: Use
	literals instead of string pointers. 
	Each string reference in the resulting program should point
	within the current stack or data space (except for the values of
	Sendmail macros).
	* src/lex.l (string_alloc,string_finish): Return literal
	
2007-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_vars.m4 (builtin_post_setup): Change initialization of
	ehlo_domain and mailfrom_address built-in variables.
	* src/gram.y: Put string values initially assigned to the
	variables into the data segment. Redo its planning.
	Process only variables marked as volatile (built-in) or as
	referenced.
	(builtin_variable_install): Initialize flags.
	(vardecl): Remove initialization of var->off
	(externdecl): Change declaration.
	(initialize_variable,ensure_initialized_variable)
	(dataseg_layout): New functions
	* src/prog.c: Redo data segment initialization and handling.
	(dataseg,datasize,dataseg_reloc,dataseg_reloc_count): New
	variables
	(struct eval_environ.var): Rename to dataseg
	* src/prog.h (B2STACK): New macro (moved from prog.c)
	(variable_declared_p,declare_variable): Removed
	(ensure_initialized_variable): New function
	(dataseg,datasize,dataseg_reloc,dataseg_reloc_count): New externs
	
2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* TODO: Update
	* src/engine.c (smtp_last_received): Remove superfluous
	conditional
	(method_strict,method_standard): Set last_poll_* variables to "",
	not NULL
	* src/gram.y: First build the entire tree, than compile it at
	once.
	Fix varaible shadowing.
	Reorganize lexical tie-ins.
	* src/lex.l: New keyword `const'.
	(parse_error,parse_error_locus): Increase buffer size to 512.
	* src/mailfrom.h (enum lexical_context): New data type.
	(struct catch_node.context): New field
	(struct progdecl, struct funcdecl): New data types.
	(enum node_type): Add new types: node_type_funcdecl and
	node_type_progdecl.
	(struct node.v): New members progdecl and funcdecl
	(VAR_REFERENCED): New macros
	(struct variable): New fields next and owner
	(variable_replace): New function
	* src/symtab.c (init_variable): New function
	(variable_install): Use init_variable
	(variable_replace): New function
	* testsuite/etc/shadow.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add shadow.rc
	* testsuite/mailfromd/shadow.exp: New file
	* testsuite/mailfromd/DISTFILES: Add shadow.exp

2006-12-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Fix typo

2006-12-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Do not quote DEFAULT_LOG_FACILITY
	* NEWS: update
	* src/bi_string.m4 (unfold) new function
	* src/engine.c (check_on_host): Issue RSET if the previous MAIL
	FROM returned 4xx
	(mlfi_helo): Push malloced copy of helohost
	* src/main.c (option_deprecated): mark as warning.

2006-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* src/bi_string.m4 (message_header_decode, message_header_encode):
	New functions.

2006-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* TODO: Update
	* doc/mailfromd.texi: Update the description of resolve and the
	code of match_dnsbl and match_rhsbl
	* src/bi_dns.m4 (resolve): Take an optional second argument
	* src/dns.c (is_ipaddr): Stricter check
	(struct loop_data.atype): New member
	(cnameloop): Return the type of obtained answer in atype
	(_resolve_ipstr): Additional argument: domain to look up into. If
	not NULL, the ipstr is not reversed
	(resolve_ipstr_domain): New function
	(resolve_ipstr): Rewrite using resolve_ipstr_domain
	(_resolve_hostname): Convert IP to string if gotten T_A. All
	callers updated.
	* src/lex.l: Allow `==' as well as `='
	* src/mailfrom.h (resolve_ipstr_domain): New function 

	* src/main.c (switch_to_privs): Refuse to run as root
	* doc/mailfromd.texi: Fix typo.
	* bi_io.m4, db.c, dnscache.c, engine.c, gram.y, lex.l, main.c,
	prog.c: Capitalize diagnostic messages
	
2006-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* configure.ac: New configuration variable DEFAULT_LOG_FACILITY
	* doc/mailfromd.texi: Update
	* src/main.c (main): Set log_facility.

	* src/lex.l: Allow any amount of whitespace between the function
	name and the opening parenthesis.
	* src/lex.l: Fix the previous patch
	* src/gram.y: Revert accidental commit

2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Synchronization with 3.1 branch:

        * NEWS, configure.ac: Version 3.1.90
        * doc/mailfromd.texi: Fix typo
        * src/bi_sa.m4 (spamd_send_stream): Assume captured stream already
        has \r in front of each \n
        (clamav): always shutdown data stream as a fd-style stream.
        * src/dns.c (_resolve_ipstr): First argument is const
        (resolve_ipstr,resolve_hostname): First argument is const
        * src/dnscache.c (parse_value,dns_make_key)
        (dns_cache_get,dns_cache_put): keystr is const
        * src/gram.y (optimize_node): Fix typo that caused correct
        `matches' conditions to be rejected (e.g. strip_domain_part.mf)
        * src/mailfrom.h (resolve_ipstr,resolve_hostname): First argument
        is const
        (dns_cache_get,dns_cache_put): keystr is const
        * src/snarf.m4 (MF_BEGIN_TEMP_SPACE): Do not terminate with a
        semicolon, since the statement is supposed to be used in argument
        declarations.

2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Fix typo
	* src/bi_sa.m4 (spamd_send_stream): Assume captured stream already
	has \r in front of each \n
	(clamav): always shutdown data stream as a fd-style stream.
	* src/dns.c (_resolve_ipstr): First argument is const
	(resolve_ipstr,resolve_hostname): First argument is const
	* src/dnscache.c (parse_value,dns_make_key)
	(dns_cache_get,dns_cache_put): keystr is const
	* src/gram.y (optimize_node): Fix typo that caused correct
	`matches' conditions to be rejected (e.g. strip_domain_part.mf)
	* src/mailfrom.h (resolve_ipstr,resolve_hostname): First argument
	is const
	(dns_cache_get,dns_cache_put): keystr is const
	* src/snarf.m4 (MF_BEGIN_TEMP_SPACE): Do not terminate with a
	semicolon, since the statement is supposed to be used in argument
	declarations.
	
2006-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am (install-data-local): Rename leftover
	MAILFROMSTATEDIR
	* src/rate.c (get_rate): Bug fix: attempt to free auto storage

2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS, configure.ac: Version 3.1

2006-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS, configure.ac: Update patchlevel
	* doc/mailfromd.texi: Finished docs for 3.1

	* configure.ac (MAILFROMSTATEDIR): Rename to DEFAULT_STATE_DIR
	* src/Makefile.am: Likewise
	* src/mailfrom.h: Likewise
	* src/main.c: Likewise
	* src/bi_dns.m4 (resolve): Return "0" if the argument is not
	resolved.
	* src/gram.y: Mark comparison operators as nonassoc
	
	* doc/Makefile.am (extract): Handle include dependencies
	* doc/extract.awk: Handle @multitable blocks.  Print a diagnostic
	message if some other function is required
	* doc/mailfromd.texi: Almost finished
	* doc/fdl.texi: Fix overfull hblock
	
2006-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/Makefile.am: Minor change
	* doc/mailfromd.texi: Update
	* src/gram.y (print_locus): Bugfix
	* testsuite/etc/config.in: Remove extra space

	* NEWS: Update
	* doc/untabify.el: New file
	* doc/Makefile.am (EXTRA_DIST): Add untabify.el
	(check-format,untabify,final): New targets
	* doc/mailfromd.texi: Consistently use `filter script' instead of
	`configuration file'.  Add some missing information.
	* etc/rc.in: Do not use obsolete -c option to mailfromd
	* testsuite/lib/mailfromd.exp, testsuite/mailfromd/ack.exp,
	testsuite/mailfromd/arg.exp, testsuite/mailfromd/catch.exp,
	testsuite/mailfromd/cidr.exp, testsuite/mailfromd/cond.exp,
	testsuite/mailfromd/dns.exp, testsuite/mailfromd/hasmx.exp,
	testsuite/mailfromd/macros.exp, testsuite/mailfromd/poll.exp,
	testsuite/mailfromd/prec.exp, testsuite/mailfromd/relayed.exp,
	testsuite/mailfromd/strings.exp, testsuite/mailfromd/switch.exp,
	testsuite/mailfromd/var.exp: Likewise 
	
	* src/Makefile.am (builtin.h): Depend on M4_FILES

	* src/gram.y, src/mailfrom.h, src/main.c: Remove -c option. Remove
	the inconsistent usage of `config_' prefix.
	* src/lex.l: Allow hex numbers to be prefixed with 0X as well.

2006-12-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* src/bi_mail.m4: New file
	* src/Makefile.am: Add bi_mail.m4
	* src/main.c: Use "mailer" capability

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* src/dns.c (get_mx_records): Use resolve_ipstr to resolve IP
	addresses.
	* src/gram.y: Implement bitwise operators: &, |, ^, ~
	Implicit declarations within functions create automatic
	variables.
	* src/lex.l: Accept C-like notations for hex and octal numbers.
	* src/mailfrom.h: Implement bitwise operations
	* src/prog.c: Likewise

	* NEWS: Update
	* configure.ac: There's no use to pass MAILFROMSTATEDIR and
	DEFAULT_SOCKET in config.h, revert to the prior scheme
	* src/Makefile.am (AM_CPPFLAGS): Likewise
	* gacopyz/proc.c (print_status): Log normal child exits at
	SMI_LOG_INFO priority
	* src/dnscache.c (dns_cache_get): Do not log error message if the
	file does not exist.
	Make sure rc is meaningful
	(dns_cache_put): Free temporary storage
	* src/lex.l: Implement search path for include files
	* src/mailfrom.h (add_include_dir): New proto.
	* src/main.c: New option -I (--include)
	* testsuite/etc/greylist.in: Remove
	* testsuite/etc/greylist.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add config.in.  Replace
	greylist.in with greylist.rc
	(noinst_DATA, CLEANFILES): Add config.rc, remove greylist.rc
	* testsuite/etc/.cvsignore: Add config.rc, remove greylist.rc
	* testsuite/etc/config.in: New file
	* testsuite/etc/dns.rc: Include config.rc
	* testsuite/etc/hasmx.rc: Likewise
	* testsuite/etc/greylist.pat: Remove :RCDIR instruction
	* testsuite/lib/mailfromd.exp (start_daemon,mailfromd_exec): Add
	-I option
	* testsuite/mailfromd/greylist.exp: Remove conditional
	
	* NEWS: Update
	* configure.ac: Refuse to build without DBM.
	Pass all default values via config.h
	Print configuration summary at the end of the run.
	* doc/mailfromd.texi: Update
	* src/Makefile.am (AM_CPPFLAGS): Remove extra defines.  These are
	now passed via config.h
	* src/bi_db.m4, src/cache.c, src/db.c, src/dnscache.c,
	src/mailfrom.h, src/main.c, src/rate.c [!USE_DBM]: Remove.  DBM is
	now required.

2006-12-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* Makefile.am (alpha,alphacheck): New rules
	* NEWS: Update
	* configure.ac: Define DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
	* doc/mailfromd.texi: Update
	* src/Makefile.am (AM_CPPFLAGS): Define
	DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
	* src/dns.c (getmx,resolve_ipstr,resolve_hostname): Enable
	negative caching
	* src/dnscache.c (dns_cache_put): Fix calculation of the
	expiration date for negative records.
	(dns_cache_format_struct): Use
	DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
	* src/gram.y (pragma_database): Handle special cases for `database
	dns'.
	* src/main.c (db_format_enumerator): Likewise
	* testsuite/mailfromd/DISTFILES: Add dns.exp
	
	* doc/mailfromd.texi: Document the dns database

	* configure.ac: Check for unsigned 32-bit integer type
	* gacopyz/Makefile.am (noinst_PROGRAMS): Remove
	* gacopyz/gacopyz_priv.h: (MI_TIMEOUT): Rename to GACOPYZ_TIMEOUT
	(mi_uint32_t): Rename to gacopyz_uint32_t
	Set gacopyz_uint32_t based on the result of a configure check
	(MILTER_OPTLEN): Rename to GACOPYZ_OPTLEN
	* gacopyz/gacopyz.c: Likewise 
	* src/dnscache.c: New file
	* src/Makefile.am: Add dnscache.c
	* src/bi_dns.m4: Rewrite using new dns functions
	* src/dns.c: Rewrite using global cache
	(resolve_hostname): New function
	(resolve_ipstr): Change signature
	* src/mailfrom.h (resolve_ipstr): Change prototype
	(resolve_hostname): New function
	(DEFAULT_DNS_DATABASE): New define
	(dns_cache_get,dns_cache_put): New functions
	* src/main.c (host_in_relayed_domain_p): Rewrite using new
	resolve_ipstr
	(db_format_setup): Initialize dns_cache_format
	* src/prog.c (struct eval_environ.dict): Remove. All uses updated.
	* testsuite/etc/dns.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add dns.rc
	* testsuite/etc/dns.exp: New test case
	* testsuite/mailfromd/DISTFILES: Add dns.exp

2006-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c (env_final_gc): Free temporary storagee before
	returning. 

2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (mlfi_envfrom): print entire argument array in
	debug level 70
	(mlfi_envrcpt): Likewise.

	* src/mailfrom.h (debug macros): Rewritten

	* configure.ac: Raise patchlevel to 92
	* NEWS: Likewise.
	
2006-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	* bootstrap: Minor change
	* doc/mailfromd.texi: Update
	* src/gram.y (print_node): Handle nonprintable characters in strings.

	* NEWS: Update
	* src/engine.c (method_standard): Fix the call to
	set_last_poll_result.
	* src/gram.y: Implement cross-reference listing.
	* src/mailfrom.h (struct variable): New member xref.
	(env_final_gc): New proto.
	* src/main.c: New option --xref (--dump-xref)
	* src/prog.c: Implement simple GC for compacting the heap space.
	* src/prog.h (post_parse): New proto

2006-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_poll.m4: Minor indentation fix
	* src/prog.c (instr_retcatch): Call env_leave_frame with nargs=1
	(env_catch pushes one argument)
	(env_init): Remove initialization of toh
	(create_environment): Initialize toh here (see the comment).

	* src/gram.y (copy_node): New function
	(print_node): Print "STRING" for node_type_string
	(optimize_arith): Immediate calculations if one of the arguments
	is 0 or 1. Side effect: catches all types of division by zero
	errors.
	(optimize_node): Optimize concatenations with an empty string
	(codegen): Do not attempt to generate code if the optimization
	resulted in errors.
	* src/lex.l (parse_error_locus): Bugfix
	* src/prog.c (optab): Add missing entry (NEG)
	
	* src/prog.c (eval_environment): Prevent coredumps on invalid
	PC values.

	* src/bi_other.m4 (disable_program_trace): Rename to
	cancel_program_trace.
	* NEWS: Update
	
	* src/bi_system.m4 (bi_strftime): Call MF_RETURN_TEMP_SPACE with
	an argument.
	* src/snarf.m4 (MF_RETURN_TEMP_SPACE): Bugfix - call
	heap_fix_tempspace.
	Take an optional argument specifying the size of the data stored
	in the temporary memory.
	
2006-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/builtin.def: New file
	* src/init.m4: New file
	* src/Makefile.am  (noinst_HEADERS,EXTRA_DIST,BUILT_SOURCES): Add
	builtin.h, builtin.def, init.m4
	(.def.h): New rule
	* src/bi_db.m4, src/bi_dns.m4, src/bi_io.m4, src/bi_other.m4,
	src/bi_poll.m4, src/bi_sa.m4, src/bi_string.m4, src/bi_system.m4,
	src/bi_vars.m4: Use MF_INIT without arguments
	* src/mailfrom.h (__DBG): Change definition
	(enable_module_trace,disable_module_trace,enable_prog_trace)
	(disable_prog_trace,debug_level_p,enable_debug)
	(enable_debug_list,disable_debug_list): New functions
	(prog_trace_option): Remove declaration
	* src/main.c (disable_prog_trace,debug_level_p,enable_debug)
	(enable_debug_list,disable_debug_list): New functions
	The option --debug can take a comma-separated list of debug
	specifications.
	The option --trace-program takes as an optional argument a
	comma-separated list of modules to trace
	* src/prog.c, src/prog.h: Change to new tracing scheme
	* src/snarf.m4: Assume C comments
	(MF_MODULE_NAME,MF_MODULE_MASK): New defines
	(mf_prog_trace): New define
	(MF_DEFUN): Change to new tracing scheme
	(MF_INIT): Do not take a mandatory argument. Deduce the module
	name from the file name.

2006-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c (instr_symbol): Return the value using pushs, not
	push. 

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* src/bi_db.m4 (dbput): Throw exception after closing the db
	(dbdel): New function
	* src/bi_system.m4 (system): Return exit code of the executed
	command.
	* src/gram.y: Allow constant expressions in top-level set
	statements.

2006-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_system.m4 (strftime): New function
	* src/lex.l: Fix handling of escape sequences at the beginning of
	a string and before the beginning of an interpreted sequence
	within the string.
	* src/prog.c (heap_max_tempspace, heap_fix_tempspace): New
	functions.
	* src/prog.h: Likewise
	* src/snarf.m4 (MF_BEGIN_TEMP_SPACE,MF_END_TEMP_SPACE)
	(MF_RETURN_TEMP_SPACE): New macros

	* src/gram.y: Various fixes

	* src/bi_db.m4 (dbmap_lookup): Defval can be NULL
	Make sure returned string is null-terminated
	(dbput): New built-in function
	* src/bi_system.m4 (time): New built-in
	* src/gram.y (codegen): Two more arguments
	(forget_autos): Take number of parameters as an argument.
	Clear auto_list
	(BUILTIN_P): Renamed to BUILTIN_PROC
	(FUNCTION_P): Renamed to FUNCTION_PROC
	(BUILTIN_P,FUNCTION_P): New tokens. Lowest precedence
	Fix code generation for function arguments and the precedence of
	function or built-in calls without parens
	* src/lex.l (BUILTIN_P,FUNCTION_P): New tokens
	(IDENT}/"("): New rule
	* src/snarf.m4: Fix handling of zero argument count
	* src/symtab.c (remove_symbol): Fix assertion
	* testsuite/etc/farg.rc: New file
	* testsuite/etc/prec.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add farg.rc and prec.rc
	* testsuite/mailfromd/DISTFILES: Add prec.exp
	* testsuite/mailfromd/arg.exp: Add new test (farg.rc)

2006-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/bi_io.m4: New file
	* src/bi_system.m4: New file
	* src/Makefile.am (RCFILES): Add bi_io.m4 and bi_system.m4
	* src/gram.y: Modify error handling and proccall production.
	Get rid of svalidate.
	* src/lex.l: New tokens FUNCTION_P and BUILTIN_P
	(parse_error,parse_error_locus): Increment error_count unless fmt
	begins with `warning:'.
	* src/mailfrom.h (mf_ioerr): New exception
	* src/prog.c: Keep builtin-specific private data in struct
	eval_environ.
	(builtin_priv_register,env_get_builtin_priv): New functions
	(builtin_setup): Call system_init_builtin and io_init_builtin
	* src/prog.h  (env_get_builtin_priv)
	(builtin_priv_register, error_count): New declaration
	* src/snarf.m4 (MF_DECLARE_DATA,MF_GET_DATA): New macros
	* src/symtab.c (va_builtin_install_ex): Bugfix
	(variable_install, function_install): Init all members
	
2006-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Document pragma stacksize
	* doc/values.texi: Update
	* src/gram.y: svalidate is not needed any more (I hope)
	* src/prog.c: Likewise

	* src/gram.y: Fix the precedence of function calls and boolean
	negation. 
	* doc/mailfromd.texi

2006-11-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Document string and db functions
	* src/bi_db.m4 (dbmap_lookup): Avoid needless memory allocation
	* src/bi_string.m4 (toupper, tolower): Fix return type
	declarations
	(substr,rindex): Fix bugs
	* src/gram.y: Rewrite expression rules to properly handle
	concatenations and to reduce the number of conflicts.
	Compute automatic and parameter offsets locally
	Rewrite optimizer.
	* src/mailfrom.h (node_type_auto): Remove, node_type_variable does
	the job
	(VAR_VOLATILE,VAR_EXTERN): New defines (for future use)
	(struct variable): New member flags.
	* src/prog.c (dump_asgn): Bugfix
	* src/snarf.m4 (MF_VAR): Set VAR_VOLATILE by default
	* testsuite/etc/Makefile.am (RCFILES): Add strings.rc
	* testsuite/etc/strings.rc: New file
	* testsuite/mailfromd/strings.exp: New file
	* testsuite/mailfromd/DISTFILES: Add strings.exp

2006-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* bootstrap: New file
	* NEWS: Update
	* doc/values.texi (INITIAL-RESPONSE-TIMEOUT): Update.
	* doc/mailfromd.texi: Update
	* src/Makefile.am: Create MAILFROMSTATEDIR with the right
	privileges.
	* src/bi_db.m4 (dbmap): Take an optional third argument.
	(dbget): New built-in
	* src/bi_string.m4 (substr): New function
	* src/db.c: Use xmalloc instead of emalloc
	* src/lex.l: Likewise
	* src/main.c: Likewise
	(xalloc_die): New function
	* src/gram.y: Hanlde optional arguments to built-ins
	Use xmalloc instead of emalloc
	* src/mailfrom.h: Include xalloc.h
	(struct builtin): New member optcount
	(va_builtin_install_ex): take 8 mandatory arguments
	(emalloc): Remove
	(heap_tempspace): New function
	* src/prog.c (heap_tempspace): New function
	Use xmalloc instead of emalloc
	* src/prog.h (heap_tempspace): New function
	* src/snarf.m4: Handle OPTIONAL keyword
	(MF_ALLOC_HEAP_TEMP): New macro
	* src/symtab.c: Use xmalloc instead of emalloc
	(emalloc): Remove
	(find_and_remove): Fix coredump
	
2006-11-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Bug fixes

	* NEWS: Update
	* configure.ac: Raise version to 3.0.91
	* doc/mailfromd.texi: Document -O option
	* src/gram.y: Implement code optimization
	* src/lex.l: Export string functions
	* src/mailfrom.h: Export string functions from lex.l
	* src/main.c: New option -O (--optimize)

	* NEWS: Update
	* configure.ac: Define split version
	* doc/mailfromd.texi: Document built-in macros
	* src/lex.l: New built-in macros
	* src/mailfrom.h (function_name): New function
	* testsuite/etc/macros.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add macros.rc
	* testsuite/etc/ack.rc: Use full type names
	* testsuite/mailfromd/macros.exp: New test case
	* testsuite/mailfromd/DISTFILES: Add macros.exp

2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Document `echo' statement
	* src/gram.y: Remove legacy handling for `rate'
	(function_name): New function
	* src/lex.l: Remove legacy handling for `rate'
	New keywords __file__, __line__ and __function__
	* src/main.c (decode_debug): Remove legacy handling of `cdyl'
	flags.
	* etc/sendmail-8.13.7.diff: Removed

	* NEWS: Update
	* README-alpha: Update
	* doc/mailfromd.texi: Update
	* src/bi_vars.m4 (numrcpt): Removed

2006-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Rewrite function examples using the new
	style
	* src/gram.y: Allow for auto variables in handlers
	(print_node): Print variable offset with SET
	(forget_autos): Use find_and_remove to remove the variable from
	the symtab
	* src/symtab.c: Make sure symbol table entries do not change their
	address during rehashing

2006-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y, src/mailfrom.h, src/prog.c: Implement automatic
	variables 
	* src/lex.l: Make sure N in $N is positive

	* src/gram.y: Implement named function parameters and
	the framework for automatic variables.
	* src/mailfrom.h (storage_class_t): New type
	(struct variable): New members: storage_class, locus, shadowed
	(variable_remove): New function
	* src/symtab.c (remove_symbol): Split in two functions.
	(variable_remove): New function

2006-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Remove the legacy section
	* gacopyz/Makefile.am: Inconditionally build the targets
	* src/bi_vars.m4: New file
	* src/ml.c: Remove
	* src/Makefile.am (M4_FILES): Add bi_vars.m4
	(mailfromd_SOURCES): Remove ml.c
	* src/bi_db.m4: Use MF_RETURN, MF_RETURN_STRING, MF_VAR_REF
	* src/bi_dns.m4: Likewise
	* src/bi_other.m4: Likewise
	* src/bi_poll.m4: Likewise
	* src/bi_sa.m4: Likewise
	* src/bi_sa.m4: Likewise
	* src/engine.c (ctx_getsym): use gacopyz_setreply
	* src/gram.y: Replace calls to declare_string_variable and
	declare_numeric_variable with declare_variable
	(code_node): Fix coredump if node==NULL
	* src/mailfrom.h (declare_numeric_variable)
	(declare_string_variable): Remove
	* src/prog.c (env_var_inc): New function
	(struct declvar): Replace var with name and off.  It is not safe
	to keep the address of the variable as it can change during
	rehashing of the symtable
	(find_declared_variable): Replace with variable_declared_p
	(rcpt_count_loc,ehlo_domain_var,mailfrom_address_var): Remove
	(get_rcpt_count,clear_rcpt_count,incr_rcpt_count)
	(bi_numrcpt,builtin_post_setup): Move to bi_vars.m4
	* src/prog.h (env_var_inc, variable_declared_p)
	(declare_variable): New decls
	* src/snarf.m4 (MF_RETURN, MF_RETURN_STRING, MF_ALLOC_HEAP, MF_VAR_INC)
	(MF_COPY_STRING,MF_VAR_REF): New defines
	(MF_VAR): Declare offset as static
	* src/symtab.c (remove_symbol): New function

	* testsuite/etc/accept.pat: Make sure the test works offline
	* testsuite/etc/ml.pat: Likewise
	* testsuite/etc/numrcpt.pat: Likewise
	* testsuite/etc/reject.pat: Likewise
	* testsuite/etc/tempfail.pat: Likewise
	* testsuite/mailfromd/poll.exp: Likewise
	
	* src/snarf.m4 (MF_VAR): New macro
	(__mf_argtype,mf_typelist): Change expansion according to mailfrom.h
	* src/bi_db.m4, src/bi_poll.m4, src/bi_sa.m4: Use the new way of
	declaring MF variables. 

	* src/gram.y: Control types during tree generation
	Start implementing strict type checking and the new way of
	declaring function parameters and return types. Implement
	functions without return value (procedures).
	* src/lex.l: New rules for returning TYPE
	* src/prog.c: Update to match recent changes
	* src/symtab.c: Update to match recent changes
	* testsuite/etc/var.rc: Update to match recent changes (string is
	a keyword)
	
	Incorporate changes from 3.0 branch:

	* NEWS: Update

	* src/cache.c: Update invocations of mu_dbm_open, remove calls to
	mu_dbm_lock/mu_dbm_unlock.
	* src/db.c: Likewise.
	* src/mu_dbm.c: Likewise.
	* src/mu_dbm.h: Likewise.

 	* doc/Makefile.am (mailfromd_TEXINFOS): Add values.texi.
	* doc/values.texi: New file
	* doc/mailfromd.texi: Include values.texi. Document SMTP
	timeouts.
	* src/engine.c (smtp_stream_wait,smtp_wait,smtp_recvline)
	(check_on_host,listens_on): Implement new timeout control scheme.
	(smtp_recv_tm): New function
	* src/mailfrom.h (io_attempts,connect_attempts): Remove
	(io_timeout,connect_timeout): Change the type to time_t
	(response_timeout): New declaration
	
	(instr_rettype): Rename to data_type_t
	(rettype_string,rettype_number,rettype_unspecified): Rename to
	dtype_.*
	(struct un_node.result_type): New field
	(struct cast_node, positional_arg): New data types
	(enum node_type, node_type_cast): New value
	
	
	* src/main.c (io_attempts,connect_attempts): Remove
	(io_timeout,connect_timeout): Change the type to time_t
	(response_timeout): New variable
	(option_cache): Deprecate options connect-retry and
	io-retry
	(process_options): Additionally check if p->set is not NULL.
	

2006-11-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac, NEWS: Fix version: 3.0.90 (3.0.1 is moved to
	bug-fixing branch)
	
	* configure.ac: Raise version number to 3.0.1
	* NEWS: Update
	* etc/rc.in (mailfromd_stop): Fix arithmetical expression syntax
	* gacopyz/gacopyz.c (parse_state_arg): Bugfix: do not reuse
	parsing buffer!
	* src/gram.y (function_call): New function
	Allow functions returning unspecified (procedures) to be used as
	statements
	* src/lex.l: New token type PROCEDURE
	* src/mailfrom.h (struct function): Remove misleading comment

	* src/snarf.m4 (MF_CATCH, MF_CATCH_VAL, MF_ASSERT): New macros
	* src/bi_db.m4: Use catch/assert macros.
	* src/bi_dns.m4: Likewise.
	* src/bi_other.m4: Likewise.
	* src/bi_poll.m4: Likewise.
	* src/bi_sa.m4: Likewise.
	* src/bi_string.m4: Likewise.

2006-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Update FIXME-xref.
	* src/mu_dbm.c (mu_dbm_open) [WITH_GDBM]: Use GDBM_NOLOCK, as we
	do the locking ourselves

2006-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c: Fix multiple from address handling
	* src/gram.y: Put back the changes, only make sure the leading
	white space is properly stripped off the argument.c

	* src/gram.y (pragma_option): Undo the change from 2006-10-30.
	* src/main.c (opton_ehlo): Adjust for changes in option mailfrom
	syntax. 
	
2006-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Release 3.0
	
	* doc/mailfromd.texi: Update
	* etc/rc.in: Update

2006-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS, configure.ac: Set the version number to 3.0
	(dropping libmilter support calls for raising the major number).
	* TODO: Update

	* src/Makefile.am: Install mailfromd in sbin
	* etc/Makefile.am (.in.mailfromd): Likewise
	* gacopyz/gacopyz.c (gacopyz_handle_connection): Reset SIGTERM and
	SIGHUP in child.
	* gacopyz/proc.c (gacopyz_cleanup_conn): Ignore SIGTERM while
	stopping children.

	* doc/gacopyz.texi: New file
	* doc/Makefile.am (mailfromd_TEXINFOS): Add gacopyz.texi
	(EXTRA_DIST): Add extract.awk
	(extract): New rule
	* doc/macros.texi (function-begin, function-end): Remove macros
	(example-output): New macro
	* doc/mailfromd.texi: Finish changes for 3.0

2006-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* TODO: Update
	* doc/Makefile.am (check-pragmas): Minor change
	* doc/macros.texi (function-begin,function-end): New macros
	* doc/mailfromd.texi: Add missing documentation
	* etc/rc.in: New option `macros'.
	* gacopyz/gacopyz.c (ctx_read,ctx_write): Return immediately on
	timeout and eof.

2006-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* etc/rc.in: New command 'configtest' (proposed by Jan)
	* gacopyz/gacopyz.c (gacopyz_run): Update invocation of
	gacopyz_cleanup_children.
	* gacopyz/gacopyz.h (gacopyz_cleanup_children): Change signature
	* gacopyz/proc.c: Do not keep the list of
	children. gacopyz_cleanup_children now does the housekeeping job.
	* src/engine.c (check_portspec): Minor fix: no use to make sp
	static.
	(mailfromd_daemon): Stop on SIGTERM, SIGQUIT, SIGHUP and SIGINT.
	Finally!	
	

	* src/engine.c (smfilter): Set child start handler

	* NEWS: Update
	* configure.ac: Warn if libmilter is requested
	* doc/mailfromd.texi: Remove any references to libmilter
	* src/mailfrom.h: Fix conditionals for definition of res_n*
	wrappers. 

	* configure.ac: Autodetect the presence of res_n* functions
	Define HAVE_PTHREAD if we need to use libpthread
	* gacopyz/gacopyz.c (macro_assoc_free): Initialize macro_assoc_t
	fields to NULL
	* src/bi_poll.m4: Fix trace output (AS part)
	* src/dns.c: Replace pthread-specific calls with macro wrappers
	* src/gram.y (on pollstmt do branches): Fix passing of arguments
	to the built-in poller
	* src/mailfrom.h: Define wrappers for phread and res_n* functions,
	if necessary

	* libmilter: Removed. Everything moved to /gacopyz
	* gacopyz: New directory. See libmilter for the previous history
	* Makefile.am (SUBDIRS): Replace libmilter with gacopyz
	* NEWS: Update
	* configure.ac: Raise version number to 2.0.4
	Default to using libgacopyz. If the user really calls for trouble,
	allow him to use libmilter (possibly forked), instead.
	* src/Makefile.am (INCLUDES): Add MILTER_INCLUDES
	* src/engine.c: Remove include mfapi.h
	(priv_get): Special provision for test mode
	* src/mailfrom.h: Include mfapi.h without leading directory. -I
	should take care of it.
	(MAILFROMD_DAEMON,MAILFROMD_TEST,MAILFROMD_DELETE,MAILFROMD_LIST)
	(MAILFROMD_EXPIRE,MAILFROMD_COMPACT)
	(MAILFROMD_SHOW_DEFAULTS): Moved from main.c
	(mode): New global
	* src/main.c: Do not include mfapi
	(MAILFROMD_DAEMON,MAILFROMD_TEST,MAILFROMD_DELETE,MAILFROMD_LIST)
	(MAILFROMD_EXPIRE,MAILFROMD_COMPACT)
	(MAILFROMD_SHOW_DEFAULTS): Move defines to mailfrom.h
	* src/ml.c: Include mfapi.h without leading directory. -I
	should take care of it.
	[GACOPYZ_VERSION_MAJOR]: Provide wrapper for gacopyz_setreply
	* gacopyz/smfi.c (smfi_main): Remove debugging hook
	
	* libmilter/dummy.c: Update
	* libmilter/milter.c, libmilter/milter.h, libmilter/smfi.c:
	Finished libmilter implementation.
	* testsuite/mail.null: Skip -f option and its argument.

	* libmilter/context.c, libmilter/milter.h, libmilter/smfi.c:
	(g_milter_setmlreply_v, smfi_setmlreply): Improved implementation.
	(g_milter_setmlreply_va): New function

2006-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	* libmilter/context.c, libmilter/milter.c, libmilter/milter.h
	libmilter/milter_priv.h, libmilter/smfi.c: Implement sending reply
	strings to sendmail.

	* src/gram.y: Fix type casting of arguments.

	* libmilter/milter.c, libmilter/milter.h,
	libmilter/milter_priv.h: Finish context loop implementation.
	* libmilter/dummy.c: Add to the repository
	
	* libmilter/milter.c (trans_ok, get_command): Change signature
	(send_reply): Remove translation of the command.
	(union state_arg): Change contents.
	(state_ret_type): New data type
	(state_handler_fn): Change type and signature.
	(state_disp): New field `name'.
	(shan_abort,shan_macro,shan_optneg): Implemented
	(find_disp): New function
	(parse_state_arg): New function
	(g_milter_context_loop): Initial loop implementation.
	(g_milter_getsymval): New function
	* libmilter/milter.h (SMFI_V1_ACTS,SMFI_V2_ACTS): New defines
	(smfi_getsymval): Define to g_milter_getsymval
	(g_milter_getsymval): New prototype
	* libmilter/milter_priv.h (macro_assoc_t): New data type
	(struct smfi_str.macros): Change type to macro_assoc_t
	* libmilter/trans.awk: Define state_name array

2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac (BUILD_DUMMY): New var
	* libmilter/Makefile.am: Build dummy - a test program for
	libmilter
	* libmilter/log.c (g_smfi_logdump): New function
	* libmilter/milter.c: Lots of fixes. Start implementing the read
	and eval loop.
	* libmilter/milter.h (smfi_register): Fix prototype
	(g_smfi_logdump): New function
	* libmilter/milter_priv.h (enum macro_index)
	(milter_sockaddr_t,mi_uint32_t): New data type 
	(struct smfi_str.macros): Change type
	* libmilter/smfi.c (smfi_register): Fix declaration
	(smfi_main): Temporarly force foreground mode
	* libmilter/trans.awk (END): Emit st_none

	* Makefile.am (SUBDIRS): Add libmilter
	* configure.ac: Add testing framework for libmilter
	Raise version number to 2.0.3
	* libmilter/Makefile.am: Conditionally build libmilter.a
	
	* libmilter/: Initial commit
	* context.c: Initial commit
	* log.c: Initial commit
	* milter.c: Initial commit
	* milter.h: Initial commit
	* milter_priv.h: Initial commit
	* proc.c: Initial commit
	* smfi.c: Initial commit
	* trans.awk: Initial commit
	* trans.tab: Initial commit
	* libmilter/.cvsignore: Initial commit
	
	* src/prog.c (instr_ston): Fix runtime error diagnostic message

2006-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/engine.c (check_on_host): Iterate over addresses from
	`mailfrom' until either the list is exhausted or the remote server
	replies 2xx. Generalization of Jan's idea.
	* src/main.c (set_mailfrom): Check if value is a valid mail
	address (or a list thereof)
	* testsuite/etc/poll-1.rc: New file
	* testsuite/etc/Makefile.am (RCFILES): Add poll-1.rc
	* testsuite/mailfromd/poll.exp: Test multiple from addresses.
	* NEWS: Update
	* doc/Makefile.am (check-exceptions): New goal
	(all-check-docs): Depend on check-exceptions
	* doc/mailfromd.texi: Document multiple from addresses.
	* src/gram.y (pragma_option): Return the rest of the line as the
	option argument for `pragma option mailfromd'
	
	* NEWS, TODO: Update
	* src/bi_poll.m4 (_pollmx): Update invocation of check_mx_records
	* src/engine.c (check_mx_records): Return actual number of MXs in
	the location given by the last argument. All callers updated
	(method_standard): Do the last-resort poll (i.e. querying the
	domain part of the sender email, treated as an MX) only if the
	domain has no MX records.
	* src/mailfrom.h (check_mx_records): Update declaration

2006-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
	
	* src/bi_dns.m4 (ismx): New built-in function
	
	Implement connect-timeout and connect-retry options proposed by
	Jan:
	
	* src/engine.c (smtp_stream_wait, smpt_wait)
	(check_on_host, listens_on): Use connect_wait/connect_timeout for
	the initial connection and io_wait/io_timeout for the I/O
	operations.
	* src/mailfrom.h (connect_timeout, connect_attempts): New
	variables.
	* src/main.c: Likewise.

	* src/prog.c (struct eval_environ): Fix setheader prototype.
	* TODO, NEWS: Update
	
2006-10-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS, configure.ac: Version 2.0.2
	* src/bi_sa.m4 (clamav): New built-in function
	* src/snarf.m4: Minor comment fixes

	* src/snarf.m4 (env_get_stream): New macro. Make sure
	env_get_stream is used only within capturing function
	definitions. 

	* doc/Makefile.am (check-pragmas, check-options)
	(check-builtins): Use new check-docs.sh invocation syntax
	* doc/check-docs.sh: Allow to take any number of "source"
	arguments.
	* doc/mailfromd.texi: Remove ignored deftypefn of numrcpt

2006-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* src/bi_db.m4 (MF_INIT): Install greylist_seconds_left variable
	* src/engine.c (ctx_setheader,priv_store_header_command): Change
	type of the second argument to struct old_header_node.
	* src/gram.y: Rules for header modification changed to allow an
	expression as the second argument.
	(register_macro,print_used_macros): New functions
	(dbg_setheader): Change type of the second argument to struct
	old_header_node.
	(print_node,code_node): Change handling of node_type_header
	* src/mailfrom.h (struct old_header_node): Renamed from header_node
	(struct header_node): New structure.
	(print_config_macros): New function
	(create_environment): Change type of the 4th argument
	(priv_store_header_command): Remove declaration
	(compare_string): New declaration
	* src/main.c: New option --dump-macros
	* src/prog.c (instr_header): The value for the header is obtained
	as the 1st argument.
	(struct optab): Change instr_header description
	(create_environment) Change type of the 4th argument
	
	* configure.ac: Check for SIGRETTYPE
	* src/Makefile.am (M4_FILES): Add bi_sa.m4
	* src/bi_db.m4, src/bi_dns.m4, src/bi_string.m4: Remove unneded
	quoting
	* src/engine.c (mlfi_envfrom,mlfi_header,mlfi_eoh)
	(mlfi_body, mlfi_eom): Capture support
	(mlfi_eom): Bugfix: mlfi_eval called with wrong state tag
	* src/gram.y: Check if builtin invocations are allowed in the
	current state.
	(status_tab): Add mf_url
	* src/lex.l (parse_include): Remove unused variable
	* src/mailfrom.h (mf_status): New status mf_url
	(struct builtin): New fields rettype, statemask, capture.
	(va_builtin_install_ex): New function
	(env_get_stream,env_capture_start,env_capture_write,
	env_capture_write_args): New functions
	* src/prog.c: Include stdarg.h
	(struct eval_environ): New member `stream'
	(env_get_stream,env_capture_start,env_capture_write)
	(env_capture_write_args): New functions
	(destroy_environment): Destroy the capture stream
	(builtin_setup): Call sa_init_builtin.
	* src/prog.h (sa_init_builtin): New function
	* src/snarf.m4: Change quoting symbols to [<,>]
	(MF_STATE, MF_CAPTURE): New defines
	(MF_DEFUN): use va_builtin_install_ex
	* src/symtab.c (va_builtin_install_ex): New function
	* src/bi_sa.m4: New file. Spam-Assassin interface.

	* src/Makefile.am (mailfromd_SOURCES): Add engine.c
	* src/bi_string.m4 (substring): Fix swapping of start and end
	offsets.
	* src/mailfrom.h: Add external declarations, necessary for
	engine.c
	* src/main.c: Move all milter-related stuff to engine.c
	* src/engine.c: New file
	* src/prog.h (other_init_builtin): New extern
	* src/rate.c (rate_print_item): Remove unused variables

2006-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c: Minor indentation changes
	* src/snarf.m4: Add comments

2006-10-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Use familiar \N notation for back references. Expand
	\0ooo and \xhh notations in double-quoted strings.

2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Allow variable and macro interpretation and backreference
	substitution in "" strings.
	
	* src/gram.y: Implement regexp back-references
	* src/lex.l: Likewise
	* src/mailfrom.h: Likewise
	* src/prog.c: Likewise

2006-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement new framework for builtin functions, which allows for
	easy addition of new functions and provides basic sanity checks.
	
	* TODO: Update
	* NEWS: Update
	* src/.cvsignore: Update
	* src/bi_db.m4: New file
	* src/bi_dns.m4: New file
	* src/bi_other.m4: New file
	* src/bi_poll.m4: New file
	* src/bi_string.m4: New file
	* src/snarf.m4: New file
	* src/prog.h: New file
	* src/Makefile.am: Add rules for generating builtin implementation
	files from m4 sources
	* src/gram.y (status_tab): New status mf_range
	* src/mailfrom.h: New status mf_range
	* src/main.c (check_on_host): Return mf_temp_failure if
	stream_open fails.
	* src/prog.c: Include prog.h
	Remove implementations of builtin functions. They all go into the
	corresponding m4 files.
	(advance_pc,adjust_stack): Functions, instead of macros
	(env_var_ref,env_dict_getsym,env_dict_install,env_get_locus): New
	functions. 

2006-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c (set_last_poll_result): Allow NULL arguments

	* configure.ac: Check for mu_get_auth (MU >= 1.0.1)
	* src/prog.c (bi_hostname, bi_resolve): Cache negative results
	(valid_user_p): Use mu_get_auth if available and throw appropriate
	exceptions if the user validity cannot be confirmed.

2006-10-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* TODO: Update
	* doc/mailfromd.texi: Apply some fixes, proposed by Jan

2006-10-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (method_standard, method_strict): Initialize
	last_poll_sent, last_poll_recv to empty strings if cache was used.

2006-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Allow interpretation of variables and macros within
	here-documents.
	Special form to remove all leading whitespace from the here-
	document lines.
	* src/ml.c (ml_split): Fix counting of lines in the reply.  The
	last line was not taken into account unless it ended with a
	newline.
	* NEWS: Update.
	* doc/mailfromd.texi: Document here-documents.

2006-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Provide example of cached_data usage.

	* configure.ac: Fix Berkeley DB autodetection
	* src/Makefile.am (INCLUDES): Add MU_COMMON_INCLUDES
	* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Use DB_VERSION_MAJOR to
	select the version-dependent code.
	
2006-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* TODO: Update
	* doc/mailfromd.texi: Document cache_used variable
	* src/mailfrom.h (set_cache_used): New function
	* src/main.c (method_strict, method_standard): Set cache_used to 1
	or 0 depending on whether the cached data were used or not.
	* src/prog.c (set_cache_used): New function
	
	* configure.ac: Add explicit support for Berkeley DB 4.  Raise
	version number to 2.0.1
	* src/mailfrom.h (set_last_poll_result): New function.
	(env_get_context): New function.
	(check_on_host,check_mx_records,method_strict)
	(method_standard): Change first argument type to eval_environ_t
	* src/main.c (smtp_send): Clear reply before proceeding
	(smtp_last_sent,smtp_last_received): Return literal "nothing" if
	nothing was sent/received.
	(check_mx_records,method_strict)
	(method_standard): Change first argument type to eval_environ_t
	(check_on_host): Change first argument type to eval_environ_t.
	Return last polled host, sent command and received reply in
	variables last_poll_host, last_poll_send and last_poll_recv.
	* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Support Berkeley DB 4
	* src/prog.c (env_get_context, env_get_context): New function
	(greylist_expire_item): New function
	(greylist_format_struct): Add expire field.
	(greylist_format_struct): Declare last_poll_host, last_poll_send,
	last_poll_recv
	* src/rate.c (rate_expire_item): Compute the interval relative
	to the current time.

	* doc/mailfromd.texi: Document new variables
	* NEWS: Update
	
2006-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	-= Release 2.0 =-

	* configure.ac: Raise version number to 2.0
	* NEWS: Likewise
	* doc/mailfromd.texi: Finished
	* src/main.c (filter_cleanup): Free md->helostr
	(mlfi_helo): Allocate md->helostr.

	* src/main.c (main): Enclose PACKAGE_BUGREPORT in angle brackets

2006-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* src/gram.y: Warn about unquoted strings
	* src/main.c: Do not enclose dbm-related variables in #ifdef
	USE_DBM.

	* configure.ac: Define program_name
	* doc/mailfromd.texi: Update
	* src/gram.y: Fix coredump if "rate" is not defined
	* src/prog.c: Include sys/types.h

	* doc/mailfromd.texi: Update
	* etc/mailfromd.rc: Update
	* src/lex.l: Fix counting of the input lines
	* src/main.c: New option -l (--lint)
	* NEWS: Update

2006-09-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* doc/strftime.texi: New file
	* doc/mastermenu.el: New file
	* doc/Makefile.am (mailfromd_TEXINFOS): Add strftime.texi
	(check-builtins): Update rule
	(check-refs,check-fixmes): New rules
	(all-check-docs): New rule
	(check-docs): Rewrite via all-check-docs
	* README-alpha: Update (fprintftime gnulib module is required).
	* src/Makefile.am (INCLUDES): Add lib (for fprintftime.h)
	* src/cache.c (cache_print_item): Use format_time_str
	* src/db.c (format_time_str): New function
	* src/gram.y (convert_rate): allow a separator ("per" or a
	punctuation) between the message count and the interval spec.
	* src/mailfrom.h (format_time_str): New function
	(time_format_string): New global
	* src/main.c (time_format_string): New global
	New option --time-format
	(db_format_enumerator): Protect by #ifdef USE_DBM. Print negative
	expiration for cache.
	* src/prog.c (greylist_print_item): Use format_time_str.
	* src/rate.c (rate_print_item): Use format_time_str.

2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* src/prog.c (env_catch): Reset the exception handler.

2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* TODO: Update
	* configure.ac: Set doc hints depending on the version (alpha
	vs. stable).
	* doc/Makefile.am (check-pragmas): Modify
	(check-docs): Add check-builtins to the lst of prerequisites.
	(check-builtins): New rule
	(RENDITION): Remove variable assignment
	* doc/macros.texi (xprindex): Not used now
	* doc/mailfromd.texi: Update
	* src/gram.y: Set the precedence of  MATCHES and FNMATCHES to
	that of EQ
	(print_bin_op): Add missing opcodes
	(print_node): Fix printing of NEG argument
	* src/main.c (options): Fix wrongly placed N_()s.

2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* README-alpha: Add texinfo to the prerequisites
	* doc/macros.texi: New file
	* doc/Makefile.am (mailfromd_TEXINFOS): Add macros.texi
	(check-pragmas,check-options): New rules
	(EXTRA_DIST): Add check-docs.sh
	* doc/mailfromd.texi: Update
	* src/main.c: Use ifdef USE_DBM where appropriate
	* src/prog.c (valid_user_p): Do not suppose argument is an email
	address. 

2006-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Almost finished Tutorial chapter
	* src/prog.c (bi_domainpart, bi_localpart): New function
	(dbmap): Signal dbfailure exception if the database cannot be
	opened.  Do not suppose the argument is an email address.

2006-09-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* src/prog.c (bi_toupper, bi_tolower): New built-ins.
	(bi_stdpoll, bi_strictpoll, bi__pollhost, bi__pollmx): Signal
	runtime error on unhandled exceptions.

	* Makefile.am: Update
	* NEWS: Update
	* src/db.c (db_compact): Print debugging info at the beginning
	* src/lex.l (parse_error): Do not output locus is locus.file is
	not set.
	* src/main.c: New option --all
	(stderr_error_printer): Use program_invocation_short_name
	(main): Set stderr_error_printer early, before parsing command
	line. 

	* README-alpha: New file
	* Makefile.am (SUBDIRS): Add lib
	* NEWS: Update
	* configure.ac: Switch to using gnulib
	* src/Makefile.am: Likewise
	* src/main.c: New options --lock-retry-count and
	--lock-retry-timeout
	* src/obstack.c, src/obstack.h, src/snprintf.c, src/snprintf.h,
	src/strtok_r.c: Remove files.

2006-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* doc/mailfromd.texi: Update
	* src/lex.l: Implement #include directive
	(pop_source): Do not free locus.file. It has already been
	referenced by now.

	* src/main.c (log_status): Avoid logging SMFIS_CONTINUE actions.

2006-09-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS, configure.ac: Raise version number to 1.9.93.

	* THANKS: Updated Jan's record
	* src/cache.c: Print status code and time stamps in human-readable
	form.
	* src/gram.y (ECHO): Rename to KW_ECHO to avoid clashes with the lex
	macro name. 
	* src/lex.l: Likewise
	* src/mailfrom.h (debug macros): Print source location only if
	source_info_option is set
	(source_info_option): New extern
	(builtin_post_setup,print_code,yylex,yyerror,onblock,string_to_stat)
	(mailfromd_msgid,mailfromd_timestr,logmsg):
	(xeval,check_on_host,check_mx_records,get_rate): Add missing
	declarations
	* src/main.c (source_info_option): New option
	(struct message_data.msgid): New member
	(priv_get): Init msgid
	(mailfromd_msgid,mailfromd_timestr): New functions
	(trace, transcript): Use mailfromd_msgid()
	(check_on_host): Print exit code on debug level 1
	* src/mu_dbm.c: Include mailutils/error.h
	* src/mu_dbm.h (mu_dbm_unlock): Return void
	* src/prog.c: Minor changes
	* testsuite/etc/poll.rc: New file
	
	* NEWS: Update
	* etc/mailfromd.rc: Use RFC-compliant reply codes.
	* testsuite/etc/arg.pat: Likewise.
	* testsuite/etc/arg.rc: Likewise.
	* testsuite/etc/cidr.rc: Likewise.
	* testsuite/etc/cond.rc: Likewise.
	* testsuite/etc/numrcpt.pat: Likewise.
	* testsuite/etc/numrcpt.rc: Likewise.
	* testsuite/etc/reject.pat: Likewise.
	* testsuite/etc/reject.rc: Likewise.
	* testsuite/etc/relayed.rc: Likewise.
	* testsuite/etc/tempfail.pat: Likewise.
	* testsuite/etc/tempfail.rc: Likewise.
	* testsuite/mailfromd/cidr.exp: Likewise.
	* testsuite/mailfromd/cond.exp: Likewise.
	* testsuite/mailfromd/relayed.exp: Likewise.

	* src/gram.y (on_cond): Use the values of %ehlo_domain and
	%mailfrom_address variables as default values for ehlo domain and
	sender address.
	* src/mailfrom.h (smtp_domain): New extern
	(get_smtp_domain): Remove function
	* src/main.c (get_smtp_domain): Remove function
	(main): Call builtin_post_setup after configuration
	* src/prog.c (builtin_post_setup): New function
	(builtin_setup): Install ehlo_domain and mailfrom_address vars
	(bi_strictpoll): Fix parameter order
	(bi__pollhost, bi__pollmx): New functions
	(bi_match_cidr): Fix coredump

	* testsuite/etc/catch01.rc: New file
	* testsuite/etc/hasmx.rc: New file
	* testsuite/etc/Makefile.am: Add catch01.rc and hasmx.rc

	* testsuite/etc/catch.rc: Rewrite
	* testsuite/mailfromd/catch.exp: Rewrite

	* testsuite/mailfromd/hasmx.exp: New file
	* testsuite/mailfromd/poll.exp: New file
	* testsuite/mailfromd/DISTFILES: Add hasmx.exp and poll.exp
	
	* src/codegen.awk: Remove
	* src/onwrap_std.cin: Remove
	* src/onwrap_std.rc: Remove
	* src/onwrap_strict.cin: Remove
	* src/onwrap_strict.rc: Remove
	* Makefile.am, src/Makefile.am: Remove bootstrap. Not needed any
	more.
	* src/gram.y: Allow to specify catches for all exceptions
	(catch *).
	Allow to use any function as a selector to `on' statement.
	Get rid of poll_node.
	* src/mailfrom.h (struct poll_node): Remove
	(struct poll_data): New data type
	(struct catch_node): Replace mf_status *values with unsigned
	exmask
	(enum node_type): Remove poll_node
	(std_on_wrapper_func,strict_on_wrapper_func): Remove
	* src/prog.c (instr_catch, dump_catch): Update for the new catch
	calling convention.
	Remove includes of onwrap_std.c and onwrap_strict.c.
	* src/.cvsignore: Update

	* Makefile.am, src/Makefile.am (bootstrap): New goal

	* src/Makefile.am: Add rules for generation of onwrap_std.c and
	onwrap_strict.c
	* src/codegen.awk: New file
	* src/onwrap_std.cin: New file
	* src/onwrap_std.rc: New file
	* src/onwrap_strict.cin: New file
	* src/onwrap_strict.rc: New file

	* src/gram.y: Change catch semantics: a catch handler always
	causes exit from the function or prog it was called from.  The
	scope of a catch handler installed in a function ends with the
	end of that function.
	Rewrite ON statement using CATCH + wrappers over stdpoll or
	strictpoll functions.
	* src/lex.l: The sequences poll, host, for, as and from are valid
	keywords only if used in ONBLOCK state.
	(onblock): New function
	* src/mailfrom.h (mf_status): Add new status codes (it'd be better
	to call them exception codes, perhaps).
	(EXMASK): New macro
	(prog_trace_option): New global
	(struct poll_action): Removed
	(struct poll_node): Change type of `actions' to struct case_stmt
	(struct function.exmask): New member
	(std_on_wrapper_func, strict_on_wrapper_func): New globals
	(instr_callout): Removed
	(instr_retcatch, instr_saveex, instr_restex): New instructions
	(env_catch): Return an error code
	* src/main.c: New option --trace-prog
	* src/prog.c (prog_trace): New function. Used in all instructions
	and builtins instead of debugN(100...).
	(instr_callout): Removed
	(instr_retcatch, instr_saveex, instr_restex): New instructions
	(env_catch): Return an error code
	(bi_stdpoll, bi_strictpoll): New builtins
	* src/.cvsignore: Update
	
	* testsuite/etc/catch.rc: Update catch syntax
	
2006-08-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* etc/mailfromd.rc: Rewrite using 2.x syntax
	* src/gram.y: Simplify case syntax: do not require do .. done
	around statement lists
	* src/prog.c (instr_ntos): Remove unused variable
	* testsuite/etc/switch.rc: Rewrite using new syntax

	* NEWS: Update
	* src/gram.y: Use NUMERIC_BUFSIZE_BOUND to declare buffers for
	numeric conversion
	* src/prog.c: Likewise
	* src/lex.l: New notation &word (for future use)
	* src/mailfrom.h (NUMERIC_BUFSIZE_BOUND): New macro
	* src/main.c: Set log_to_stderr=1 for some working modes
	(e.g. --test, --compact, --expire)
	(mailfromd_show_defaults): Remove NDBM/DBM leftovers
	* testsuite/etc/switch.rc: Minor fix
	
	* NEWS: Document switch statement, database pragma and the new
	greylist syntax
	* TODO: Update
	* src/cache.c: Use cache_format
	* src/rate.c: Use rate_format
	* src/gram.y: Implement switch statement
	* src/lex.l: Likewise
	* src/mailfrom.h (DEFAULT_GREYLIST_DATABASE): New define
	(positive_expire_interval,rates_expire_interval): Remove globals
	(struct value,struct valist,struct case_stmt)
	(struct switch_stmt): New data types
	(node_type_switch): New node type
	(struct node.v.switch_stmt): New member
	(instr_xlat,instr_xlats,instr_jreg): New instructions
	(code_peek,code_reserve): New functions
	(struct db_format.expire_interval): New member
	(db_format_install): Return struct db_format *
	* src/main.c (positive_expire_interval,rates_expire_interval):
	Remove globals. Use corresponding db_format fields instead. All
	references updated.
	(db_format_setup): Protect by #ifdef USE_DBM
	(mailfromd_show_defaults): Use symbol_enumerate to dump available
	database information.
	* src/prog.c (instr_xlat,instr_xlats,instr_jreg): New instructions
	(code_peek,code_reserve): New functions
	* src/symtab.c (db_format_install): Return struct db_format *
	* testsuite/etc/Makefile.am (RCFILES): Add switch.rc
	* testsuite/etc/greylist.in: Rewrite to use new greylist syntax
	* testsuite/mailfromd/DISTFILES: Add switch.exp
	* testsuite/etc/switch.rc: New testcase
	* testsuite/mailfromd/switch.exp: New testcase

2006-08-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (stderr_error_printer): New function
	(main): Set stderr_error_printer as the default error printer if
	log_to_stderr is true.
	Bail out if extra arguments are given in daemon mode.

	* NEWS: Update
	* src/dns.c (getmx): Do not recurse to parent domains
	* src/gram.y: Remove rate statement, use the built-in function
	instead.
	(pragma_option): Several pragmas take time interval specification
	as their argument.
	(time_multiplier): Analize the part of the first argument up to
	the first space characrer. Allow for abbreviated time units.
	(parse_time_interval): New function
	(convert_rate): Rewrite unsing parse_time_interval
	* src/lex.l: Allow to use multi-letter sendmail variables without
	surrounding cury braces.
	* src/mailfrom.h (node_type_rate): Remove type
	(instr_rate): Remove function
	* src/main.c: Options ending in "timeout" and "expire-interval"
	take time interval specification as their argument.
	* src/prog.c (instr_rate): Remove
	(bi_interval,bi_rate): New functions
	* src/rate.c (rate_print_item): Improved output
	
2006-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c: Switch to user privileges before compacting the
	database

	* NEWS: Update
	* src/gram.y: The legacy syntax (statement list without any prog
	declaration) is no longer supported
	SET statements are allowed between declarations, they declare
	global variables and assign initial values to them.
	* src/lex.l (parse_error_locus): Locus pointer is const
	* src/mailfrom.h (parse_error_locus,function_install): Locus
	pointer is const
	(declare_numeric_variable,declare_string_variable): New function
	* src/prog.c (declare_numeric_variable)
	(declare_string_variable): New function
	(env_decl_vars): New function
	(create_environment): Call env_decl_vars
	* src/symtab.c (variable_install): Do not overwrite existing
	variables.
	(function_install): Locus pointer is const
	* testsuite/etc/Makefile.am: Add var.rc
	* testsuite/etc/var.rc: New file
	* testsuite/etc/accept.rc: Rewrite using the new syntax
	* testsuite/etc/ml.rc: Likewise
	* testsuite/etc/reject.rc: Likewise
	* testsuite/etc/tempfail.rc: Likewise
	* testsuite/etc/ack.rc: Update the comment
	* testsuite/mailfromd/DISTFILES: Add var.exp
	* testsuite/mailfromd/var.exp: New testcase

	* src/gram.y (FUNC declaration): Assign the entry point early to
	properly handle recursive functions
	(variable): Throw error if the variable is not defined
	* src/prog.c (instr_add,instr_sub,instr_mul,instr_div): Adjust
	stack
	(instr_result): Fix the debug diagnostics
	(instr_builtin): Advance pc before calling the handler, so it can
	use env_catch
	(instr_variable,instr_asgn,instr_svalidate,instr_arg)
	(instr_return,instr_adjust,instr_popreg,instr_pushreg): Provide
	appropriate debug diagnostics
	(bi_hasmx): Call freemx only if getmx returned success.
	Call env_catch otherwise
	* testsuite/etc/Makefile.am: New files ack.rc and catch.rc
	* testsuite/etc/ack.rc: New file
	* testsuite/etc/catch.rc: New file
	* testsuite/mailfromd/DISTFILES: New files ack.exp and catch.exp
	* testsuite/mailfromd/ack.exp: New file
	* testsuite/mailfromd/catch.exp: New file

	* src/gram.y: Implement user-defined functions
	* src/lex.l: Likewise
	* src/mailfrom.h: Likewise
	* src/prog.c: Likewise
	* src/symtab.c: Likewise
	* TODO: Update
	
2006-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (echo): New statement.
	Begin implementing user-defined functions
	* src/lex.l: Likewise
	* src/mailfrom.h (node_type_echo): New node type
	(symbol_enumerator_t): New data type
	(symbol_enumerate): New function)
	(instr_echo): New instruction
	(env_make_frame,env_leave_frame,function_install): New functions
	* src/main.c (mlfi_helo, mlfi_envfrom, mlfi_envrcpt, mlfi_header)
	(mlfi_eoh, mlfi_body, mlfi_eom): Create normal stack frame before
	calling the handler.
	(main): Use print_code to handle --dump-code option
	* src/prog.c (struct eval_environ): New member `base'
	(pop): Return popped value
	(instr_ston): Fix format spec
	(instr_echo): New instruction
	(env_make_frame, env_leave_frame): New functions
	(env_catch): Create normal stack frame for the catch handler. Pass
	it the exception code as its argument.
	(print_code): New function.
	* src/symtab.c (SYM_.*): Move defines to mailfrom.h
	(symbol_enumerate): new function
	(function_install): New function

	* src/gram.y: Implement catch statement
	* src/lex.l: Likewise
	* src/mailfrom.h (mf_status_count): New value
	(struct catch_node): New data type
	(node_type_catch): New node type
	(instr_catch): New function
	* src/prog.c (struct eval_environ): New member `catch'
	(instr_catch): New function
	(env_catch): New function
	(dump_locus,dump_push_immediate,dump_symbol,dump_branch,dump_return)
	(dump_header,dump_builtin,dump_variable,mx_match): Change
	signature. All callers updated
	(instr_catch,dump_catch): New function
	(env_init): Initialize catch array

2006-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Implement MX MATCHES and MX FNMATCHES.
	Change handling of compiled regular expressions.
	(%union): New member matchtype
	(MXMATCHES,MXFNMATCHES): New tokens
	(optimize,optimize_node): New function
	(codegen): Call optimize
	* src/lex.l (MXMATCHES,MXFNMATCHES): New tokens
	* src/mailfrom.h (bin_regex,struct regex_node): Remove
	(struct bin_node): New member qualifier
	(node_type_push,node_type_regcomp): New node types
	(struct node.v.re): Removed
	(instr_fnmatch_mx,instr_regex_mx): New functions
	* src/prog.c (instr_fnmatch_mx,instr_regex_mx): New functions
	(instr_regex,instr_regcomp): Rewritten

	* NEWS: Update
	* src/gram.y: Add arithmetical operations. Fix the implicit type
	conversion rules.
	(test_program): Removed
	(mailfromd_test): New function
	* src/mailfrom.h (bin_add,bin_sub,bin_mul,bin_div): New binary
	opcodes
	(unary_minus): New unary opcode
	(instr_add,instr_sub,instr_mul,instr_div,instr_neg): New functions
	(env_init,env_push_string,env_push_number,env_set_variable): New
	declarations.
	(test_program): Removed
	(mailfromd_test): New declaration
	* src/main.c: The --test option takes an optional argument
	specifying which state handler to test.  Only one handler can be
	tested per invocation. Command line interface allows to define all
	types of variables (sendmail, mailfromd and positional arguments).
	* src/prog.c (instr_add,instr_sub,instr_mul,instr_div)
	(instr_neg,env_set_variable): New functions.
	* testsuite/mailfromd/cidr.exp: Update for new --test semantics
	* testsuite/mailfromd/cond.exp: Likewise
	* testsuite/mailfromd/relayed.exp: Likewise

2006-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	* NEWS: Update
	* configure.ac: Update to 1.9.92
	* src/dns.c (freemx): New function
	* src/gram.y: Use verbose error diagnostics.
	(NUMBER): New token
	* src/lex.l: Return CODE only for strings consisting of three
	digits. Other number of digits form NUMBER token.
	Allow to split strings among multiple lines using \ as the last
	character on the line
	* src/mailfrom.h: Rearrange and add comments
	* src/main.c (check_mx_records): Use freemx
	* src/mu_dbm.c: Update copyright year
	* src/prog.c (bi_hasmx): use freemx
	* src/rate.c: Update copyright year

2006-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Bugfixes
	* testsuite/etc/Makefile.am: Add arg.rc, arg.pat
	* testsuite/etc/arg.rc: New file
	* testsuite/etc/arg.pat: New file
	* testsuite/mailfromd/DISTFILES: Add arg.exp
	* testsuite/mailfromd/arg.exp: New file

	* src/cache.c (format_status): Remove function. Use mf_status_str
	instead.
	* src/gram.y: Handle positional arguments
	(state_tag,state_args): New variables
	(action: ACT_CONTINUE, ACT_DISCARD): Initialize $$->v.ret to all
	zeros.
	(parse_config): Fix return value
	(mf_status_str): extern
	(test_program): Call env_init
	(builtin_variable_install): Change return value
	* src/lex.l: $N notation (positional parameter)
	Fix IDENTIFIER rule to accept single-character identifiers
	* src/mailfrom.h (node_type_arg): New node type
	(define_numeric_var): Removed
	(get_rcpt_count,clear_rcpt_count,incr_rcpt_count): New functions
	(mf_status_str): New declaration
	(builtin_variable_install): Change return value
	* src/main.c (struct message_data): Remove numrcpt
	(mlfi_helo,mlfi_envfrom,mlfi_envrcpt,mlfi_header,mlfi_eoh)
	(mlfi_body,mlfi_eom): Init env and pass positional parameters.
	(mlfi_envrcpt): Update rcpt_count variable using incr_rcpt_count
	(mlfi_eom): Clear %rcpt_count
	* src/prog.c (env_init,env_push_string,env_push_number): New
	functions.
	(get_rcpt_count,clear_rcpt_count,incr_rcpt_count): New functions
	(define_numeric_var): Remove function
	(bi_numrcpt): Directly update %rcpt_count cell.
	(bi_greylist): Directly update %greylist_seconds_left cell
	(builtin_setup): Initialize offsets of the internal variables
	* src/symtab.c: Indentation fix
	
	* TODO: Update

	* src/cache.c, src/rate.c: Include trailing nul to the
	key size. 
	* src/db.c (db_list_item,db_delete): Include trailing nul to the
	key size 
	(db_expire): Do not return error on failed reads if
	ignore_failed_reads_option is set.
	(db_compact): Add trailing zero to the keys missing it.
	* src/dns.c: Debug level 100 is reserved for instruction traces
	* src/mailfrom.h (DEFAULT_RATE_DATABASE): Include suffix
	(ignore_failed_reads_option): New variable
	* src/main.c (ignore_failed_reads_option): New variable
	Do not use debug level 100, it is reserved for instruction
	traces. 
	(--ignore-failed-reads): New option
	
	* configure.ac: Remove NDBM and DBM support.
	* src/cache.c: Lock the database before writing to it.
	* src/prog.c: Likewise
	* src/rate.c: Likewise
	* src/db.c (db_compact): Implement locking. Improve error
	checking.
	* src/mailfrom.h (DEFAULT_DATABASE): File name with suffix.
	* src/main.c (db_format_setup): Initialize locking parameters.
	* src/mu_dbm.c: Remove NDBM and DBM support. Implement locking
	functions.
	* src/mu_dbm.h: Likewise

	Handle multiple DB formats by keeping a symbol table, describing
	main primitives for each of them. When a database management
	action is required (by using --list, --delete, --expire or
	--compact), the DB format can be given via --format option. The
	database file name can be given using --file option.
	
	* src/cache.c: Rewritten using new DB format handling primitives.
	* src/prog.c: Likewise
	* src/rate.c: Likewise
	* src/db.c (all functions): Change data types to int. Improve
	error checking
	(db_compact): New function (Note: no locking so far!)
	* src/symtab.c (SYM_DB_FORMAT): New symbol state
	(struct symtab.v): New member db
	(db_format_install,db_format_lookup): New functions
	* src/mailfrom.h (struct db_format): New data type
	(db_format_install,db_format_lookup): New functions
	* src/main.c (options --expire,--list,--delete): Do not take
	argument. --format and/or --file should be used instead
	(--format, --file): New options
	* src/mu_dbm.c (mu_dbm_file_name): New function
	(mu_dbm_stat): Rewrite using mu_dbm_file_name.
	* src/mu_dbm.h (mu_dbm_file_name): New function
	Remove obsolete __P() declaration wrappers.

2006-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am (mailfromd_SOURCES): Add ml.c
	* src/ml.c: New file.
	* src/db.c: Rewrite db_expire to avoid skipping some keys using
	broken backends (namely, GDBM)
	* src/gram.y: Bugfixes
	* src/lex.l: Implement multy-line strings.
	* src/mailfrom.h (sendmail_mlreply): New function.
	* src/main.c (ctx_setreply): Implement multy-line responses.
	* src/prog.c (bi_greylist): Define greylist_seconds_left in both
	branches of the conditional.
	* testsuite/etc/Makefile.am: Add ml.rc, ml.pat
	* testsuite/etc/ml.rc: New file.
	* testsuite/etc/ml.pat: New file.
	* testsuite/mailfromd/DISTFILES: Add ml.exp
	* testsuite/mailfromd/ml.exp: New testcase

2006-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Add comparison operators (<,<=,>,>=)
	* src/lex.l: Likewise.
	* src/mailfrom.h: Likewise.
	(define_numeric_var): New function
	* src/prog.c: Add comparison operators (<,<=,>,>=)
	(struct eval_environ): Remove mailpool. Use heap to keep string
	values.
	Remove numrcpt. The number of recipients is kept in the variable
	%rcpt_count
	(pushs): New function
	(instr_arg): New function (for future use)
	(env_set_numrcpt,env_alloc,free_meme): Removed
	(define_numeric_var): New function
	* src/main.c (mlfi_envrcpt): Define %rcpt_count

	* testsuite/etc/Makefile.am (RCFILES,PATFILES): Add numrcpt test
	* testsuite/etc/numrcpt.pat: New file.
	* testsuite/etc/numrcpt.rc: New file.
	* testsuite/mailfromd/numrcpt.exp: New file

	* NEWS: Update
	* doc/mailfromd.texi: Start rewriting
	* src/gram.y: Implement concatenation of expressions and internal
	variables.
	* src/lex.l: Implement internal variables (%name notation)
	* src/mailfrom.h (stack_size, variable_count): New variables.
	(struct return_node.message): Change type to NODE
	(struct concat_node, asgn_node): New data types
	(node_type_concat,node_type_asgn,node_type_variable): New node
	types.
	(struct node.v): add new structures.
	(instr_concat,instr_variable,instr_asgn,instr_svalidate): New
	instructions.
	(struct function): New member `name'
	(struct varuable): New structure
	(variable_install,variable_lookup,builtin_variable_install): New
	functions.
	* src/prog.c (stack_size): new variable
	(struct eval_environ): Remove stacksize. New members: toh, var
	(struct environ_state): Remove
	(push): Do not realloc stack. Take into account heap top when
	computing stack space left.
	(heap_reserve): New function
	(instr_return): Remove third immediate argument (message). Take it
	from the stack instead
	(dump_return): Likewise
	(instr_concat,instr_variable,instr_asgn,instr_svalidate): New
	instructions.
	(struct optab): Add new instructions
	(eval_environment): Initialize tos and toh
	(create_environment): stack_size gives the total size of the
	stack+heap.
	Allocate memory for the variable array.
	(bi_greylist): Do not prolong greylisting period if the function
	is called within a greylisting interval.
	Variable greylist_seconds_left keeps the number of seconds left to
	the end of the greylisting period.
	(builtin_setup): Install greylist_seconds_left variable.
	* src/symtab.c (SYM_VARIABLE): New entry state.
	(struct symtab.name): Move to the union. All references updated.
	(variable_install,variable_lookup): New functions.

2006-08-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (MARK_LOCUS): Optimize insertion of instr_locus codes.
	* TODO: New file.
	
2006-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/prog.c (instr_header): Allocate header_node.

2006-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c: Call umask in child process. Set default umask to
	0117.
	* testsuite/.cvsignore: Update
	* testsuite/etc/.cvsignore: Update
	* testsuite/etc/cond.rc: Update

	* configure.ac: Remove stray AC_DEFINE
	* src/lex.l (line_finish): Extra debug
	* src/main.c (mailfromd_show_defaults): Print version instead of
	the method.
	* src/prog.c (eval_environment): Initialize status to
	SMFIS_CONTINUE.
	* testsuite/Makefile.am (SUBDIRS): Remove .
	* testsuite/etc/Makefile.am (RCFILES): Add cidr.rc, cond.rc,
	greylist.in, relayed.list, relayed.rc
	(PATFILES): Add greylist.pat
	(CLEANFILES, noinst_DATA): Add greylist.rc
	(.in.rc): New implicit rule
	* testsuite/etc/cidr.rc: New file 
	* testsuite/etc/cond.rc: New file
	* testsuite/etc/greylist.in: New file
	* testsuite/etc/greylist.pat: New file
	* testsuite/etc/relayed.list: New file
	* testsuite/etc/relayed.rc: New file
	
	* testsuite/lib/mailfromd.exp (start_daemon): Prefix config name
	with MAILFROMD_ETC_DIR only if it does not already begin with /
	(mailfromd_init): Initialize MAILFROMD_STATE_DIR instead of doing
	it in (default_mailfromd_start)
	(default_mailfromd_version, mailfromd_version)
	(mailfromd_check_capability,mailfromd_exec): New functions
	(mailfromd_pat): New keyword :RCDIR
	* testsuite/mailfromd/DISTFILES: Add new files
	* testsuite/mailfromd/cidr.exp: New file
	* testsuite/mailfromd/cond.exp: New file
	* testsuite/mailfromd/greylist.exp: New file
	* testsuite/mailfromd/relayed.exp: New file
	
	* Makefile.am (SUBDIRS): Add testsuite
	* configure.ac (AC_CONFIG_FILES): Add testsuite/* Makefiles
	* .cvsignore: Update
	* src/main.c (option_pidfile): Assign *pval
	(mailfromd_daemon): Bail out if daemon fails
	* testsuite: New directory
	* testsuite/Makefile.am: Initial import
	* testsuite/.cvsignore: Likewise
	* testsuite/mail.null: Likewise
	* testsuite/etc: New directory
	* testsuite/etc/Makefile.am: Initial import
	* testsuite/etc/.cvsignore: Likewise
	* testsuite/etc/accept.pat: Likewise
	* testsuite/etc/accept.rc: Likewise
	* testsuite/etc/reject.pat: Likewise
	* testsuite/etc/reject.rc: Likewise
	* testsuite/etc/sendmail.cin: Likewise
	* testsuite/etc/sendmail.m4: Likewise
	* testsuite/etc/tempfail.pat: Likewise
	* testsuite/etc/tempfail.rc: Likewise
	* testsuite/lib: New directory
	* testsuite/lib/DISTFILES: Initial import
	* testsuite/lib/mailfromd.exp: Likewise
	* testsuite/mailfromd: New directory
	* testsuite/mailfromd/DISTFILES: Initial import
	* testsuite/mailfromd/actions.exp: Likewise

2006-08-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Warn if accept is used with arguments.
	Check codes and xcodes for reject and tmpfail actions.
	* src/main.c: New option --log-tag (-L) sets syslog tag.
	* src/prog.c: New test greylist.

2006-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* THANKS: Add Jan Rafaj
	* NEWS, configure.ac: Raise version number to 1.9.91
	* doc/mailfromd.texi: Update
	* src/db.c (db_expire): Rewritten the loop after the proposal of
	Jan Rafaj.
	* src/dns.c (_getmx,cnameloop): Use res_n* functions to assure
	thread safety.

	* src/gram.y: Major change in confguration language. By default
	all code will be executed in envfrom SMTP state. The parts of code
	enclosed in 'PROG <state> DO ... DONE' will be executed when the
	requested <state> is handled. Deferred evaluation is considered a
	failed experiment and is removed. ITER statement is removed as
	well, since it is no longer needed.
	* src/lex.l (iter): Remove keyword
	(prog): New keyword
	* src/mailfrom.h (enum smtp_state): smtp_state_first marks first
	executable SMTP state, smtp_state_count gives the number of
	available states.
	(struct iter_node,node_type_iter,instr_iter,instr_pushenv)
	(instr_suspend): Removed.
	(entry_point): New global data
	(environment_get_null_symbol): Return locus in the location
	pointed to by the second argument.
	(codegen): Remove declaration
	(dump_code): Accepts two arguments.
	* src/main.c (check_on_host): Be more liberal. Return
	mf_temp_failure if any transport error occurs
	Send QUIT after exiting the loop, so that we close the transaction
	correctly even if we get a negative reply.
	(xeval,mlfi_eval): New functions.
	(mlfi_helo,mlfi_envfrom,mlfi_envrcpt,mlfi_header,mlfi_eoh)
	(mlfi_eom,mlfi_body): Use mlfi_eval to evaluate the response.
	(smfilter,milter_enable_state): Set all handlers on request, when
	a specified PROG is available to avoid useless milter calls.
	(main): Rewritten handling of --dump-code
	* src/prog.c (struct eval_environ) Remove statepool and
	smtp_state.
	(environ_save_state,environ_restore_state,environ_state_free):
	Remove.
	(instr_symbol): Fix debug diagnostic corresponding to previous
	cases of deferred evaluation.
	(instr_pushenv,instr_iter,dump_iter,instr_suspend): Remove
	(dump_code): Take two arguments.
	(eval_environment): Check second argument type (prog_counter_t).
	(environment_get_null_symbol): Return location where the undefined
	symbol occurs in the memory location pointed to by the second
	variable.
	(bi_numrcpt): Remove non-local jump

2006-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/mailfromd.texi: Update
	* src/gram.y (code_node): Optimize code generation for `ON POLL'
	statements, avoiding multiple generation of action code for `or'
	branches.
	* src/main.c: Exit immediately if any of the --dump options was
	given. 

2006-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (mlfi_helo): Do not clear md->helostr after
	processing. We don't rely on sendmail setting $s any more.
	* src/prog.c (instr_symbol): Improve debugging messages
	(bi_match_cidr): New builtin.

2006-08-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac (AC_ARG_WITH([berkeley-db])): Fix the help string
	* README, doc/mailfromd.texi, doc/rendition.texi: Update

	* src/gram.y (%union): const struct builtin
	(iter): Call milter_enable_state
	* src/mailfrom.h (struct builtin_node) const struct builtin
	(code_instr,code_immediate): Take const argument
	(milter_enable_state): New function
	* src/main.c (mlfi_header,mlfi_header,mlfi_eoh): Initial
	implementation.
	(milter_enable_state): New function
	(set_milter_header,set_milter_body): Removed
	Removed "API control" options (--milter-body and --milter-header).
	* src/prog.c (code_instr,code_immediate): Take const argument
	(bi_resolve): Fix inet_ntoa usage
	(dbmap_lookup_p): Change first argument

2006-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Use get_smtp_domain() instead of smtp_domain
	* src/mailfrom.h (smtp_domain): Removed declaration;
	(get_smtp_domain): New function
	* src/main.c (get_smtp_domain): New function
	(main): Remove initialization of smtp_domain.
	* src/prog.c (dbmap_lookup_p): Protect the text by ifdef USE_DBM
	(builtin_setup): Do not install bi_dbmap if DBM is not used.

	* NEWS: Update
	* src/mailfrom.h (string_to_state,state_to_string): New functions
	(instr_iter,instr_pushenv,instr_suspend): New functions
	(struct iter_node): New data type
	* src/gram.y: Support ITER construct
	(string_to_state,state_to_string): New functions
	* src/lex.l: Support ITER construct
	* src/prog.c: Support ITER construct
	(struct eval_environ): New member statepool
	(struct environ_state): New member next
	(environ_save_state): Create the state in the internal environment
	memory pool
	(destroy_environment): Free states from the pool
	(instr_pushenv,instr_iter,dump_iter,instr_suspend): New functions
	* src/main.c (mlfi_envrcpt): Remove implicit looping in envrcpt state.
	(struct message_data): Remove envstate. All references updated

2006-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Use direct boolean arithmetics: 1 means true, 0 means
	false.
	* src/prog.c: Likewise
	(bi_resolve,bi_hasmx): New builtins

	* etc/sendmail-8.13.7.diff: Added to the repository
	
	* configure.ac: Update version number to 1.9.90
	* NEWS: Update for 1.9.90
	* src/main.c (struct option_cache): New option cumulative (sync
	with 1.x)
	Mark relay as cumulative
	(set_option): Ignore override for cumulative options
	* src/prog.c (instr_rate): Bugfix
	
	* configure.ac: Change DB options to those used by MU configure.
	* src/main.c: New option --group (pragrma group)
	(switch_to_privs): Retain groups specified with --group options
	(mailfromd_show_defaults): Show DB version in use.
	(main): Call MU_AUTH_REGISTER_ALL_MODULES
	* src/mu_dbm.c (mu_dbm_open): Fix for DB 3.x
	* src/mu_dbm.h: Likewise
	* src/prog.c (environ_state_free): State can be NULL
	(bi_dbmap): Fix order of arguments

	* configure.ac (MAILUTILS_LIBS): Link with MU Auth
	* src/gram.y: Allow numeric constants in the program
	* src/mailfrom.h (enum node_type): New type node_type_number
	(enum smtp_state, environ_state_t): new data type
	(eval_environment): Takes 2nd argument: smtp_state. All callers
	updated.
	(environ_save_state,environ_restore_state,environ_state_free): New
	functions.
	(emalloc): New prototype
	* src/main.c (struct message_data): New member envstate
	(priv_get,filter_cleanup): Handle envstate
	(mlfi_helo,mlfi_envfrom): Update call to eval_environment
	(mlfi_envrcpt): Save environment state on the first call, restore
	it on subsequent ones.
	Keep track of the number of recipients.
	(mlfi_header): Call eval_environment
	(mlfi_eom): Call eval_environment. Return tempfail if the
	configuration program did not finish.
	(capa): Use "auth" capability
	* src/prog.c (struct eval_environ): New fields numrcpt, smtp_state
	(struct environ_state): New data type
	(environ_save_state,environ_restore_state,environ_state_free): New
	functions.
	(instr_ston,instr_ntos): Bugfix: do not advance pc
	(instr_symbol): Do not set env->status before longjump
	(env_set_numrcpt): New function
	(eval_environment): Take 2nd argument: the smtp state
	(bi_numrcpt,bi_validuser,bi_dbmap): New builtins
	(builtin_setup): Register new builtins

2006-07-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/symtab.c: New file
	* src/Makefile.am (mailfromd_SOURCES): Add symtab.c
	* src/gram.y: Introduce builtin functions. Remove rules for
	HOSTNAME and RELAYED: they are builtins now.
	* src/lex.l: Likewise
	* src/prog.c: Likewise
	* src/mailfrom.h: Add missing prototypes. Make debug macros safe
	to use within if blocks
	(struct builtin, struct function): New data types
	* src/main.c (check_mx_records): Add default case
	(listens_on): New function (for compatibility with 1.x branch)
	(mlfi_eom): Clear numrcpt
	(main): Call builtin_setup. Check return value of codegen
	* src/rate.c (get_rate): Remove unused variable
	
2006-07-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Implement --with-forks option from 1.x branch.
	* src/Makefile.am (LDADD): Use MILTER variable instead of
	hardcoding -lmilter
	* src/main.c (struct message_data): New members env, helostr and
	numrcpt
	(priv_get): Initialize new message_data members
	(ctx_getsym): Special handling for $s - sendmail does not set it
	when calling xxfi_helo
	(filter_cleanup): Use priv_get instead of MLFIPRIV
	Destroy the environment
	(mlfi_helo): Use priv_get instead of MLFIPRIV
	Set md->helostr
	(mlfi_envfrom): Use priv_get instead of MLFIPRIV
	Use md->env instead of creating new environment
	(mlfi_envrcpt): Increase numrcpt
	(mlfi_eom): Use priv_get instead of MLFIPRIV
	* src/prog.c (get_immediate): Compensate for changes in
	eval_environment
	(eval_environment): Fix reenterability: increase env->pc only when
	the instruction returns successfully.

2006-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am: Remove MU_COMPAT. We need the latest mailutils
	(pre 1.0)
	* src/gram.y: Adopt new MU namespace
	(code_node): Fix generation of 'and' and 'or' code
	* src/lex.l: Adopt new MU namespace
	* src/mailfrom.h (instr_and,instr_or): Remove
	Adopt new MU namespace
	* src/main.c: Adopt new MU namespace
	New option --source
	* src/prog.c: Adopt new MU namespace
	(instr_and,instr_or): Remove
	* doc/mailfromd.texi: Update
	
2006-01-17  Sergey Poznyakoff  <gray@gnu.org.ua> (Sync with v_1_0)

        * src/main.c (check_portspec): Fix eventual coredump and add more
	checks.

2006-01-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (code_node): Use BNZ for branching.
	[poll]: bugfix
	* src/main.c (config_dump): Renamed to config_dump_tree.
	(code_dump): Renamed to config_dump_code.
	New opions --dump-tree (eq. --debug=d), --dump-grammar-trace
	(eq. --debug=y), --dump-lex-trace (eq. --debug=l), --dump-code
	(eq. --debug=c).
	* src/prog.c (adjust_stack): Fix typo (reverted sign)
	(get_immediate): pc is already advanced by 1 by the time the
	function is called.
	(instr_bz, instr_bnz, instr_jmp): Fix 2nd. argument to advance_pc
	(instr_callout): Fix typo: adjust_stack instead of advance_pc.

2006-01-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Started major rewrite. The final aim is to make the internal
	program reentrant and to make it stop when it is trying to
	reference a non-existend sendmail variable. Then, the milter
	handler should return SMFIS_CONTINUE to pass control over to the
	next handler. That, in turn, should restart program execution in
	the hope that Sendmail has provided the variable on this stage. If
	it does not the process continues.
	
	* src/Makefile.am (mailfromd_SOURCES): Add prog.c
	* src/prog.c: New file
	* src/gram.y (codegen): Add code generation functions.
	(name_comp,name_destroy,dict_init,dict_install,dict_destroy)
	(dict_getsym): Move to prog.c
	(eval_poll,eval_hostname,eval_rate,eval_node)
	(eval_node_list,run_program): Remove runtime evaluation functions
	(ctx_getsym,ctx_setreply,ctx_setheader): Moved to main.c
	(test_program): Rewritten using new functions
	* src/lex.l: Return EQ and NE as keywords.
	(parse_error_locus): New function.
	* src/mailfrom.h (regex_flags): Extern declaration
	(eval_environ_t,instr_t,prog_counter_t): New types.
	(instr_xchg,instr_ston,instr_ntos,instr_locus,instr_push_immediate)
	(instr_symbol,instr_bz,instr_bnz,instr_jmp,instr_callout,instr_dup)
	(instr_cmp,instr_pop,instr_and,instr_or,instr_regex,instr_regcomp)
	(instr_fnmatch,instr_not,instr_next,instr_return,instr_header)
	(instr_resolve,instr_relayed_domain,instr_rate,instr_eqn,instr_eqs)
	(instr_nen,instr_nen,create_environment,destroy_environment)
	(eval_environment,environment_get_status,codegen)
	(parse_error_locus): New functions
	* src/main.c (code_dump): New  variable (--debug=c option)
	(ctx_getsym,ctx_setreply,ctx_setheader): Moved from gram.y
	(mlfi_envfrom): Rewritten using new functions
	(decode_debug): Handle [cC]
	(main): Generate code and, if required, print it on stdout

2006-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	-= Release 1.3 =-
	
2006-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/lex.l: Remove leftover argc_unquote_char

2006-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Raise version number to 1.3
	* NEWS: Updated
	* README: Mention BROKEN_PTHREAD_SLEEP Sendmail variable
	* doc/mailfromd.texi: Likewise
	* src/main.c (check_portspec): New function.

2005-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/Makefile.am (AM_CPPFLAGS): Define MU_COMPAT, needed for
	latest mailutils.

2005-09-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/dns.c (resolve_ipstr): New implementation, taking into
	account cnames.
	* src/main.c (resolve_ipstr): Removed in favor of the new
	implementation. 

2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	* THANKS: New file
	* Makefile.am (AUTOMAKE_OPTIONS): New variable
	* configure.ac: Raised version number to 1.2
	* NEWS: Likewise.

	* doc/gendocs_template: Updated
	* doc/mailfromd.texi: Updated

	* src/cache.c (cache_delete): Rewritten using db_delete
	* src/db.c (db_delete): New function
	* src/mailfrom.h: Likewise
	* src/main.c: Option --delete takes an optional argument, as
	--list and --expire
	* src/rate.c (rate_delete): New function

	* src/lex.l (line_add_unescape): Use argcv_unquote_char
	* src/cache.c: Use separate expiration times for negative and
	positive entries.
	* src/mailfrom.h: Likewise.
	* src/main.c: Likewise.
	* src/dns.c (getmx): Return immediately in mf_temp_failure.

2005-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c: New option --syslog (cancels --stderr).
	(parse_opt) Make sure the errors are reported on stderr wherever
	it is connected to a tty (unless in daemon mode or otherwise
	directed by --syslog option).

2005-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y (stmtlist): Bugfix
	(NEXT): New token
	* src/lex.l (NEXT): New token
	* src/mailfrom.h (node_type_continue): Renamed to node_type_next
	
	* src/gram.y (ACT_CONTINUE): Continue execution of the program
	* src/mailfrom.h (node_type_continue): New node type

	* configure.ac (DEFAULT_EXPIRE_RATES_INTERVAL): New variable
	* src/db.c: New file
	* src/Makefile.am (mailfromd_SOURCES): Add db.c
	(AM_CPPFLAGS): Define DEFAULT_EXPIRE_RATES_INTERVAL
	* src/mailfrom.h (db_item_printer_t,db_expire_t): New types
	(rate_expire_db,db_list_item,db_list,db_expire): New functions
	* src/cache.c (cache_list_item,cache_list_db,cache_expire_db):
	Rewritten using functions from db.c
	* src/main.c (MAILFROMD_EXPIRE_RATEDB): New mode
	(parse_opt): Removed --list-rates option. Both --list and --expire
	now take an optional argument, specifying which database to
	operate upon.
	(set_rates_expire): New function. Handles rates-expire-interval
	pragma.
	* src/rate.c (get_rate): Optimized expiration logic.
	(rate_list_item,rate_list_db): Rewritten using functions from db.c
	(rate_expire_db): New function
	
2005-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	* configure.ac: Complain if a DB support is required but not
	found.
	* src/rate.c: New file
	* src/Makefile.am: Add rate.c
	* src/gram.y: Add support for rate statement
	* src/lex.l: Likewise.
	* src/main.c: Likewise.
	* src/mailfrom.h: Rename getmx_status to mf_status
	* src/cache.c: Likewise.
	* src/dns.c: Likewise.
	
	* doc/mailfromd.texi: Documented rate statement
	* etc/mailfromd.rc: Likewise

2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/main.c (check_on_host): Destroy IO data only if these have
	been initialized.
	* src/dns.c (_getmx): Fix eventual buffer overflow.

2005-07-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/gram.y: Do not include gram.h
	(eval_hostname): Return with unmodified val if resolve_ipstr
	fails.

	* configure.ac: Raised version number to 1.1
	Check for argcv_unescape_char vs. argcv_unquote_char (CVS
	mailutils declares the latter).
	* src/Makefile.am: Bugfix: place LIBOBJS into LDADD
	* src/dns.c: Include resolv.h after netinet/in.h

2005-06-30  Sergey Poznyakoff  <gray@Noldor.runasimi.org>

	* doc/mailfromd.texi: Fixed usage of @email{} and @url{}.

2005-06-17  Sergey Poznyakoff  <mail@sun.farlep.net>

	* src/cache.c (cache_expire_db): Check for res==NULL.
	* src/main.c (method_strict): Give precedence to temporary
	failure, if it occurs in any poll.
	(method_standard): Check the client host unless mx check gives
	success. Give precedence to temporary failure, if it occurs in any
	poll. 

2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* src/main.c (smtp_send2,smtp_send3): Send fully formed command,
	along with final CRLF, in one go.
	(method_standard): Check MXs first, and only if they fail, check the
	client host.
	* src/gram.y (eval_poll): Fix wording of trace message
	
2005-06-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* configure.ac: Raised version number to 1.0.
	* Makefile.am (distuninstallcheck_listfiles): New variable. The
	install-data-local rule in etc/Makefile.am breaks distuninstall
	checks, hence the need to fix it.
	* doc/mailfromd.texi: Finished

2005-06-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* configure.ac: Warn if DBM support is not configured
	* doc/mailfromd.texi: Updated to match recent changes.
	* etc/Makefile.am: Install mailfromd.rc
	* src/gram.y: Allow two additional arguments to poll: as and from.
	* src/lex.l: Handle new keywords: not, as, from.
	* src/mailfrom.h (smtp_domain,postmaster_email): External
	declarations.
	* src/main.c (check_on_host,check_mx_records)
	(method_strict,method_standard): Accept two additional arguments.

2005-06-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* Makefile.am (SUBDIRS): Add etc
	* configure.ac: New subst variable MAILFROMSTATEDIR
	* etc: New directory
	* etc/Makefile.am: New file
	* etc/mailfromd.rc: New file
	* etc/rc.in: New file
	* etc/.cvsignore: New file
	* src/Makefile.am (MAILFROMSTATEDIR): Remove definition
	* src/dns.c: Add missing includes.
	(free_mx_buffer): Removed
	* src/gram.y: Add configurable regcomp flags.
	(parse_pragma): New function
	* src/lex.l: Parse pragma directives
	* src/mailfrom.h: Add new declarations
	* src/main.c: Changed option handling
	
2005-06-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* src/gram.y: Implement new keyword 'relayed'
	* src/lex.l: Likewise
	* src/mailfrom.h: Likewise
	* src/main.c (relayed_domain_p): Verify full hostname as well
	(method_strict,method_standard): Return success on empty email.

	* configure.ac: Raised version number to 0.9.9
	* src/Makefile.am (EXTRA_DIST): Added gram.h
	* src/gram.y: Improved tracing and debugging output.
	* src/lex.l: Return locus along with the keyword
	* src/mailfrom.h (debug4,debug5,debug6): New macros
	(struct locus): new data type
	(struct poll_action, struct node): Include locus
	(get_locus, trace): New functions
	* src/main.c (do_trace): New variable (option --trace)
	(vlogmsg,logmsg,transcript): Fixed signature (const char *fmt).
	(trace): New function.
	(parse_opt): Handle --trace option.

2005-06-09  Sergey Poznyakoff  <gray@Noldor.runasimi.org>

	* src/mailfrom.h: New debug macros.
	(node_type_hostname): New node type
	* src/cache.c: Use new debug macros
	* src/dns.c: Likewise
	* src/gram.y: Likewise
	* src/lex.l: New keyword HOSTNAME.
	* src/main.c: Implement header operations
	
2005-06-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* configure.ac: Check for yacc and lex
	* src/gram.y: New file. Configuration file grammar and run-time
	support.
	* src/lex.l: New file. Configuration file lexical analyzer.
	* src/Makefile.am (mailfromd_SOURCES): Add gram.y lex.l
	(AM_CPPFLAGS): Define SYSCONFDIR
	(AM_YFLAGS,AM_LFLAGS): New vars
	* src/dns.c: mailutils/mailutils.h are now included from
	mailfrom.h
	* src/mailfrom.h: Add new includes
	(DEFAULT_CONFIG_FILE): New define
	Add parse tree-related data types
	(parse_error,yyparse,source,parse_config): New declarations
	* src/main.c: Major rewrite: removed predefined and configurable
	actions, get *the program* to be executed from the configuration
	file.
	* src/.cvsignore: Updated
	
2005-06-08  Sergey Poznyakoff  <gray@sun.farlep.net>

	* src/main.c (smtp_stream_wait): Take an additional
	argument: number of attempts. Loop until the stream is ready or
	the number of attempts is exhausted. All callers updated.

2005-06-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* src/main.c (method_fp,method_standard,method_strict): Changed
	return type. All callers updated.
	(check_on_host): Issue EHLO if remote party refuses HELO.
	
2005-06-06  Sergey Poznyakoff  <gray@Noldor.runasimi.org>

	* src/main.c (method_standard): Check the host first, only if it
	does not answer, check MXs.

2005-06-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* NEWS: Updated
	* README: Updated
	* src/main.c (action_failure_default): Changed to return:reject
	(SMTP_MAJOR): New macro
	(check_on_host): Use SMTP_MAJOR
	* doc/.cvsignore: Updated

2005-06-05  Sergey Poznyakoff  <gray@Noldor.runasimi.org>

	* doc/mailfromd.texi: More documentation
	* src/Makefile.am (install-data-local): Create MAILFROMSTATEDIR
	* src/cache.c (cache_expire_db): New function
	* src/mailfrom.h: Likewise
	* src/main.c (add_header): Removed. Use per-message private data
	to keep it. All referers updated.
	(--delete): New mode
	(--expire): New mode

	* doc/Makefile.am: Bugfixes
	* doc/mailfromd.texi: Created documentation framework
	* src/cache.c (cache_get): Do not update timestamps on each
	retrieval.
	* src/main.c (capa): Add license capability.

	* configure.ac (DEFAULT_SOCKET): Change default
	* src/Makefile.am (AM_CPPFLAGS): Define MAILFROMSTATEDIR instead
	of LOCALSTATEDIR
	(LDADD): Get rid of static linkage with libresolv
	* src/mailfrom.h (DEFAULT_PIDFILE,DEFAULT_DATABASE): Use
	MAILFROMSTATEDIR instead of LOCALSTATEDIR.
	* src/dns.c (_getmx): Rewritten using BIND-4-style interface. See
	comment to this function for the reasons of this regress.
	* src/main.c (check_mx_records): Bugfix. Provide default return
	value in case no MX records are found.
	(mailfromd_show_defaults): Show MAILFROMSTATEDIR

2005-06-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>

	* Makefile.am (SUBDIRS): Add doc
	* configure.ac (AC_CONFIG_FILES): Add doc/Makefile
	* src/main.c (postmaster_email): New variable
	(check_on_host): Use postmaster_email instead of hardcoding <>
	address.
	(options): New option --postmaster-email; Fixed several bugs.
	(parse_opt): Handle --postmaster-email option. Minor fixes.
	* doc: New directory
	* doc/Makefile.am, doc/fdl.texi, doc/gendocs_template,
	doc/mailfromd.texi, doc/rendition.texi, doc/.cvsignore: New files.

	* Makefile.am: Updated for deep directory structure
	* configure.ac: Updated for deep directory structure. Detect
	DBM/NDBM/GDBM, define variables for caching. Raised
	version number to 0.2
	* src: New directory
	* dns.c, daemon.c, obstack.c, obstack.h, snprintf.c,
	snprintf.h, mailfrom.h: Moved to ...
	* src/dns.c, src/daemon.c, obstack.c, src/obstack.h,
	src/snprintf.c, src/snprintf.h, src/mailfrom.h: here
	* src/Makefile.am: New file
	* main.c: Moved to src/
	* src/main.c: Moved from ../. Added result caching and new
	operating modes.
	* src/mu_dbm.c, src/mu_dbm.h, src/strtok_r.c: New files. Exported
	from mailutils
	* src/cache.c: New file. Caching support.
	* .cvsignore: New file
	* src/.cvsignore: New file

	* dns.c (getmx): Do not skip hostname when checking. Handle both
	IP address and FQDN as input.
	* main.c: Implemented two methods: standard (the default) and
	strict (the one that was implemented initially).

2005-06-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* main.c: Rewritten action system. Documented the code.

2005-06-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* main.c (parse_opt): Ordered switch cases.
	(main): Switch to user's privileges only if started as root.

2005-06-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

	* Initial release.


Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End: