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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2002-2-1 (1.70)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>28. Internals</TITLE>
<META NAME="description" CONTENT="28. Internals">
<META NAME="keywords" CONTENT="sympa">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="sympa.css">
<LINK REL="next" HREF="node30.html">
<LINK REL="previous" HREF="node28.html">
<LINK REL="up" HREF="sympa.html">
<LINK REL="next" HREF="node30.html">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html1549"
HREF="node30.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html1543"
HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html1537"
HREF="node28.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html1545"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<A NAME="tex2html1547"
HREF="node30.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1550"
HREF="node30.html">Index</A>
<B> Up:</B> <A NAME="tex2html1544"
HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html1538"
HREF="node28.html">27. Using Sympa commands</A>
<B> <A NAME="tex2html1546"
HREF="node1.html">Contents</A></B>
<B> <A NAME="tex2html1548"
HREF="node30.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html1551"
HREF="node29.html#SECTION002910000000000000000">28.1 mail.pm</A>
<UL>
<LI><A NAME="tex2html1552"
HREF="node29.html#SECTION002911000000000000000">28.1.1 public functions</A>
<LI><A NAME="tex2html1553"
HREF="node29.html#SECTION002912000000000000000">28.1.2 private functions</A>
</UL>
<BR>
<LI><A NAME="tex2html1554"
HREF="node29.html#SECTION002920000000000000000">28.2 List.pm</A>
<UL>
<LI><A NAME="tex2html1555"
HREF="node29.html#SECTION002921000000000000000">28.2.1 Functions for message distribution</A>
<LI><A NAME="tex2html1556"
HREF="node29.html#SECTION002922000000000000000">28.2.2 Functions for template sending</A>
<LI><A NAME="tex2html1557"
HREF="node29.html#SECTION002923000000000000000">28.2.3 Functions for service messages</A>
<LI><A NAME="tex2html1558"
HREF="node29.html#SECTION002924000000000000000">28.2.4 Functions for message notification</A>
<LI><A NAME="tex2html1559"
HREF="node29.html#SECTION002925000000000000000">28.2.5 Functions for topic messages</A>
<LI><A NAME="tex2html1560"
HREF="node29.html#SECTION002926000000000000000">28.2.6 Scenario evaluation</A>
<LI><A NAME="tex2html1561"
HREF="node29.html#SECTION002927000000000000000">28.2.7 Structure and access to list configuration parameters</A>
</UL>
<BR>
<LI><A NAME="tex2html1562"
HREF="node29.html#SECTION002930000000000000000">28.3 sympa.pl</A>
<LI><A NAME="tex2html1563"
HREF="node29.html#SECTION002940000000000000000">28.4 Commands.pm</A>
<UL>
<LI><A NAME="tex2html1564"
HREF="node29.html#SECTION002941000000000000000">28.4.1 Commands processing</A>
<LI><A NAME="tex2html1565"
HREF="node29.html#SECTION002942000000000000000">28.4.2 tools for command processing</A>
</UL>
<BR>
<LI><A NAME="tex2html1566"
HREF="node29.html#SECTION002950000000000000000">28.5 wwsympa.fcgi</A>
<LI><A NAME="tex2html1567"
HREF="node29.html#SECTION002960000000000000000">28.6 report.pm</A>
<UL>
<LI><A NAME="tex2html1568"
HREF="node29.html#SECTION002961000000000000000">28.6.1 Message diffusion</A>
<LI><A NAME="tex2html1569"
HREF="node29.html#SECTION002962000000000000000">28.6.2 Mail commands</A>
<LI><A NAME="tex2html1570"
HREF="node29.html#SECTION002963000000000000000">28.6.3 Web commands</A>
</UL>
<BR>
<LI><A NAME="tex2html1571"
HREF="node29.html#SECTION002970000000000000000">28.7 tools.pl</A>
<LI><A NAME="tex2html1572"
HREF="node29.html#SECTION002980000000000000000">28.8 Message.pm</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION002900000000000000000"></A>
<A NAME="internals"></A>
<BR>
28. Internals
</H1>
<P>
This chapter describes these modules (or a part of) :
<UL>
<LI><A NAME="12025"></A><TT>src/mail.pm</TT> : low level of mail sending
</LI>
<LI><A NAME="12028"></A><TT>src/List.pm</TT> : list processing and informations about structure and access to list configuration parameters
</LI>
<LI><A NAME="12031"></A><TT>src/sympa.pm</TT> : the main script, for messages and mail commands processing.
</LI>
<LI><A NAME="12034"></A><TT>src/Commands.pm</TT> : mail commands processing
</LI>
<LI><A NAME="12037"></A><TT>src/wwsympa.pm</TT> : web interface
</LI>
<LI><A NAME="12040"></A><TT>src/report.pm</TT> : notification and error reports about requested services (mail and web)
</LI>
<LI><A NAME="12043"></A><TT>src/tools.pm</TT> : various tools
</LI>
<LI><A NAME="12046"></A><TT>src/Message.pm</TT> : Message object used to encapsule a received message.
</LI>
</UL>
<P>
<H1><A NAME="SECTION002910000000000000000"></A>
<A NAME="4650"></A>
<BR>
28.1 mail.pm
</H1>
<P>
This module deals with mail sending and does the SMTP job. It provides a function for message distribution to a list,
the message can be encrypted. There is also a function to send service messages by parsing tt2 files,
These messages can be signed.
For sending, a call to sendmail is done or the message is pushed in a spool according to calling context.
<P>
<H2><A NAME="SECTION002911000000000000000">
28.1.1 public functions</A>
</H2>
<P>
mail_file(), mail_message(), mail_forward(), set_send_spool(), reaper().
<P>
<H3><A NAME="SECTION002911100000000000000"></A>
<A NAME="mail-mail-file"></A><A NAME="4654"></A>
<BR>
28.1.1.1 <FONT SIZE="+1">mail_file()</FONT>
</H3>
<P>
Message is written by parsing a tt2 file (or with a string ). It writes mail headers if they are missing and they are encoded.
Then the message is sent by calling mail::sending() function (see <A HREF="#mail-sending">28.1.2</A>, page <A HREF="node29.html#mail-sending"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12049"></A><TT>filename</TT> : string - tt2 filename '' - no tt2 filename sent
</LI>
<LI><A NAME="12052"></A><TT>rcpt</TT> (+) : SCALAR ref(ARRAY) - SMTP "RCPT To:" field
</LI>
<LI><A NAME="12055"></A><TT>data</TT> (+) : ref(HASH) - used to parse tt2 file, contains header values, keys are :
<UL>
<LI><A NAME="12058"></A><TT>return_path</TT> (+) : SMTP "MAIL From:" field <I>if send by SMTP</I>, q
"X-Sympa-From:" field <I>if send by spool</I>
</LI>
<LI><A NAME="12061"></A><TT>to</TT> : "To:" header field <I>else it is $rcpt</I>
</LI>
<LI><A NAME="12064"></A><TT>from</TT> : "From:" field <I>if $filename is not a full msg</I>
</LI>
<LI><A NAME="12067"></A><TT>subject</TT> : "Subject:" field <I>if $filename is not a full msg</I>
</LI>
<LI><A NAME="12070"></A><TT>replyto</TT> : "Reply-to:" field <I>if $filename is not a full msg</I>
</LI>
<LI><A NAME="12073"></A><TT>headers</TT> : ref(HASH), keys are other mail headers
</LI>
<LI><A NAME="12076"></A><TT>body</TT> : body message <I>if not $filename</I>
</LI>
<LI><A NAME="12079"></A><TT>lang</TT> : tt2 language <I>if $filename</I>
</LI>
<LI><A NAME="12082"></A><TT>list</TT> : ref(HASH) <I>if sign_mode='smime'</I> - keys are :
<UL>
<LI><A NAME="12085"></A><TT>name</TT> : list name
</LI>
<LI><A NAME="12088"></A><TT>dir</TT> : list directory
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><A NAME="12091"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12094"></A><TT>sign_mode</TT> : 'smime'- the mail is signed with smime undef - no signature
</LI>
</OL>
<P>
<B>OUT</B> : 1
<P>
<H3><A NAME="SECTION002911200000000000000"></A>
<A NAME="mail-mail-message"></A>
<A NAME="4692"></A>
<BR>
28.1.1.2 <FONT SIZE="+1">mail_message()</FONT>
</H3>
<P>
Distributes a message to a list. The message is encrypted if needed, in this case, only one SMTP session is used for each recepient
otherwise, recepient are grouped by domain for sending (it controls the number recepient arguments to call sendmail).
Message is sent by calling mail::sendto() function (see <A HREF="#mail-sendto">28.1.2</A>, page <A HREF="node29.html#mail-sendto"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12097"></A><TT>message</TT> (+) : ref(Message) - message to distribute
</LI>
<LI><A NAME="12100"></A><TT>from</TT> (+) : message from
</LI>
<LI><A NAME="12103"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12106"></A><TT>rcpt</TT> (+) : ARRAY - recepients
</LI>
</OL>
<P>
<B>OUT</B> : <A NAME="12109"></A><TT>$numsmtp</TT> = number of sendmail process undef
<P>
<H3><A NAME="SECTION002911300000000000000"></A>
<A NAME="mail-mail-forward"></A>
<A NAME="4706"></A>
<BR>
28.1.1.3 <FONT SIZE="+1">mail_forward()</FONT>
</H3>
<P>
Forward a message by calling mail::sending() function (see <A HREF="#mail-sending">28.1.2</A>, page <A HREF="node29.html#mail-sending"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12112"></A><TT>msg</TT> (+) : ref(Message) ref(MIME::Entity) string - message to forward
</LI>
<LI><A NAME="12115"></A><TT>from</TT> (+) : message from
</LI>
<LI><A NAME="12118"></A><TT>rcpt</TT> (+) : ref(SCALAR) ref(ARRAY) - recepients
</LI>
<LI><A NAME="12121"></A><TT>robot</TT> (+) : robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002911400000000000000"></A>
<A NAME="mail-set-send-spool"></A>
<A NAME="4719"></A>
<BR>
28.1.1.4 <FONT SIZE="+1">set_send_spool()</FONT>
</H3>
<P>
Used by other processes than sympa.pl to indicate to send message by
writting message in spool instead of calling mail::smtpto() function (see <A HREF="#mail-smtpto">28.1.2</A>, page <A HREF="node29.html#mail-smtpto"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
The concerned spool is set in <A NAME="12124"></A><TT>$send_spool</TT> global variable, used by mail::sending() function
(see <A HREF="#mail-sending">28.1.2</A>, page <A HREF="node29.html#mail-sending"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12127"></A><TT>spool</TT> (+) : the concerned spool for sending.
</LI>
</OL>
<P>
<B>OUT</B> : -
<P>
<H3><A NAME="SECTION002911500000000000000"></A>
<A NAME="mail-reaper"></A>
<A NAME="4732"></A>
<BR>
28.1.1.5 <FONT SIZE="+1">reaper()</FONT>
</H3>
<P>
Non blocking function used to clean the defuncts child processes by waiting for them and then
decreasing the counter. For exemple, this function is called by mail::smtpto() (see
<A HREF="#mail-smtpto">28.1.2</A>, page <A HREF="node29.html#mail-smtpto"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>), main loop of sympa.pl, task_manager.pl,
bounced.pl.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12130"></A><TT>block</TT>
</LI>
</OL>
<P>
<B>OUT</B> : the pid of the defunct process -1 <I>if there is no such child process</I>.
<P>
<H2><A NAME="SECTION002912000000000000000">
28.1.2 private functions</A>
</H2>
<P>
sendto(), sending(), smtpto().
<P>
<H3><A NAME="SECTION002912100000000000000"></A>
<A NAME="mail-sendto"></A><A NAME="4744"></A>
<BR>
28.1.2.1 <FONT SIZE="+1">sendto()</FONT>
</H3>
<P>
Encodes subject header. Encrypts the message if needed. In this case, it checks if there is
only one recepient. Then the message is sent by calling mail::sending() function
(see <A HREF="#mail-sending">28.1.2</A>, page <A HREF="node29.html#mail-sending"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12133"></A><TT>msg_header</TT> (+) : ref(MIME::Head) - message header
</LI>
<LI><A NAME="12136"></A><TT>msg_body</TT> (+) : message body
</LI>
<LI><A NAME="12139"></A><TT>from</TT> (+) : message from
</LI>
<LI><A NAME="12142"></A><TT>rcpt</TT> (+) : ref(SCALAR) ref(ARRAY) - message recepients (ref(SCALAR) for encryption)
</LI>
<LI><A NAME="12145"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12148"></A><TT>encrypt</TT> : 'smime_crypted' the mail is encrypted with smime undef - no encryption
</LI>
</OL>
<P>
<B>OUT</B> : 1 - sending by calling smtpto (sendmail) 0 - sending by push in spool undef
<P>
<H3><A NAME="SECTION002912200000000000000"></A>
<A NAME="mail-sending"></A><A NAME="4759"></A>
<BR>
28.1.2.2 <FONT SIZE="+1">sending()</FONT>
</H3>
<P>
Signs the message according to <A NAME="12151"></A><TT>$sign_mode</TT>. Chooses sending mode according to context. If <A NAME="12154"></A><TT>$send_spool</TT> global variable is empty, the message is
sent by calling mail::smtpto() function (see <A HREF="#mail-smtpto">28.1.2</A>, page <A HREF="node29.html#mail-smtpto"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
else the message is written in spool <A NAME="12157"></A><TT>$send_spool</TT> in order to be handled by sympa.pl process (because only this
is allowed to make a fork).
When the message is pushed in spool, these mail headers are added :
<UL>
<LI>``X-Sympa-To:'' : recepients
</LI>
<LI>``X-Sympa-From:'' : from
</LI>
<LI>``X-Sympa-Checksum:'' : to check allowed program to push in spool
</LI>
</UL>
A message pushed in spool like this will be handled later by sympa::DoSendMessage() function
(see <A HREF="#sympa-dosendmessage">28.3</A>, page <A HREF="node29.html#sympa-dosendmessage"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12160"></A><TT>msg</TT> (+) : ref(MIME::Entity) string - message to send
</LI>
<LI><A NAME="12163"></A><TT>rcpt</TT> (+) : ref(SCALAR) ref(ARRAY) - recepients (for SMTP : "RCPT To:" field)
</LI>
<LI><A NAME="12166"></A><TT>from</TT> (+) : for SMTP : "MAIL From:" field for spool sending : "X-Sympa-From" field
</LI>
<LI><A NAME="12169"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12172"></A><TT>listname</TT> : listname ''
</LI>
<LI><A NAME="12175"></A><TT>sign_mode</TT> (+) : 'smime' 'none'for signing
</LI>
<LI><A NAME="12178"></A><TT>sympa_email</TT> : for the file name for spool sending
</LI>
</OL>
<P>
<B>OUT</B> : 1 - sending by calling smtpto() (sendmail) 0 - sending by pushing in spool undef
<P>
<H3><A NAME="SECTION002912300000000000000"></A>
<A NAME="mail-smtpto"></A><A NAME="4782"></A>
<BR>
28.1.2.3 <FONT SIZE="+1">smtpto()</FONT>
</H3>
<P>
Calls to sendmail for the recipients given as argument by making a fork and an exec. Before,
waits for number of children process number allowed by sympa.conf by calling mail::reaper() function
(see <A HREF="#mail-reaper">28.1.1</A>, page <A HREF="#mail-repaer"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12181"></A><TT>from</TT> (+) : SMTP "MAIL From:" field
</LI>
<LI><A NAME="12184"></A><TT>rcpt</TT> (+) : ref(SCALAR)) ref(ARRAY) - SMTP "RCPT To:" field
</LI>
<LI><A NAME="12187"></A><TT>robot</TT> (+) : robot
</LI>
</OL>
<P>
<B>OUT</B> : <A NAME="12190"></A><TT>mail::$fh</TT> - file handle on opened file for ouput, for SMTP "DATA" field undef
<BR>
<P>
<H1><A NAME="SECTION002920000000000000000"></A>
<A NAME="4794"></A>
<BR>
28.2 List.pm
</H1>
<P>
This module includes list processing functions.
<P>
Here are described functions about :
<UL>
<LI>Message distribution in a list
</LI>
<LI>Sending using templates
</LI>
<LI>Service messages
</LI>
<LI>Notification message
</LI>
<LI>Topic messages
</LI>
<LI>Scenario evaluation
</LI>
</UL>
<P>
Follows a description of structure and access on list parameters.
<P>
<H2><A NAME="SECTION002921000000000000000">
28.2.1 Functions for message distribution</A>
</H2>
<P>
distribute_message(), send_msg(), send_msg_digest().
<P>
These functions are used to message distribution in a list.
<P>
<H3><A NAME="SECTION002921100000000000000"></A>
<A NAME="list-distribute-msg"></A><A NAME="4800"></A>
<BR>
28.2.1.1 <FONT SIZE="+1">distribute_msg()</FONT>
</H3>
<P>
Prepares and distributes a message to a list :
<UL>
<LI>updates the list stats
</LI>
<LI>Loads information from message topic file if exists and adds X-Sympa-Topic header
</LI>
<LI>hides the sender if the list is anonymoused (list config : anonymous_sender)
and changes name of msg topic file if exists.
</LI>
<LI>adds custom subject if necessary (list config : custom_subject)
</LI>
<LI>archives the message
</LI>
<LI>changes the reply-to header if necessary (list config : reply_to_header)
</LI>
<LI>removes unwanted headers if present (config : remove_headers))
</LI>
<LI>adds useful headers (X-Loop,X-Sequence,Errors-to,Precedence,X-no-archive - list config : custom_header)
</LI>
<LI>adds RFC 2919 header field (List-Id) and RFC 2369 header fields (list config : rfc2369_header_fields)
</LI>
<LI>stores message in digest if the list accepts digest mode (encrypted message can't be included in digest)
</LI>
<LI>sends the message by calling List::send_msg() (see <A HREF="#list-send-msg">28.2.1</A>,
page <A HREF="node29.html#list-send-msg"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
</LI>
</UL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12193"></A><TT>self</TT> (+) : ref(List) - the list concerned by distribution
</LI>
<LI><A NAME="12196"></A><TT>message</TT> (+): ref(Message) - the message to distribute
</LI>
</OL>
<P>
<B>OUT</B> : result of List::send_msg() function (number of sendmail process)
<P>
<H3><A NAME="SECTION002921200000000000000"></A>
<A NAME="list-send-msg"></A><A NAME="4813"></A>
<BR>
28.2.1.2 <FONT SIZE="+1">send_msg()</FONT>
</H3>
<P>
This function is called by List::distribute_msg() (see <A HREF="#list-distribute-msg">28.2.1</A>,
page <A HREF="node29.html#list-distribute-msg"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) to select subscribers
according to their reception mode and to the ``Content-Type'' header field of the message.
Sending are grouped according to their reception mode :
<UL>
<LI>normal : add a footer if the message is not protected (then the message is ``altered'')
In a message topic context, selects only one who are subscribed to the topic of the
message to distribute (calls to select_subcribers_for_topic(), see <A HREF="#list-select-subscribers-for-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>,
page <A HREF="#list-select-subscribers-for-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
</LI>
<LI>notice
</LI>
<LI>txt : add a footer
</LI>
<LI>html : add a footer
</LI>
<LI>urlize : add a footer and create an urlize directory for Web access
</LI>
</UL>
The message is sent by calling List::mail_message() (see <A HREF="#mail-mail-message">28.1.1</A>,
page <A HREF="node29.html#mail-mail-message"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
If the message is ``smime_crypted'' and the user has not got any certificate, a message service is sent to him.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12199"></A><TT>self</TT> (+) : ref(List) - the list concerned by distribution
</LI>
<LI><A NAME="12202"></A><TT>message</TT> (+): ref(Message) - the message to distribute
</LI>
</OL>
<P>
<B>OUT</B> : <A NAME="12205"></A><TT>$numsmtp</TT> : addition of mail::mail_message() function results
( = number of sendmail process ) undef
<P>
<H3><A NAME="SECTION002921300000000000000"></A>
<A NAME="list-send-msg-digest"></A><A NAME="4831"></A>
<BR>
28.2.1.3 <FONT SIZE="+1">send_msg_digest()</FONT>
</H3>
<P>
Sends a digest message to the list subscribers with reception digest, digestplain or summary :
it creates the list of subscribers in various digest modes and then creates the list of
messages. Finally sending to subscribers is done by calling List::send_file() function
(see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
with mail template ``digest'', ``digestplain'' or ``summary''.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12208"></A><TT>self</TT> (+): ref(List) - the concerned list
</LI>
</OL>
<P>
<B>OUT</B> :
<UL>
<LI>1 <I>if sending</I>
</LI>
<LI>0 <I>if no subscriber for sending digest, digestplain or summary</I>
</LI>
<LI>undef
</LI>
</UL>
<P>
<H2><A NAME="SECTION002922000000000000000">
28.2.2 Functions for template sending</A>
</H2>
<P>
send_file(), send_global_file().
<P>
These functions are used by others to send files. These files are made from template given in parameters.
<P>
<H3><A NAME="SECTION002922100000000000000"></A>
<A NAME="list-send-file"></A><A NAME="4846"></A>
<BR>
28.2.2.1 <FONT SIZE="+1">send_file()</FONT>
</H3>
<P>
Sends a message to a user, relative to a list. It finds the $tpl.tt2 file to make the message.
If the list has a key and a certificat and if openssl is in the configuration, the message is signed.
The parsing is done with variable $data set up first with parameter $context and then with configuration, here are
set keys :
<UL>
<LI><I>if $who=SCALAR then</I>
<UL>
<LI><A NAME="12211"></A><TT>user.password</TT>
</LI>
<LI><I>if $user key is not defined in $context then</I> <A NAME="12214"></A><TT>user.email</TT>(:= $who), <A NAME="12217"></A><TT>user.lang</TT> (:= list lang)
<I>and if the user is in DB then</I> <A NAME="12220"></A><TT>user.attributes</TT> (:= attributes in DB user_table) are defined
</LI>
<LI><I>if $who is subscriber of $self then</I> <A NAME="12223"></A><TT>subscriber.date subscriber.update_date</TT>
<I>and if exists then</I> <A NAME="12226"></A><TT>subscriber.bounce subscriber.first_bounce</TT> are defined
</LI>
</UL>
</LI>
<LI><A NAME="12229"></A><TT>return_path</TT> : used for SMTP ``MAIL From'' field or "X-Sympa-From:" field
</LI>
<LI><A NAME="12232"></A><TT>lang</TT> : the user lang or list lang or robot lang
</LI>
<LI><A NAME="12235"></A><TT>fromlist</TT> : "From:" field, pointed on list
</LI>
<LI><A NAME="12238"></A><TT>from</TT> : "From:" field, pointed on list <I>if no defined in $context</I>
</LI>
<LI><A NAME="12241"></A><TT>replyto</TT> : <I>if openssl is is sympa.conf and the list has a key ('private_key') and a certificat ('cert.pem') in its directory</I>
</LI>
<LI><A NAME="12244"></A><TT>boundary</TT> : boundary for multipart message <I>if no contained in $context</I>
</LI>
<LI><A NAME="12247"></A><TT>conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa_url conf.title</TT> : updated with robot config
</LI>
<LI><A NAME="12250"></A><TT>list.lang list.name list.domain list.host list.subject list.dir list.owner</TT>(ref(ARRAY)) : updated with list config
</LI>
</UL>
The message is sent by calling mail::mail_file() function
(see <A HREF="#mail-mail-file">28.1.1</A>, page <A HREF="node29.html#mail-mail-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12253"></A><TT>self</TT> (+) : ref(List)
</LI>
<LI><A NAME="12256"></A><TT>tpl</TT> (+) : template file name without .tt2 extension ($tpl.tt2)
</LI>
<LI><A NAME="12259"></A><TT>who</TT> (+) : SCALAR ref(ARRAY) - recepient(s)
</LI>
<LI><A NAME="12262"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12265"></A><TT>context</TT> : ref(HASH) - for the $data set up
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002922200000000000000"></A>
<A NAME="list-send-global-file"></A><A NAME="4886"></A>
<BR>
28.2.2.2 <FONT SIZE="+1">send_global_file()</FONT>
</H3>
<P>
Sends a message to a user not relative to a list. It finds the $tpl.tt2 file to make the message.
The parsing is done with variable $data set up first with parameter $context and then with configuration, here are
set keys :
<UL>
<LI><A NAME="12268"></A><TT>user.password user.lang</TT>
</LI>
<LI><I>if $user key is not defined in $context then</I> <A NAME="12271"></A><TT>user.email</TT> (:= $who)
</LI>
<LI><A NAME="12274"></A><TT>return_path</TT> : used for SMTP ``MAIL From'' field or "X-Sympa-From:" field
</LI>
<LI><A NAME="12277"></A><TT>lang</TT> : the user lang or robot lang
</LI>
<LI><A NAME="12280"></A><TT>from</TT> : "From:" field, pointed on SYMPA <I>if no defined in $context</I>
</LI>
<LI><A NAME="12283"></A><TT>boundary</TT> : boundary for multipart message <I>if no defined in $context</I>
</LI>
<LI><A NAME="12286"></A><TT>conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa_url conf.title</TT> : updated with robot config
</LI>
<LI><A NAME="12289"></A><TT>conf.version</TT> : <I>Sympa</I> version
</LI>
<LI><A NAME="12293"></A><TT>robot_domain</TT> : the robot
</LI>
</UL>
The message is sent by calling mail::mail_file() function
(see <A HREF="#mail-mail-file">28.1.1</A>, page <A HREF="node29.html#mail-mail-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12296"></A><TT>tpl</TT> (+) : template file name (filename.tt2), without .tt2 extension
</LI>
<LI><A NAME="12299"></A><TT>who</TT> (+) : SCALAR ref(ARRAY) - recepient(s)
</LI>
<LI><A NAME="12302"></A><TT>robot</TT> (+) : robot
</LI>
<LI><A NAME="12305"></A><TT>context</TT> : ref(HASH) - for the $data set up
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H2><A NAME="SECTION002923000000000000000">
28.2.3 Functions for service messages</A>
</H2>
<P>
archive_send(), send_to_editor(), request_auth(), send_auth().
<P>
These functions are used to send services messgase, correponding to a result of a command.
<P>
<H3><A NAME="SECTION002923100000000000000"></A>
<A NAME="list-archive-send"></A><A NAME="4914"></A>
<BR>
28.2.3.1 <FONT SIZE="+1">archive_send()</FONT>
</H3>
<P>
Sends an archive file ($file) to $who. The archive is a text file, independant from web archives.
It checks if the list is archived. Sending is done by callingList::send_file()
(see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
with mail template ``archive''.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12308"></A><TT>self</TT> (+): ref(List) - the concerned list
</LI>
<LI><A NAME="12311"></A><TT>who</TT> (+): recepient
</LI>
<LI><A NAME="12314"></A><TT>file</TT> (+): name of the archive file to send
</LI>
</OL>
<P>
<B>OUT</B> : - undef
<P>
<H3><A NAME="SECTION002923200000000000000"></A>
<A NAME="list-send-to-editor"></A><A NAME="4926"></A>
<BR>
28.2.3.2 <FONT SIZE="+1">send_to_editor()</FONT>
</H3>
<P>
Sends a message to the list editor for a request concerning a message to distribute.
The message awaiting for moderation is named with a key and is set in the spool queuemod.
The key is a reference on the message for editor.
The message for the editor is sent by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>,
page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) with mail template ``moderate''. In msg_topic context, the editor is
asked to tag the message.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12317"></A><TT>self</TT> (+): ref(List) - the concerned list
</LI>
<LI><A NAME="12320"></A><TT>method</TT> : 'md5' - for "editorkey" 'smtp' - for "editor"
</LI>
<LI><A NAME="12323"></A><TT>message</TT> (+): ref(Message) - the message to moderate
</LI>
</OL>
<P>
<B>OUT</B> : $modkey - the moderation key for naming message waiting for moderation
in spool queuemod. undef
<P>
<H3><A NAME="SECTION002923300000000000000"></A>
<A NAME="list-request-auth"></A><A NAME="4938"></A>
<BR>
28.2.3.3 <FONT SIZE="+1">request_auth()</FONT>
</H3>
<P>
Sends an authentification request for a requested command. The authentification request contains
the command to be send next and it is authentified by a key. The message is
sent to user by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>,
page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) with mail template ``request_auth''.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12326"></A><TT>self</TT> : ref(List) <I>not required if $cmd = ``remind''</I>.
</LI>
<LI><A NAME="12329"></A><TT>email</TT>(+): recepient, the requesting command user
</LI>
<LI><A NAME="12332"></A><TT>cmd</TT> :
<UL>
<LI><I>if $self then</I> 'signoff' 'subscribe' 'add' 'del' 'remind'
</LI>
<LI><I>else</I> 'remind'
</LI>
</UL>
</LI>
<LI><A NAME="12335"></A><TT>robot</TT> (+): robot
</LI>
<LI><A NAME="12338"></A><TT>param</TT> : ARRAY
<UL>
<LI>0 : used <I>if $cmd ='subscribe' 'add' 'del' 'invite'</I>
</LI>
<LI>1 : used <I>if $cmd ='add'</I>
</LI>
</UL>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002923400000000000000"></A>
<A NAME="list-send-auth"></A><A NAME="4961"></A>
<BR>
28.2.3.4 <FONT SIZE="+1">send_auth()</FONT>
</H3>
<P>
Sends an authentifiaction request for a message sent for distribution.
The message for distribution is copied in the authqueue spool to wait for confirmation by its sender .
This message is named with a key. The request is sent to user by calling List::send_file()
(see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) with mail template ``send_auth''.
In msg_topic context, the sender is asked to tag his message.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12341"></A><TT>self</TT>(+): ref(List) - the concerned list
</LI>
<LI><A NAME="12344"></A><TT>message</TT>(+): ref(Message) - the message to confirm
</LI>
</OL>
<P>
<B>OUT</B> : $modkey, the key for naming message waiting for confirmation in spool queuemod. undef
<P>
<H2><A NAME="SECTION002924000000000000000">
28.2.4 Functions for message notification</A>
</H2>
<P>
send_notify_to_listmaster(), send_notify_to_owner(), send_notify_to_editor(), send_notify_to_user().
<P>
These functions are used to notify listmaster, list owner, list editor or user
about events.
<P>
<H3><A NAME="SECTION002924100000000000000"></A>
<A NAME="list-send-notify-listmaster"></A><A NAME="4973"></A>
<BR>
28.2.4.1 <FONT SIZE="+1">send_notify_to_listmaster()</FONT>
</H3>
<P>
Sends a notice to listmaster by parsing ``listmaster_notification'' template. The template makes a specified or a
generic treatement according to variable $param.type (:= $operation parameter).
The message is sent by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
or List::send_global_file() (see <A HREF="#list-send-global-file">28.2.2</A>, page <A HREF="node29.html#list-send-global-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
according to the context : global or list context.
Available variables for the template are set up by this function, by $param parameter and by
List::send_global_file() or List::send_file().
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12347"></A><TT>operation</TT> (+) : notification type, corresponds to $type in the template
</LI>
<LI><A NAME="12350"></A><TT>robot</TT> (+): robot
</LI>
<LI><A NAME="12353"></A><TT>param</TT> (+): ref(HASH) ref (ARRAY) - values for variable used in the template :
<UL>
<LI><I>if ref(HASH) then</I> variables used in the template are keys of this HASH. These following
keys are required in the function, according to $operation value :
<UL>
<LI>'listname'(+) <I>if $operation=('request_list_creation' 'automatic_bounce_management')</I>
</LI>
</UL>
</LI>
<LI><I>if ref(ARRAY) then</I> variables used in template are named as : $param0, $param1, $param2, ...
</LI>
</UL>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002924200000000000000"></A>
<A NAME="list-send-notify-owner"></A><A NAME="4994"></A>
<BR>
28.2.4.2 <FONT SIZE="+1">send_notify_to_owner()</FONT>
</H3>
<P>
Sends a notice to list owner(s) by parsing ``listowner_notification'' template. The template makes a specified or a
generic treatement according to variable $param.type ( := $operation parameter).
The message is sent by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
Available variables for the template are set up by this function, by $param parameter and by
List::send_file().
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12356"></A><TT>self</TT> (+): ref(List) - the list for owner notification
</LI>
<LI><A NAME="12359"></A><TT>operation</TT> (+) : notification type, corresponds to $type in the template
</LI>
<LI><A NAME="12362"></A><TT>param</TT> (+): ref(HASH) ref (ARRAY) - values for variable used in the template :
<UL>
<LI><I>if ref(HASH) then</I> variables used in the template are keys of this HASH.
</LI>
<LI><I>if ref(ARRAY) then</I> variables used in template are named as : $param0, $param1, $param2, ...
</LI>
</UL>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002924300000000000000"></A>
<A NAME="list-send-notify-editor"></A><A NAME="5010"></A>
<BR>
28.2.4.3 <FONT SIZE="+1">send_notify_to_editor()</FONT>
</H3>
<P>
Sends a notice to list editor(s) by parsing ``listeditor_notification'' template. The template makes a specified or a
generic treatement according to variable $param.type ( := $operation parameter).
The message is sent by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
Available variables for the template are set up by this function, by $param parameter and by
List::send_file().
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12365"></A><TT>self</TT> (+): ref(List) - the list for editor notification
</LI>
<LI><A NAME="12368"></A><TT>operation</TT> (+) : notification type, corresponds to $type in the template
</LI>
<LI><A NAME="12371"></A><TT>param</TT> (+): ref(HASH) ref (ARRAY) - values for variable used in the template :
<UL>
<LI><I>if ref(HASH) then</I> variables used in the template are keys of this HASH.
</LI>
<LI><I>if ref(ARRAY) then</I> variables used in template are named as : $param0, $param1, $param2, ...
</LI>
</UL>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002924400000000000000"></A>
<A NAME="list-send-notify-user"></A><A NAME="5026"></A>
<BR>
28.2.4.4 <FONT SIZE="+1">send_notify_to_user()</FONT>
</H3>
<P>
Sends a notice to a user by parsing ``user_notification'' template. The template makes a specified or a
generic treatement according to variable $param.type ( := with $operation parameter).
The message is sent by calling List::send_file() (see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
Available variables for the template are set up by this function, by $param parameter and by
List::send_file().
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12374"></A><TT>self</TT> (+): ref(List) - the list for owner notification
</LI>
<LI><A NAME="12377"></A><TT>operation</TT> (+) : notification type, corresponds to $type in the template
</LI>
<LI><A NAME="12380"></A><TT>user</TT> (+) : user email to notify
</LI>
<LI><A NAME="12383"></A><TT>param</TT> (+): ref(HASH) ref (ARRAY) - values for variable used in the template :
<UL>
<LI><I>if ref(HASH) then</I> variables used in the template are keys of this HASH.
</LI>
<LI><I>if ref(ARRAY) then</I> variables used in template are named as : $param0, $param1, $param2, ...
</LI>
</UL>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H2><A NAME="SECTION002925000000000000000">
28.2.5 Functions for topic messages</A>
</H2>
<P>
is_there_msg_topic(), is_available_msg_topic(), get_available_msg_topic(), is_msg_topic_tagging_required,
automatic_tag(), compute_topic(), tag_topic(), load_msg_topic_file(), modifying_msg_topic_for_subscribers(),
select_subscribers_for_topic().
<P>
These functions are used to manages message topics.
<BR>
<P>
N.B.: There is some exception to use some parameters : msg_topic.keywords for list parameters and topics_subscriber
for subscribers options in the DB table. These parameters are used as string splitted by ',' but to access to each one, use the function
tools::get_array_from_splitted_string() (see <A HREF="#tools-get-array-from-splitted-string">28.7</A>,
page <A HREF="node29.html#tools-get-array-from-splitted-string"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) allows to access the enumeration.
<P>
<H3><A NAME="SECTION002925100000000000000"></A>
<A NAME="list-is-there-msg-topic"></A><A NAME="5046"></A>
<BR>
28.2.5.1 <FONT SIZE="+1">is_there_msg_topic()</FONT>
</H3>
<P>
Tests if some message topic are defined (<A NAME="12386"></A><TT>msg_topic</TT> list parameter, see <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> : <A NAME="12389"></A><TT>self</TT> (+): ref(List)
<P>
<B>OUT</B> : 1 - some msg_topic are defined 0 - no msg_topic
<P>
<H3><A NAME="SECTION002925200000000000000"></A>
<A NAME="list-is-available-msg-topic"></A><A NAME="5055"></A>
<BR>
28.2.5.2 <FONT SIZE="+1">is_available_msg_topic()</FONT>
</H3>
<P>
Checks for a topic if it is available in the list :
look foreach <A NAME="12392"></A><TT>msg_topic.name</TT> list parameter (see <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12395"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12398"></A><TT>topic</TT> (+) : the name of the requested topic
</LI>
</OL>
<P>
<B>OUT</B> : <A NAME="12401"></A><TT>topic</TT> <I>if it is available</I> undef
<P>
<H3><A NAME="SECTION002925300000000000000"></A>
<A NAME="list-get-available-msg-topic"></A><A NAME="5069"></A>
<BR>
28.2.5.3 <FONT SIZE="+1">get_available_msg_topic()</FONT>
</H3>
<P>
Returns an array of available message topics (<A NAME="12404"></A><TT>msg_topic.name</TT> list parameter, see <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> : <A NAME="12407"></A><TT>self</TT> (+): ref(List)
<P>
<B>OUT</B> : ref(ARRAY)
<P>
<H3><A NAME="SECTION002925400000000000000"></A>
<A NAME="list-is-msg-topic-tagging-required"></A><A NAME="5078"></A>
<BR>
28.2.5.4 <FONT SIZE="+1">is_msg_topic_tagging_required()</FONT>
</H3>
<P>
Returns if the message must be tagged or not (<A NAME="12410"></A><TT>msg_topic_tagging</TT> list parameter set to 'required', see <A HREF="#msg-topic-tagging"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic-tagging"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> : <A NAME="12413"></A><TT>self</TT> (+): ref(List)
<P>
<B>OUT</B> : 1 - the message must be tagged 0 - the msg can be no tagged
<P>
<H3><A NAME="SECTION002925500000000000000"></A>
<A NAME="list-automatic-tag"></A><A NAME="5087"></A>
<BR>
28.2.5.5 <FONT SIZE="+1">automatic_tag()</FONT>
</H3>
<P>
Computes topic(s) (with compute_topic() function) and tags the message (with tag_topic() function) if there are some topics defined.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12416"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12419"></A><TT>msg</TT> (+): ref(MIME::Entity)- the message to tag
</LI>
<LI><A NAME="12422"></A><TT>robot</TT> (+): robot
</LI>
</OL>
<P>
<B>OUT</B> : list of tagged topic : strings separated by ','. It can be empty. undef
<P>
<H3><A NAME="SECTION002925600000000000000"></A>
<A NAME="list-compute-topic"></A><A NAME="5097"></A>
<BR>
28.2.5.6 <FONT SIZE="+1">compute_topic()</FONT>
</H3>
<P>
Computes topic(s) of the message. If the message is in a thread, topic is got from the previous message else topic is got from
applying a regexp on the subject and/or the body of the message (<A NAME="12425"></A><TT>msg_topic_keywords_apply_on</TT> list parameter,
see<A HREF="#msg-topic-keywords-apply-on"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic-keywords-apply-on"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). Regexp is based on <A NAME="12428"></A><TT>msg_topic.keywords</TT>
list parameters (See <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#msg-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12431"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12434"></A><TT>msg</TT> (+): ref(MIME::Entity)- the message to tag
</LI>
</OL>
<P>
<B>OUT</B> : list of computed topic : strings separated by ','. It can be empty.
<P>
<H3><A NAME="SECTION002925700000000000000"></A>
<A NAME="list-tag-topic"></A><A NAME="5112"></A>
<BR>
28.2.5.7 <FONT SIZE="+1">tag_topic()</FONT>
</H3>
<P>
Tags the message by creating its topic information file in the <A NAME="12437"></A><TT>/home/sympa/spool/topic/</TT> spool.
The file contains the topic list and the method used to tag the message. Here is the format :<PRE>
TOPIC topicname,...
METHOD editor|sender|auto
</PRE>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12440"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12443"></A><TT>msg_id</TT> (+): string - the message ID of the message to tag
</LI>
<LI><A NAME="12446"></A><TT>topic_list</TT> (+): the list of topics (strings splitted by ',')
</LI>
<LI><A NAME="12449"></A><TT>method</TT> (+): 'auto' 'editor''sender' - the method used for tagging
</LI>
</OL>
<P>
<B>OUT</B> : name of the created topic information file (<A NAME="12452"></A><TT>directory/listname.msg_id</TT>) undef
<P>
<H3><A NAME="SECTION002925800000000000000"></A>
<A NAME="list-load-msg-topic-file"></A><A NAME="5129"></A>
<BR>
28.2.5.8 <FONT SIZE="+1">load_msg_topic_file()</FONT>
</H3>
<P>
Search and load msg topic file corresponding to the message ID (<A NAME="12455"></A><TT>directory/listname.msg_id</TT>). It returns information contained inside.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12458"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12461"></A><TT>msg_id</TT> (+): the message ID
</LI>
<LI><A NAME="12464"></A><TT>robot</TT> (+): the robot
</LI>
</OL>
<P>
<B>OUT</B> : undef ref(HASH), keys are :
<UL>
<LI><A NAME="12467"></A><TT>topic</TT> : list of topics (strings separated by ',')
</LI>
<LI><A NAME="12470"></A><TT>method</TT> : 'auto' 'editor''sender' - the method used for tagging
</LI>
<LI><A NAME="12473"></A><TT>msg_id</TT> : message ID of the tagged message
</LI>
<LI><A NAME="12476"></A><TT>filename</TT> : name of the file
</LI>
</UL>
<P>
<H3><A NAME="SECTION002925900000000000000"></A>
<A NAME="list-modifying-msg-topic-for-subscribers"></A><A NAME="5146"></A>
<BR>
28.2.5.9 <FONT SIZE="+1">modifying_msg_topic_for_subscribers()</FONT>
</H3>
<P>
Deletes topics of subscriber that does not exist anymore
and send a notify to concerned subscribers.
(Makes a diff on msg_topic parameter between the list configuration before modification
and a new state by calling tools::diff_on_arrays() function, see <A HREF="#tools-diff-on-arrays">28.7</A>,
page <A HREF="node29.html#tools-diff-on-arrays"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). This function is used by wwsympa::do_edit_list().
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12479"></A><TT>self</TT> (+): ref(List) - the concerned list before modification
</LI>
<LI><A NAME="12482"></A><TT>new_msg_topic</TT> (+) : ref(ARRAY) - new state of msg_topic parameters
</LI>
</OL>
<P>
<B>OUT</B> :
<OL>
<LI>1 <I>if some subscriber topics have been deleted</I>
</LI>
<LI>0 <I>else</I>
</LI>
</OL>
<P>
<H3><A NAME="SECTION0029251000000000000000"></A>
<A NAME="list-select-subscriber-for-topic"></A><A NAME="5161"></A>
<BR>
28.2.5.10 <FONT SIZE="+1">select_subscribers_for_topic()</FONT>
</H3>
<P>
Selects subscribers that are subscribed to one or more topic
appearing in the topic list incoming when their reception mode is 'mail', and selects the other subscribers
(reception mode different from 'mail'). This function is used by List::send_msg() function during message
diffusion (see <A HREF="#list-send-msg">28.2.1</A>, page <A HREF="node29.html#list-send-msg"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A> ).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12485"></A><TT>self</TT> (+): ref(List)
</LI>
<LI><A NAME="12488"></A><TT>string_topic</TT> (+): string splitted by ',' - the topic list
</LI>
<LI><A NAME="12491"></A><TT>subscribers</TT> (+): ref(ARRAY) - list of subscriber emails
</LI>
</OL>
<P>
<B>OUT</B> : ARRAY - list of selected subscribers
<P>
<H2><A NAME="SECTION002926000000000000000"></A>
<A NAME="list-scenario-evaluation"></A>
<BR>
28.2.6 Scenario evaluation
</H2>
<P>
The following function is used to evaluate scenario file ``<TT><</TT>action<TT>></TT>.<TT><</TT>parameter_value<TT>></TT>'',
where <TT><</TT>action<TT>></TT>action corresponds to a configuration parameter for an action and
<TT><</TT>parameter_value<TT>></TT> corresponds to its value.
<P>
<H3><A NAME="SECTION002926100000000000000">
28.2.6.1 <FONT SIZE="+1">request_action()</FONT></A>
</H3>
Return the action to perform for one sender
using one authentication method to perform an operation
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12494"></A><TT>operation</TT> (+): SCALAR - the requested action corresponding to config parameter
</LI>
<LI><A NAME="12497"></A><TT>auth_method</TT> (+): 'smtp''md5''pgp''smime'
</LI>
<LI><A NAME="12500"></A><TT>robot</TT> (+): robot
</LI>
<LI><A NAME="12503"></A><TT>context</TT> (): ref(HASH) - contains value to instantiate scenario variables (hash keys)
</LI>
<LI><A NAME="12506"></A><TT>debug</TT> (): boolean - <I>if true</I> adds keys 'condition' and 'auth_method' to the returned hash.
</LI>
</OL>
<P>
<B>OUT</B> : undef ref(HASH) with keys :
<UL>
<LI>action : 'do_it''reject''request_auth''owner''editor''editorkey''listmaster'
</LI>
<LI>reason : 'value' <I>if action == 'reject' in scenario and if there is reject(reason='value')</I> to match a key in
mail_tt2/authorization_reject.tt2. This is used in errors reports (see <A HREF="#report.pm"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#report.pm"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>tt2 : template name if action == 'reject' in scenario and there is reject(tt2='template_name').
</LI>
<LI>condition : the checked condition.
</LI>
<LI>auth_method : the checked auth_method.
</LI>
</UL>
<P>
<H2><A NAME="SECTION002927000000000000000">
28.2.7 Structure and access to list configuration parameters</A>
</H2>
<P>
List parameters are representated in the list configuration file, in the list object (<A NAME="12509"></A><TT>list->{'admin'}</TT>)
and on the Web interface. Here are translation and access functions :
<P>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">other (3)</TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">(1)<!-- MATH
$\longrightarrow$
-->
</TD>
<TD></TD>
<TD ALIGN="CENTER">(5)<!-- MATH
$\longrightarrow$
-->
</TD>
<TD ALIGN="CENTER"> </TD>
</TR>
<TR><TD ALIGN="CENTER">CONFIG FILE</TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">LIST OBJECT</TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">WEB INTERFACE</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"><!-- MATH
$\longleftarrow$
-->
(2)</TD>
<TD ALIGN="CENTER">(4)</TD>
<TD ALIGN="CENTER"><!-- MATH
$\longleftarrow$
-->
(6)</TD>
<TD ALIGN="CENTER"> </TD>
</TR>
</TABLE>
<P>
<OL>
<LI>Loading file in memory : <PRE> List::_load_admin_file(),_load_include_admin_user_file(),_load_list_param()
</PRE>
</LI>
<LI>Saving list configuration in file : <PRE> List::_save_admin_file(),_save_list_param()
</PRE>
</LI>
<LI>Tools to get parameter values : <PRE> List::get_param_value(),_get_param_value_anywhere(),_get_single_param_value()
</PRE>
</LI>
<LI>Tools to initialize list parameter with defaults :<PRE> List::_apply_default()
</PRE>
</LI>
<LI>To present list parameters on the web interface : <PRE> wwsympa::do_edit_list_request(),_prepare_edit_form(),_prepare_data()
</PRE>
</LI>
<LI>To get updates on list parameters from the web interface : <PRE> wwsympa::do_edit_list(),_check_new_value
</PRE>
</LI>
</OL>
<P>
List parameters can be simple or composed in paragraph, they can be unique or multiple and they can singlevalued or multivalued. Here are the different kinds
of parameters and an exemple :
<P>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=2>parameters</TD>
<TD ALIGN="CENTER">SIMPLE</TD>
<TD ALIGN="CENTER">COMPOSED</TD>
</TR>
<TR><TD ALIGN="CENTER">SINGLE</TD>
<TD ALIGN="CENTER">singlevalued</TD>
<TD ALIGN="CENTER">(a)</TD>
<TD ALIGN="CENTER">(b)</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"><I>lang</I></TD>
<TD ALIGN="CENTER"><I>archiv.period</I></TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">multivalued</TD>
<TD ALIGN="CENTER">(c)</TD>
<TD ALIGN="CENTER">(d)</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"><I>topics</I></TD>
<TD ALIGN="CENTER"><I>available_user_option.reception</I></TD>
</TR>
<TR><TD ALIGN="CENTER">MULTIPLE</TD>
<TD ALIGN="CENTER">singlevalued</TD>
<TD ALIGN="CENTER">(e)</TD>
<TD ALIGN="CENTER">(f)</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER"><I>include_list</I></TD>
<TD ALIGN="CENTER"><I>owner.email</I></TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="CENTER">multi values</TD>
<TD ALIGN="CENTER">not defined</TD>
<TD ALIGN="CENTER">not defined</TD>
</TR>
</TABLE>
<P>
Here are these list parameters format in list configuration file in front of perl representation in memory :
<P>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">List Configuration FILE</TD>
<TD ALIGN="LEFT"><A NAME="12512"></A><TT>$list->{'admin'}</TT></TD>
</TR>
<TR><TD ALIGN="CENTER">(a)</TD>
<TD ALIGN="LEFT">param value</TD>
<TD ALIGN="LEFT">'scalar'</TD>
</TR>
<TR><TD ALIGN="CENTER">(b)</TD>
<TD ALIGN="LEFT">param</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p1 val1</TD>
<TD ALIGN="LEFT">'HASHscalar'</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p2 val2</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER">(c)</TD>
<TD ALIGN="LEFT">param val1,val2,val3</TD>
<TD ALIGN="LEFT">'ARRAY(scalar & split_char)'</TD>
</TR>
<TR><TD ALIGN="CENTER">(d)</TD>
<TD ALIGN="LEFT">param</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p1 val11, val12, val13</TD>
<TD ALIGN="LEFT">'HASHARRAY(scalar & split_char)'</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p2 val21, val22, val23</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER">(e)</TD>
<TD ALIGN="LEFT">param val1</TD>
<TD ALIGN="LEFT">'ARRAY(scalar)'</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">param val2</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER">(d)</TD>
<TD ALIGN="LEFT">param</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p1 val11</TD>
<TD ALIGN="LEFT">'ARRAY(HASHscalar)'</TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p2 val12</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">param</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p1 val21</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="CENTER"> </TD>
<TD ALIGN="LEFT">p2 val22</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
</TABLE>
<P>
<H1><A NAME="SECTION002930000000000000000"></A>
<A NAME="5236"></A>
<BR>
28.3 sympa.pl
</H1>
<P>
This is the main script ; it runs as a daemon and does the messages/commands processing. It uses these funstions :
DoFile(), DoMessage(), DoCommand(), DoSendMessage(), DoForward(), SendDigest(), CleanSpool(), sigterm(), sighup().
<P>
Concerning reports about message distribution, function List::send_file()
(see <A HREF="#list-send-file">28.2.2</A>, page <A HREF="node29.html#list-send-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) or List::send_global_file()
(see <A HREF="#list-send-global-file">28.2.2</A>, page <A HREF="node29.html#list-send-global-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) is called with
mail template ``message_report''. Concernong reports about commands, it is the mail template
``command_report''.
<P>
<H3><A NAME="SECTION002930100000000000000"></A>
<A NAME="sympa-dofile"></A><A NAME="5243"></A>
<BR>
28.3.0.1 <FONT SIZE="+1">DoFile()</FONT>
</H3>
<P>
Handles a received file : function called by the sympa.pl main loop in order to process files
contained in the queue spool. The file is encapsulated in a Message object not to alter it. Then
the file is read, the header and the body of the message are separeted. Then the adequate function
is called whether a command has been received or a message has to be redistributed to a list.
<P>
So this function can call various functions :
<UL>
<LI>sympa::DoMessage() for message distribution (see <A HREF="#sympa-domessage">28.3</A>, page <A HREF="node29.html#sympa-domessage"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>sympa::DoCommand() for command processing (see <A HREF="#sympa-docommand">28.3</A>, page <A HREF="node29.html#sympa-docommand"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>sympa::DoForward() for message forwarding to administrators (see <A HREF="#sympa-doforward">28.3</A>, page <A HREF="node29.html#sympa-doforward"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>sympa::DoSendMessage() for wwsympa message sending (see <A HREF="#sympa-dosendmessage">28.3</A>, page <A HREF="node29.html#sympa-dosendmessage"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
</LI>
</UL>
About command process a report can be sent by calling List::send_global_file() (see <A HREF="#list-send-global-file">28.2.2</A>,
page <A HREF="node29.html#list-send-global-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) with template ``command_report''. For message report it is the template ``message_report''.
<P>
<B>IN</B> : <A NAME="12515"></A><TT>file</TT>(+): the file to handle
<P>
<B>OUT</B> : $status - result of the called function undef
<P>
<H3><A NAME="SECTION002930200000000000000"></A>
<A NAME="sympa-domessage"></A><A NAME="5261"></A>
<BR>
28.3.0.2 <FONT SIZE="+1">DoMessage()</FONT>
</H3>
<P>
Handles a message sent to a list (Those that can make loop and those containing a command are
rejected). This function can call various functions :
<UL>
<LI>List::distribute_msg() for distribution (see <A HREF="#list-distribute-msg">28.2.1</A>, page <A HREF="node29.html#list-distribute-msg"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>List::send_auth() for authentification or topic tagging by message sender(see <A HREF="#list-send-auth">28.2.3</A>, page <A HREF="node29.html#list-send-auth"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI>List::send_to_editor() for moderation or topic tagging by list moderator(see <A HREF="#list-send-to-editor">28.2.3</A>, page <A HREF="node29.html#list-send-to-editor"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
</LI>
<LI>List::automatic_tag() for automatic topic tagging (see <A HREF="#list-automatic-tag">28.2.5</A>, page <A HREF="node29.html#list-automatic-tag"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
</LI>
</UL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12518"></A><TT>which</TT>(+): 'list_name@domain_name - the concerned list
</LI>
<LI><A NAME="12521"></A><TT>message</TT>(+): ref(Message) - sent message
</LI>
<LI><A NAME="12524"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 <I>if everything went fine</I> in order to remove the file from the queue undef
<P>
<H3><A NAME="SECTION002930300000000000000"></A>
<A NAME="sympa-docommand"></A><A NAME="5282"></A>
<BR>
28.3.0.3 <FONT SIZE="+1">DoCommand()</FONT>
</H3>
<P>
Handles a command sent to sympa. The command is parse by calling Commands::parse() (see
<A HREF="#commands-parse">28.4.1</A>, page <A HREF="node29.html#commands-parse"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12527"></A><TT>rcpt</TT> : recepient <TT><</TT>listname<TT>></TT>-<TT><</TT>subscribeunsubscribe<TT>></TT>
</LI>
<LI><A NAME="12530"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12533"></A><TT>msg</TT>(+): ref(MIME::Entity) - message containing the command
</LI>
<LI><A NAME="12536"></A><TT>file</TT>(+): file containing the message
</LI>
</OL>
<P>
<B>OUT</B> : $success - result of Command::parse() function undef.
<P>
<H3><A NAME="SECTION002930400000000000000"></A>
<A NAME="sympa-dosendmessage"></A><A NAME="5299"></A>
<BR>
28.3.0.4 <FONT SIZE="+1">DoSendMessage()</FONT>
</H3>
<P>
Sends a message pushed in spool by another process (ex : wwsympa.fcgi) by calling function
mail::mail_forward() (see <A HREF="#mail-mail-forward">28.1.1</A>, page <A HREF="node29.html#mail-mail-forward"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12539"></A><TT>msg</TT>(+): ref(MIME::Entity)
</LI>
<LI><A NAME="12542"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002930500000000000000"></A>
<A NAME="sympa-doforward"></A><A NAME="5310"></A>
<BR>
28.3.0.5 <FONT SIZE="+1">DoForward()</FONT>
</H3>
<P>
Handles a message sent to <TT><</TT>listname<TT>></TT>-editor : the list editor, <TT><</TT>list<TT>></TT>-request : the list owner or the listmaster.
The message is forwarded according to $function by calling function
mail::mail_forward() (see <A HREF="#mail-mail-forward">28.1.1</A>, page <A HREF="node29.html#mail-mail-forward"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12545"></A><TT>name</TT>(+): list name <I>if ($function != 'listmaster')</I>
</LI>
<LI><A NAME="12548"></A><TT>function</TT>(+): 'listmaster' 'request' 'editor'
</LI>
<LI><A NAME="12551"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12554"></A><TT>msg</TT>(+): ref(MIME::Entity)
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002930600000000000000"></A>
<A NAME="sympa-sendigest"></A><A NAME="5328"></A>
<BR>
28.3.0.6 <FONT SIZE="+1">SendDigest()</FONT>
</H3>
<P>
Reads the queuedigest spool and send old digests to the subscribers with the digest option by
calling List::send_msg_digest() function mail::mail_forward() (see <A HREF="#list-send-msg-digest">28.2.1</A>,
page <A HREF="node29.html#list-send-msg-digest"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> : -
<B>OUT</B> : - undef
<P>
<H3><A NAME="SECTION002930700000000000000"></A>
<A NAME="sympa-cleanspool"></A><A NAME="5335"></A>
<BR>
28.3.0.7 <FONT SIZE="+1">CleanSpool()</FONT>
</H3>
<P>
Cleans old files from spool $spool_dir older than $clean_delay.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12557"></A><TT>spool_dir</TT>(+) : the spool directory
</LI>
<LI><A NAME="12560"></A><TT>clean_delay</TT>(+) : the delay in days
</LI>
</OL>
<P>
<B>OUT</B> : 1
<P>
<H3><A NAME="SECTION002930800000000000000"></A>
<A NAME="sympa-sigterm"></A><A NAME="5344"></A>
<BR>
28.3.0.8 <FONT SIZE="+1">sigterm()</FONT>
</H3>
<P>
This function is called when a signal -TERM is received by sympa.pl.
It just changes the value of $signal loop variable in order to stop sympa.pl after endding its message distribution
if in progress. (see <A HREF="node5.html#stop-signals">4.3</A>, page <A HREF="node5.html#stop-signals"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
<P>
<B>IN</B> : -
<B>OUT</B> : -
<P>
<H3><A NAME="SECTION002930900000000000000"></A>
<A NAME="sympa-sighup"></A><A NAME="5351"></A>
<BR>
28.3.0.9 <FONT SIZE="+1">sighup()</FONT>
</H3>
<P>
This function is called when a signal -HUP is received by sympa.pl.
It changes the value of $signal loop variable and switchs of the "-mail" (see <A HREF="node5.html#stop-signals">4.3</A>,
page <A HREF="node5.html#stop-signals"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) logging option and continues current task.
<P>
<B>IN</B> : -
<B>OUT</B> : -
<P>
<H1><A NAME="SECTION002940000000000000000"></A>
<A NAME="5357"></A>
<BR>
28.4 Commands.pm
</H1>
<P>
This module does the mail commands processing.
<P>
<H2><A NAME="SECTION002941000000000000000">
28.4.1 Commands processing</A>
</H2>
<P>
parse(), add(), del(), subscribe(), signoff(), invite(), last(), index(), getfile(), confirm(),
set(), distribute(), reject(), modindex(), review(), verify(), remind(), info(), stats(), help(),
lists(), which(), finished().
<P>
<H3><A NAME="SECTION002941100000000000000"></A>
<A NAME="commands-parse"></A><A NAME="5361"></A>
<BR>
28.4.1.1 <FONT SIZE="+1">parse()</FONT>
</H3>
<P>
Parses the command line and calls the adequate subroutine (following functions)
with the arguments of the command. This function is called by sympa::DoCommand() (see <A HREF="#sympa-docommand">28.3</A>,
page <A HREF="node29.html#sympa-docommand"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12563"></A><TT>sender</TT>(+): the command sender
</LI>
<LI><A NAME="12566"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12569"></A><TT>i</TT>(+): command line
</LI>
<LI><A NAME="12572"></A><TT>sign_mod</TT> : 'smime' undef
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_cmd' $status - command process result
<P>
<H3><A NAME="SECTION002941200000000000000"></A>
<A NAME="commands-add"></A><A NAME="5374"></A>
<BR>
28.4.1.2 <FONT SIZE="+1">add()</FONT>
</H3>
<P>
Adds a user to a list (requested by another user), and can send acknowledgements.
New subscriber can be notified by sending template 'welcome'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12575"></A><TT>what</TT>(+): command parameters : listname, email and comments eventually
</LI>
<LI><A NAME="12578"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12581"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION002941300000000000000"></A>
<A NAME="commands-del"></A><A NAME="5384"></A>
<BR>
28.4.1.3 <FONT SIZE="+1">del()</FONT>
</H3>
<P>
Removes a user to a list (requested by another user), and can send acknowledgements.
Unsubscriber can be notified by sending template 'removed'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12584"></A><TT>what</TT>(+): command parameters : listname and email
</LI>
<LI><A NAME="12587"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12590"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 'not_allowed' 1
<P>
<H3><A NAME="SECTION002941400000000000000"></A>
<A NAME="commands-subscribe"></A><A NAME="5394"></A>
<BR>
28.4.1.4 <FONT SIZE="+1">subscribe()</FONT>
</H3>
<P>
Subscribes a user to a list. New subscriber can be notified by sending him template 'welcome'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12593"></A><TT>what</TT>(+): command parameters : listname and comments eventually
</LI>
<LI><A NAME="12596"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12599"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION002941500000000000000"></A>
<A NAME="commands-signoff"></A><A NAME="5404"></A>
<BR>
28.4.1.5 <FONT SIZE="+1">signoff()</FONT>
</H3>
<P>
Unsubscribes a user from a list. He can be notified by sending him template 'bye'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12602"></A><TT>which</TT>(+): command parameters : listname and email
</LI>
<LI><A NAME="12605"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12608"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'syntax_error' 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION002941600000000000000"></A>
<A NAME="commands-invite"></A><A NAME="5414"></A>
<BR>
28.4.1.6 <FONT SIZE="+1">invite()</FONT>
</H3>
<P>
Invites someone to subscribe to a list by sending him the template 'invite'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12611"></A><TT>what</TT>(+): command parameters : listname, email and comments
</LI>
<LI><A NAME="12614"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12617"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION002941700000000000000"></A>
<A NAME="commands-last"></A><A NAME="5424"></A>
<BR>
28.4.1.7 <FONT SIZE="+1">last()</FONT>
</H3>
<P>
Sends back the last archive file by calling List::archive_send() function
(see <A HREF="#list-archive-send">28.2.3</A>, page <A HREF="node29.html#list-archive-send"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12620"></A><TT>which</TT>(+): listname
</LI>
<LI><A NAME="12623"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'no_archive' 'not_allowed' 1
<P>
<H3><A NAME="SECTION002941800000000000000"></A>
<A NAME="commands-index"></A><A NAME="5435"></A>
<BR>
28.4.1.8 <FONT SIZE="+1">index()</FONT>
</H3>
<P>
Sends the list of archived files of a list.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12626"></A><TT>which</TT>(+): listname
</LI>
<LI><A NAME="12629"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'no_archive' 'not_allowed' 1
<P>
<H3><A NAME="SECTION002941900000000000000"></A>
<A NAME="commands-last"></A><A NAME="5444"></A>
<BR>
28.4.1.9 <FONT SIZE="+1">getfile()</FONT>
</H3>
<P>
Sends back the requested archive file by calling List::archive_send() function
(see <A HREF="#list-archive-send">28.2.3</A>, page <A HREF="node29.html#list-archive-send"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12632"></A><TT>which</TT>(+): commands parameters : listname and filename(archive file)
</LI>
<LI><A NAME="12635"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'no_archive' 'not_allowed' 1
<P>
<H3><A NAME="SECTION0029411000000000000000"></A>
<A NAME="commands-confirm"></A><A NAME="5455"></A>
<BR>
28.4.1.10 <FONT SIZE="+1">confirm()</FONT>
</H3>
<P>
Confirms the authentification of a message for its distribution on a list by calling function
List::distribute_msg() for distribution (see <A HREF="#list-distribute-msg">28.2.1</A>, page <A HREF="node29.html#list-distribute-msg"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
or by calling List::send_to_editor() for moderation (see <A HREF="#list-send-editor"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#list-send-editor"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12638"></A><TT>what</TT>(+): authentification key (command parameter)
</LI>
<LI><A NAME="12641"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'wrong_auth' 'msg_not_found' 1 undef
<P>
<H3><A NAME="SECTION0029411100000000000000"></A>
<A NAME="commands-set"></A><A NAME="5468"></A>
<BR>
28.4.1.11 <FONT SIZE="+1">set()</FONT>
</H3>
<P>
Changes subscription options (reception or visibility)
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12644"></A><TT>what</TT>(+): command parameters : listname and
reception mode (digestdigestplainnomailnormal...) or visibility mode(concealnoconceal).
</LI>
<LI><A NAME="12647"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'syntax_error' 'unknown_list' 'not_allowed' 'failed' 1
<P>
<H3><A NAME="SECTION0029411200000000000000"></A>
<A NAME="commands-distribute"></A><A NAME="5477"></A>
<BR>
28.4.1.12 <FONT SIZE="+1">distribute()</FONT>
</H3>
<P>
Distributes the broadcast of a validated moderated message.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12650"></A><TT>what</TT>(+): command parameters : listname and authentification key
</LI>
<LI><A NAME="12653"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'msg_not_found' 1 undef
<P>
<H3><A NAME="SECTION0029411300000000000000"></A>
<A NAME="commands-reject"></A><A NAME="5486"></A>
<BR>
28.4.1.13 <FONT SIZE="+1">reject()</FONT>
</H3>
<P>
Refuses and deletes a moderated message. Rejected message sender can be notified by sending him template 'reject'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12656"></A><TT>what</TT>(+): command parameters : listname and authentification key
</LI>
<LI><A NAME="12659"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 1 undef
<P>
<H3><A NAME="SECTION0029411400000000000000"></A>
<A NAME="commands-modindex"></A><A NAME="5495"></A>
<BR>
28.4.1.14 <FONT SIZE="+1">modindex()</FONT>
</H3>
<P>
Sends a list of current messages to moderate of a list (look into spool queuemod)
by using template 'modindex'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12662"></A><TT>name</TT>(+): listname
</LI>
<LI><A NAME="12665"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'not_allowed' 'no_file' 1
<P>
<H3><A NAME="SECTION0029411500000000000000"></A>
<A NAME="commands-review"></A><A NAME="5504"></A>
<BR>
28.4.1.15 <FONT SIZE="+1">review()</FONT>
</H3>
<P>
Sends the list of subscribers of a list to the requester by using template 'review'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12668"></A><TT>listname</TT>(+): list name
</LI>
<LI><A NAME="12671"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12674"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' wrong_auth no_subscribers 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION0029411600000000000000"></A>
<A NAME="commands-verify"></A><A NAME="5514"></A>
<BR>
28.4.1.16 <FONT SIZE="+1">verify()</FONT>
</H3>
<P>
Verifies an S/MIME signature.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12677"></A><TT>listname</TT>(+): list name
</LI>
<LI><A NAME="12680"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12683"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 1
<P>
<H3><A NAME="SECTION0029411700000000000000"></A>
<A NAME="commands-remind"></A><A NAME="5524"></A>
<BR>
28.4.1.17 <FONT SIZE="+1">remind()</FONT>
</H3>
<P>
Sends a personal reminder to each subscriber of a list or of every list (if $which = *)
using template 'remind' or 'global_remind'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12686"></A><TT>which</TT>(+): * listname
</LI>
<LI><A NAME="12689"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12692"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'syntax_error' 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION0029411800000000000000"></A>
<A NAME="commands-info"></A><A NAME="5534"></A>
<BR>
28.4.1.18 <FONT SIZE="+1">info()</FONT>
</H3>
<P>
Sends the list information file to the requester by using template 'info_report'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12695"></A><TT>listname</TT>(+): name of concerned list
</LI>
<LI><A NAME="12698"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12701"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'wrong_auth' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION0029411900000000000000"></A>
<A NAME="commands-stats"></A><A NAME="5544"></A>
<BR>
28.4.1.19 <FONT SIZE="+1">stats()</FONT>
</H3>
<P>
Sends the statistics about a list using template 'stats_report'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12704"></A><TT>listname</TT>(+): list name
</LI>
<LI><A NAME="12707"></A><TT>robot</TT>(+): robot
</LI>
<LI><A NAME="12710"></A><TT>sign_mod</TT> : 'smime' undef - authentification
</LI>
</OL>
<P>
<B>OUT</B> : 'unknown_list' 'not_allowed' 1 undef
<P>
<H3><A NAME="SECTION0029412000000000000000"></A>
<A NAME="commands-help"></A><A NAME="5554"></A>
<BR>
28.4.1.20 <FONT SIZE="+1">help()</FONT>
</H3>
<P>
Sends the help file for the software by using template 'helpfile'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12713"></A> : ?
</LI>
<LI><A NAME="12716"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION0029412100000000000000"></A>
<A NAME="commands-lists"></A><A NAME="5563"></A>
<BR>
28.4.1.21 <FONT SIZE="+1">lists()</FONT>
</H3>
<P>
Sends back the list of public lists on this node by using template 'lists'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12719"></A> : ?
</LI>
<LI><A NAME="12722"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION0029412200000000000000"></A>
<A NAME="commands-lists"></A><A NAME="5572"></A>
<BR>
28.4.1.22 <FONT SIZE="+1">which()</FONT>
</H3>
<P>
Sends back the list of lists that sender is subscribed to. If he is owner or
editor, managed lists are noticed. Message is sent by using template 'which'.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12725"></A> : ?
</LI>
<LI><A NAME="12728"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> : 1
<P>
<H3><A NAME="SECTION0029412300000000000000"></A>
<A NAME="commands-finished"></A><A NAME="5581"></A>
<BR>
28.4.1.23 <FONT SIZE="+1">finished()</FONT>
</H3>
<P>
Called when 'quit' command is found. It sends a notification to sender : no
process will be done after this line.
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : 1
<P>
<H2><A NAME="SECTION002942000000000000000">
28.4.2 tools for command processing</A>
</H2>
<P>
get_auth_method()
<P>
<H3><A NAME="SECTION002942100000000000000"></A>
<A NAME="commands-get-auth-method"></A><A NAME="5587"></A>
<BR>
28.4.2.1 <FONT SIZE="+1">get_auth_method()</FONT>
</H3>
<P>
Called by processing command functions to return the authentification method
and to check the key if it is 'md5' method.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12731"></A><TT>cmd</TT>(+): requesting command
</LI>
<LI><A NAME="12734"></A><TT>email</TT>(+): used to compute auth if needed in command
</LI>
<LI><A NAME="12737"></A><TT>error</TT>(+): ref(HASH) - keys are :
<UL>
<LI><A NAME="12740"></A><TT>type</TT> : $type for ``message_report'' template parsing
</LI>
<LI><A NAME="12743"></A><TT>data</TT> : ref(HASH) for ``message_report'' template parsing
</LI>
<LI><A NAME="12746"></A><TT>msg</TT> : for do_log()
</LI>
</UL>
</LI>
<LI><A NAME="12749"></A><TT>sign_mod</TT>(+): 'smime' - smime authentification undef - smtp or md5 authentification
</LI>
<LI><A NAME="12752"></A><TT>list</TT>: ref(List) undef - in a list context or not
</LI>
</OL>
<B>OUT</B> : 'smime' 'md5' 'smtp' - authentification method if checking not failed undef
<P>
<H1><A NAME="SECTION002950000000000000000"></A>
<A NAME="5603"></A>
<BR>
28.5 wwsympa.fcgi
</H1>
<P>
This script provides the web interface to <I>Sympa</I>.
<P>
do_subscribe(), do_signoff(), do_add(), do_del(), do_change_email(), do_reject(),
do_send_mail(), do_sendpasswd(), do_remind(), do_set(), do_send_me(), do_request_topic(),
do_tag_topic_by_sender().
<P>
<H3><A NAME="SECTION002950100000000000000"></A>
<A NAME="wwsympa-do-subscribe"></A><A NAME="5606"></A>
<BR>
28.5.0.1 <FONT SIZE="+1">do_subscribe()</FONT>
</H3>
<P>
Subscribes a user to a list. New subscriber can be notified
by sending him template 'welcome'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'subrequest' 'login' 'info' $in.previous_action undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950200000000000000"></A>
<A NAME="wwsympa-do-signoff"></A><A NAME="5613"></A>
<BR>
28.5.0.2 <FONT SIZE="+1">do_signoff()</FONT>
</H3>
<P>
Unsubscribes a user from a list. The unsubscriber can be notified
by sending him template 'bye'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'sigrequest' 'login' 'info' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950300000000000000"></A>
<A NAME="wwsympa-do-add"></A><A NAME="5620"></A>
<BR>
28.5.0.3 <FONT SIZE="+1">do_add()</FONT>
</H3>
<P>
Adds a user to a list (requested by another user) and can send acknowledgements.
New subscriber can be notified by sending him template 'welcome'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' ($in.previous_action 'review') undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950400000000000000"></A>
<A NAME="wwsympa-do-del"></A><A NAME="5627"></A>
<BR>
28.5.0.4 <FONT SIZE="+1">do_del()</FONT>
</H3>
<P>
Removes a user from a list (requested by another user) and can send acknowledgements.
Unsubscriber can be notified by sending template 'removed'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' ($in.previous_action 'review') undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950500000000000000"></A>
<A NAME="wwsympa-do-change-email"></A><A NAME="5634"></A>
<BR>
28.5.0.5 <FONT SIZE="+1">do_change_email()</FONT>
</H3>
<P>
Changes a user's email address in <I>Sympa</I> environment. Password can be send to user by sending
template 'sendpasswd'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : '1' 'pref' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950600000000000000"></A>
<A NAME="wwsympa-do-reject"></A><A NAME="5641"></A>
<BR>
28.5.0.6 <FONT SIZE="+1">do_reject()</FONT>
</H3>
<P>
Refuses and deletes moderated messages. Rejected message senders are notified by
sending them template 'reject'.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'modindex' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950700000000000000"></A>
<A NAME="wwsympa-do-distribute"></A><A NAME="5648"></A>
<BR>
28.5.0.7 <FONT SIZE="+1">do_distribute()</FONT>
</H3>
<P>
Distributes moderated messages by sending a command DISTRIBUTE to sympa.pl. For it, it calls mail::mail_file()
(see <A HREF="#mail-mail-file">28.1.1</A>, page <A HREF="node29.html#mail-mail-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). As it is in a Web context, the message will be
set in spool. In a context of message topic, tags the message by calling to function List::tag_topic()
(see <A HREF="#list-tag-topic">28.2.5</A>, page <A HREF="node29.html#list-tag-topic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'modindex' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950800000000000000"></A>
<A NAME="wwsympa-do-modindex"></A><A NAME="5659"></A>
<BR>
28.5.0.8 <FONT SIZE="+1">do_modindex()</FONT>
</H3>
<P>
Allows a moderator to moderate a list of messages and documents and/or tag message in message topic context.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'admin' 1 undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION002950900000000000000"></A>
<A NAME="wwsympa-do-viewmod"></A><A NAME="5666"></A>
<BR>
28.5.0.9 <FONT SIZE="+1">do_viewmod()</FONT>
</H3>
<P>
Allows a moderator to moderate a message and/or tag message in message topic context.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 1 undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501000000000000000"></A>
<A NAME="wwsympa-do-send-mail"></A><A NAME="5673"></A>
<BR>
28.5.0.10 <FONT SIZE="+1">do_send_mail()</FONT>
</H3>
<P>
Sends a message to a list by the Web interface.
It uses mail::mail_file() (see <A HREF="#mail-mail-file">28.1.1</A>, page <A HREF="node29.html#mail-mail-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
to do it. As it is in a Web context, the message will be set in spool.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'info' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501100000000000000"></A>
<A NAME="wwsympa-do-sendpasswd"></A><A NAME="5682"></A>
<BR>
28.5.0.11 <FONT SIZE="+1">do_sendpasswd()</FONT>
</H3>
<P>
Sends a message to a user, containing his password, by sending him template 'sendpasswd' list by the Web interface.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'info' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501200000000000000"></A>
<A NAME="wwsympa-do-request-topic__"></A><A NAME="5689"></A>
<BR>
28.5.0.12 <FONT SIZE="+1">do_request_topic()</FONT>
</H3>
<P>
Allows a sender to tag his mail in message topic context.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 1 undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501300000000000000"></A>
<A NAME="wwsympa-do-tag-topic-by-sender__"></A><A NAME="5696"></A>
<BR>
28.5.0.13 <FONT SIZE="+1">do_tag_topic_by_sender()</FONT>
</H3>
<P>
Tags a message by its sender by calling List::tag_topic() and allows its diffusion by sending a command CONFIRM
to sympa.pl.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'info' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501400000000000000"></A>
<A NAME="wwsympa-do-remind"></A><A NAME="5703"></A>
<BR>
28.5.0.14 <FONT SIZE="+1">do_remind()</FONT>
</H3>
<P>
Sends a command remind to sympa.pl by calling mail::mail_file() (see <A HREF="#mail-mail-file">28.1.1</A>,
page <A HREF="node29.html#mail-mail-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). As it is in a Web context, the message will be set in spool.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'admin' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501500000000000000"></A>
<A NAME="wwsympa-do-set"></A><A NAME="5712"></A>
<BR>
28.5.0.15 <FONT SIZE="+1">do_set()</FONT>
</H3>
<P>
Changes subscription options (reception or visibility)
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'loginrequest' 'info' undef
</LI>
</UL>
<P>
<H3><A NAME="SECTION0029501600000000000000"></A>
<A NAME="wwsympa-do-send-me"></A><A NAME="5719"></A>
<BR>
28.5.0.16 <FONT SIZE="+1">do_send_me()</FONT>
</H3>
<P>
Sends a web archive message to a requesting user It calls mail::mail_forward() to do it
(see <A HREF="#mail-mail-forward">28.1.1</A>, page <A HREF="node29.html#mail-mail-forward"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). As it is in a Web context,
the message will be set in spool.
<UL>
<LI><B>IN</B> : -
</LI>
<LI><B>OUT</B> : 'arc' 1 undef
</LI>
</UL>
<P>
<H1><A NAME="SECTION002960000000000000000"></A>
<A NAME="5727"></A>
<BR>
28.6 report.pm
</H1>
<P>
This module provides various tools for notification and error reports in every Sympa interface
(mail diffusion, mail command and web command).
<P>
For a requested service, there are four kinds of reports to users:
<UL>
<LI><B>success notification</B>
<BR>
when the action does not involve any specific mail report or else,
the user is notified of the well done of the processus.
</LI>
<LI><B>non authorization</B><A NAME="12757"></A><TT>(auth)</TT>
<BR>
a user is not allowed to perform an action, Sympa provides reason of rejecting.
The template used to provides this information is <A NAME="12760"></A><TT>mail_tt2/authorization_reject.tt2</TT>. It contains a list of reasons, indexed
by keywords that are mentioned in reject action scenario (see <A HREF="node14.html#rules">13.1</A>, page <A HREF="node14.html#rules"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
</LI>
<LI><B>user error</B><A NAME="12763"></A><TT>(user)</TT>
<BR>
a error caused by the user, the user is informed about the error reason
</LI>
<LI><B>internal server error</B><A NAME="12766"></A><TT>(intern)</TT>
<BR>
an error independent from the user, the user is succintly informed
about the error reason but a mail with more information is sent to listmaster using template
<A NAME="12769"></A><TT>mail_tt2/listmaster_notification.tt2</TT>(If it is not necessary, keyword used is <A NAME="12772"></A><TT>'intern_quiet'</TT>.
</LI>
</UL>
<P>
For other reports than non authorizations templates used depends on the interface :
<UL>
<LI>message diffusion : <A NAME="12775"></A><TT>mail_tt2/message_report.tt2</TT>
</LI>
<LI>mail commands : <A NAME="12778"></A><TT>mail_tt2/command_report.tt2</TT>
</LI>
<LI>web commands : <A NAME="12781"></A><TT>web_tt2/notice.tt2</TT> for positive notifications and <A NAME="12784"></A><TT>web_tt2/error.tt2</TT> for rejects.
</LI>
</UL>
<P>
<H2><A NAME="SECTION002961000000000000000"></A>
<A NAME="report-message-diffusion"></A>
<BR>
28.6.1 Message diffusion
</H2>
<P>
These reports use template <A NAME="12787"></A><TT>mail_tt2/message_report.tt2</TT> and there are two functions :
<A NAME="12790"></A><TT>reject_report_msg()</TT> and <A NAME="12793"></A><TT>notice_report_msg()</TT>.
<P>
<H3><A NAME="SECTION002961100000000000000"></A>
<A NAME="report-reject-report-msg"></A><A NAME="5755"></A>
<BR>
28.6.1.1 <FONT SIZE="+1">reject_report_msg()</FONT>
</H3>
<P>
Sends a notification to the user about an error rejecting his requested message diffusion.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12796"></A><TT>type</TT>(+): 'intern''intern_quiet''user''auth' - the error type
</LI>
<LI><A NAME="12799"></A><TT>error</TT>: SCALAR - depends on $type :
<UL>
<LI>'intern' : string error sent to listmaster
</LI>
<LI>'user' : $entry in <A NAME="12802"></A><TT>message_report.tt2</TT>
</LI>
<LI>'auth' : $reason in <A NAME="12805"></A><TT>authorization_reject.tt2</TT>
</LI>
</UL>
</LI>
<LI><A NAME="12808"></A><TT>user</TT>(+): SCALAR - the user to notify
</LI>
<LI><A NAME="12811"></A><TT>param</TT>: ref(HASH) - for variable instantiation <A NAME="12814"></A><TT>message_report.tt2</TT>
(key <A NAME="12817"></A><TT>msgid</TT>(+) is required <I>if type == 'intern'</I>)
</LI>
<LI><A NAME="12820"></A><TT>robot</TT>: SCALAR - robot
</LI>
<LI><A NAME="12823"></A><TT>msg_string</TT>: SCALAR - rejected message
</LI>
<LI><A NAME="12826"></A><TT>list</TT>: ref(List) - in a list context
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002961200000000000000"></A>
<A NAME="report-reject-report-msg"></A><A NAME="5776"></A>
<BR>
28.6.1.2 <FONT SIZE="+1">notice_report_msg()</FONT>
</H3>
<P>
Sends a notification to the user about a success about his requested message diffusion.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12829"></A><TT>entry</TT>(+): $entry in <A NAME="12832"></A><TT>message_report.tt2</TT>
</LI>
<LI><A NAME="12835"></A><TT>user</TT>(+): SCALAR - the user to notify
</LI>
<LI><A NAME="12838"></A><TT>param</TT>: ref(HASH) - for variable instantiation <A NAME="12841"></A><TT>message_report.tt2</TT>
</LI>
<LI><A NAME="12844"></A><TT>robot</TT>(+): SCALAR - robot
</LI>
<LI><A NAME="12847"></A><TT>list</TT>: ref(List) - in a list context
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H2><A NAME="SECTION002962000000000000000"></A>
<A NAME="report-mail-commands"></A>
<BR>
28.6.2 Mail commands
</H2>
<P>
A mail can contains many commands. Errors and notices are stored in module global arrays before sending
(intern_error_cmd, user_error_cmd, global_error_cmd, auth_reject_cmd, notice_cmd).
Moreover used errors here we can have global errors on mail containing commands, so there is a function for that.
These reports use template <A NAME="12850"></A><TT>mail_tt2/command_report.tt2</TT> and there are many functions :
<P>
<H3><A NAME="SECTION002962100000000000000"></A>
<A NAME="report-init-report-cmd"></A><A NAME="5793"></A>
<BR>
28.6.2.1 <FONT SIZE="+1">init_report_cmd()</FONT>
</H3>
<P>
Inits global arrays for mail command reports.
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : -
<P>
<H3><A NAME="SECTION002962200000000000000"></A>
<A NAME="report-is-there-any-report-cmd"></A><A NAME="5798"></A>
<BR>
28.6.2.2 <FONT SIZE="+1">is_there_any_report_cmd()</FONT>
</H3>
<P>
Looks for some mail command reports in one of global arrays.
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : 1 <I>if there are some reports to send</I>
<P>
<H3><A NAME="SECTION002962300000000000000"></A>
<A NAME="report-send-report-cmd"></A><A NAME="5804"></A>
<BR>
28.6.2.3 <FONT SIZE="+1">global_report_cmd()</FONT>
</H3>
<P>
Concerns global reports of mail commands. There are many uses cases :
<P>
<OL>
<LI><B>internal server error</B> for a differed sending at the end of the mail processing :
<UL>
<LI><A NAME="12853"></A><TT>global_report_cmd('intern',$error,$data,$sender,$robot)</TT>
</LI>
<LI><A NAME="12856"></A><TT>global_report_cmd('intern_quiet',$error,$data)</TT> : the listmaster won't be noticied
</LI>
</UL>
</LI>
<LI><B>internal server error</B> for sending every reports directly (by calling <A NAME="12859"></A><TT>send_report_cmd()</TT>) :
<UL>
<LI><A NAME="12862"></A><TT>global_report_cmd('intern',$error,$data,$sender,$robot,1)</TT>
</LI>
<LI><A NAME="12865"></A><TT>global_report_cmd('intern_quiet',$error,$data,$sender,$robot,1)</TT> : the listmaster won't be noticied
</LI>
</UL>
</LI>
<LI><B>user error</B> for a differed sending at the end of the mail processing :
<BR> <A NAME="12868"></A><TT>global_report_cmd('user',$error,$data</TT>
</LI>
<LI><B>user error</B> for sending every reports directly (by calling <A NAME="12871"></A><TT>send_report_cmd()</TT>) :
<BR> <A NAME="12874"></A><TT>global_report_cmd('user',$error,$data,$sender,$robot,1)</TT>
</LI>
</OL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12877"></A><TT>type</TT>(+): 'intern''intern_quiet''user'
</LI>
<LI><A NAME="12880"></A><TT>error</TT>: SCALAR - depends on $type :
<UL>
<LI>'intern' : string error sent to listmaster
</LI>
<LI>'user' : $glob.entry in <A NAME="12883"></A><TT>command_report.tt2</TT>
</LI>
</UL>
</LI>
<LI><A NAME="12886"></A><TT>data</TT>: ref(HASH) - for variable instantiation in <A NAME="12889"></A><TT>command_report.tt2</TT>
</LI>
<LI><A NAME="12892"></A><TT>sender</TT>: SCALAR - the user to notify
</LI>
<LI><A NAME="12895"></A><TT>robot</TT>: SCALAR - robot
</LI>
<LI><A NAME="12898"></A><TT>now</TT>: BOOLEAN - send reports now <I>if true</I>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002962400000000000000"></A>
<A NAME="report-reject-report-cmd"></A><A NAME="5840"></A>
<BR>
28.6.2.4 <FONT SIZE="+1">reject_report_cmd()</FONT>
</H3>
<P>
Concerns reject reports of mail commands. These informations are sent at the end of the mail processing.
There are many uses cases :
<P>
<OL>
<LI><B>internal server error</B> :
<UL>
<LI><A NAME="12901"></A><TT>reject_report_cmd('intern',$error,$data,$cmd,$sender,$robot)</TT>
</LI>
<LI><A NAME="12904"></A><TT>reject_report_cmd('intern_quiet',$error,$data,$cmd)</TT> : the listmaster won't be noticied
</LI>
</UL>
</LI>
<LI><B>user error</B> :
<BR> <A NAME="12907"></A><TT>reject_report_cmd('user',$error,$data,$cmd)</TT>
</LI>
<LI><B>non authorization</B> :
<BR> <A NAME="12910"></A><TT>reject_report_cmd('auth',$error,$data,$cmd)</TT>
</LI>
</OL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12913"></A><TT>type</TT>(+): 'intern''intern_quiet''user''auth'
</LI>
<LI><A NAME="12916"></A><TT>error</TT>: SCALAR - depends on $type :
<UL>
<LI>'intern' : string error sent to listmaster
</LI>
<LI>'user' : $u_err.entry in <A NAME="12919"></A><TT>command_report.tt2</TT>
</LI>
<LI>'auth' : $reason in <A NAME="12922"></A><TT>authorization_reject.tt2</TT>
</LI>
</UL>
</LI>
<LI><A NAME="12925"></A><TT>data</TT>: ref(HASH) - for variable instantiation in <A NAME="12928"></A><TT>command_report.tt2</TT>
</LI>
<LI><A NAME="12931"></A><TT>cmd</TT>: SCALAR - the rejected command, $xx.cmd in <A NAME="12934"></A><TT>command_report.tt2</TT>
</LI>
<LI><A NAME="12937"></A><TT>sender</TT>: SCALAR - the user to notify
</LI>
<LI><A NAME="12940"></A><TT>robot</TT>: SCALAR - robot
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002962500000000000000"></A>
<A NAME="report-notice-report-cmd"></A><A NAME="5870"></A>
<BR>
28.6.2.5 <FONT SIZE="+1">notice_report_cmd()</FONT>
</H3>
<P>
Concerns positive notices of mail commands. These informations are sent at the end of the mail processing.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12943"></A><TT>entry</TT>: $notice.entry in <A NAME="12946"></A><TT>command_report.tt2</TT>
</LI>
<LI><A NAME="12949"></A><TT>data</TT>: ref(HASH) - for variable instantiation in <A NAME="12952"></A><TT>command_report.tt2</TT>
</LI>
<LI><A NAME="12955"></A><TT>cmd</TT>: SCALAR - the rejected command, $xx.cmd in <A NAME="12958"></A><TT>command_report.tt2</TT>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002962600000000000000"></A>
<A NAME="report-send-report-cmd"></A><A NAME="5883"></A>
<BR>
28.6.2.6 <FONT SIZE="+1">send_report_cmd()</FONT>
</H3>
<P>
Sends the template <A NAME="12961"></A><TT>command_report.tt2</TT> to $sender with global arrays and then calls to
<A NAME="12964"></A><TT>init_report_command.tt2</TT> function. (It is used by sympa.pl at the end of mail process if there are some reports in gloal arrays)
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12967"></A><TT>sender</TT>(+): SCALAR - the user to notify
</LI>
<LI><A NAME="12970"></A><TT>robot</TT>(+): SCALAR - robot
</LI>
</OL>
<B>OUT</B> : 1
<P>
<H2><A NAME="SECTION002963000000000000000"></A>
<A NAME="report-web-commands"></A>
<BR>
28.6.3 Web commands
</H2>
<P>
It can have many errors and notices so they are stored in module global arrays before html sending.
(intern_error_web, user_error_web, auth_reject_web, notice_web).
These reports use <A NAME="12973"></A><TT>web_tt2/notice.tt2</TT> template for notices and <A NAME="12976"></A><TT>web_tt2/error.tt2</TT> template
for rejects.
<P>
<H3><A NAME="SECTION002963100000000000000"></A>
<A NAME="report-init-report-web"></A><A NAME="5898"></A>
<BR>
28.6.3.1 <FONT SIZE="+1">init_report_web()</FONT>
</H3>
<P>
Inits global arrays for web command reports.
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : -
<P>
<H3><A NAME="SECTION002963200000000000000"></A>
<A NAME="report-is-there-any-reject-report-web"></A><A NAME="5903"></A>
<BR>
28.6.3.2 <FONT SIZE="+1">is_there_any_reject_report_web()</FONT>
</H3>
<P>
Looks for some rejected web command reports in one of global arrays for reject.
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : 1 <I>if there are some reject reports to send (not notice)</I>
<P>
<H3><A NAME="SECTION002963300000000000000"></A>
<A NAME="report-get-intern-error-web"></A><A NAME="5909"></A>
<BR>
28.6.3.3 <FONT SIZE="+1">get_intern_error_web()</FONT>
</H3>
<P>
Return array of web intern error
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : ref(ARRAY) - clone of intern_error_web
<P>
<H3><A NAME="SECTION002963400000000000000"></A>
<A NAME="report-get-user-error-web"></A><A NAME="5914"></A>
<BR>
28.6.3.4 <FONT SIZE="+1">get_user_error_web()</FONT>
</H3>
<P>
Return array of web user error
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : ref(ARRAY) - clone of user_error_web
<P>
<H3><A NAME="SECTION002963500000000000000"></A>
<A NAME="report-get-auth-reject-web"></A><A NAME="5919"></A>
<BR>
28.6.3.5 <FONT SIZE="+1">get_auth_reject_web()</FONT>
</H3>
<P>
Return array of web authorisation reject
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : ref(ARRAY) - clone of auth_reject_web
<P>
<H3><A NAME="SECTION002963600000000000000"></A>
<A NAME="report-get-notice-web"></A><A NAME="5924"></A>
<BR>
28.6.3.6 <FONT SIZE="+1">get_notice_web()</FONT>
</H3>
<P>
Return array of web notice
<P>
<B>IN</B> : -
<P>
<B>OUT</B> : ref(ARRAY) - clone of notice_web
<P>
<H3><A NAME="SECTION002963700000000000000"></A>
<A NAME="report-reject-report-web"></A><A NAME="5929"></A>
<BR>
28.6.3.7 <FONT SIZE="+1">reject_report_web()</FONT>
</H3>
<P>
Concerning reject reports of web commands, there are many uses cases :
<P>
<OL>
<LI><B>internal server error</B> :
<UL>
<LI><A NAME="12979"></A><TT>reject_report_web('intern',$error,$data,$action,$list,$user,$robot)</TT>
</LI>
<LI><A NAME="12982"></A><TT>reject_report_web('intern_quiet',$error,$data,$action,$list)</TT> : the listmaster won't be noticied
</LI>
</UL>
</LI>
<LI><B>user error</B> :
<BR> <A NAME="12985"></A><TT>reject_report_web('user',$error,$data,$action, $list)</TT>
</LI>
<LI><B>non authorization</B> :
<BR> <A NAME="12988"></A><TT>reject_report_web('auth',$error,$data,$action, $list)</TT>
</LI>
</OL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="12991"></A><TT>type</TT>(+): 'intern''intern_quiet''user''auth'
</LI>
<LI><A NAME="12994"></A><TT>error</TT>(+): SCALAR - depends on $type :
<UL>
<LI>'intern' : $error in <A NAME="12997"></A><TT>listmaster_notification.tt2</TT> and possibly $i_err.msg in <A NAME="13000"></A><TT>error.tt2</TT>
</LI>
<LI>'intern_quiet' : possibly $i_err.msg in <A NAME="13003"></A><TT>error.tt2</TT>
</LI>
<LI>'user' : $u_err.msg in <A NAME="13006"></A><TT>error.tt2</TT>
</LI>
<LI>'auth' : $reason in <A NAME="13009"></A><TT>authorization_reject.tt2</TT>
</LI>
</UL>
</LI>
<LI><A NAME="13012"></A><TT>data</TT>: ref(HASH) - for variable instantiation in <A NAME="13015"></A><TT>notice.tt2</TT>
</LI>
<LI><A NAME="13018"></A><TT>action</TT>(+): SCALAR - the rejected actin, $xx.action in <A NAME="13021"></A><TT>error.tt2</TT>, $action in <A NAME="13024"></A><TT>listmaster_notification.tt2</TT>
</LI>
<LI><A NAME="13027"></A><TT>list</TT>: '' ref(List)
</LI>
<LI><A NAME="13030"></A><TT>user</TT>: SCALAR - the user for listmaster notification
</LI>
<LI><A NAME="13033"></A><TT>robot</TT>: SCALAR - robot for listmaster notification
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H3><A NAME="SECTION002963800000000000000"></A>
<A NAME="report-notice-report-web"></A><A NAME="5964"></A>
<BR>
28.6.3.8 <FONT SIZE="+1">notice_report_web()</FONT>
</H3>
<P>
Concerns positive notices of web commands.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13036"></A><TT>msg</TT>: $notice.msg in <A NAME="13039"></A><TT>notice.tt2</TT>
</LI>
<LI><A NAME="13042"></A><TT>data</TT>: ref(HASH) - for variable instantiation in <A NAME="13045"></A><TT>notice.tt2</TT>
</LI>
<LI><A NAME="13048"></A><TT>action</TT>: SCALAR - the noticed command, $notice.cmd in <A NAME="13051"></A><TT>notice.tt2</TT>
</LI>
</OL>
<P>
<B>OUT</B> : 1 undef
<P>
<H1><A NAME="SECTION002970000000000000000"></A>
<A NAME="5976"></A>
<BR>
28.7 tools.pl
</H1>
<P>
This module provides various tools for Sympa.
<P>
<H3><A NAME="SECTION002970100000000000000"></A>
<A NAME="tools-checkcommand"></A><A NAME="5979"></A>
<BR>
28.7.0.1 <FONT SIZE="+1">checkcommand()</FONT>
</H3>
<P>
Checks for no command in the body of the message. If there are some command in it,
it returns true and sends a message to $sender by calling List::send_global_file()
(see <A HREF="#list-send-global-file">28.2.2</A>, page <A HREF="node29.html#list-send-global-file"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) with mail
template ``message_report''.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13054"></A><TT>msg</TT>(+): ref(MIME::Entity) - the message to check
</LI>
<LI><A NAME="13057"></A><TT>sender</TT>(+): the message sender
</LI>
<LI><A NAME="13060"></A><TT>robot</TT>(+): robot
</LI>
</OL>
<P>
<B>OUT</B> :
<UL>
<LI>1 <I>if there are some command in the message</I>
</LI>
<LI>0 <I>else</I>
</LI>
</UL>
<P>
<H3><A NAME="SECTION002970200000000000000"></A>
<A NAME="tools-get-array-from-splitted-string"></A><A NAME="5995"></A>
<BR>
28.7.0.2 <FONT SIZE="+1">get_array_from_splitted_string()</FONT>
</H3>
<P>
Return an array made from a string splitted by ','.
It removes spaces.
<P>
<B>IN</B> : <A NAME="13063"></A><TT>string</TT>(+): string to split
<P>
<B>OUT</B> : ref(ARRAY) -
<P>
<H3><A NAME="SECTION002970300000000000000"></A>
<A NAME="tools-diff-on-arrays"></A><A NAME="6001"></A>
<BR>
28.7.0.3 <FONT SIZE="+1">diff_on_arrays()</FONT>
</H3>
<P>
Makes set operation on arrays seen as set (with no double) :
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13066"></A><TT>A</TT>(+): ref(ARRAY) - set
</LI>
<LI><A NAME="13069"></A><TT>B</TT>(+): ref(ARRAY) - set
</LI>
</OL>
<P>
<B>OUT</B> : ref(HASH) with keys :
<UL>
<LI>deleted : A B
</LI>
<LI>added : B A
</LI>
<LI>intersection : A B
</LI>
<LI>union : A B
</LI>
</UL>
<P>
<H3><A NAME="SECTION002970400000000000000"></A>
<A NAME="tools-clean-msg-id"></A><A NAME="6012"></A>
<BR>
28.7.0.4 <FONT SIZE="+1">clean_msg_id()</FONT>
</H3>
<P>
Cleans a msg_id to use it without '
<BR>
n', '
<BR>
s', < and >.
<P>
<B>IN</B> : <A NAME="13072"></A><TT>msg_id</TT>(+): the message id
<P>
<B>OUT</B> : the clean msg_id
<P>
<H3><A NAME="SECTION002970500000000000000"></A>
<A NAME="tools-clean-email"></A><A NAME="6018"></A>
<BR>
28.7.0.5 <FONT SIZE="+1">clean_email()</FONT>
</H3>
<P>
Lower-case it and remove leading and trailing spaces.
<P>
<B>IN</B> : <A NAME="13075"></A><TT>msg_id</TT>(+): the email
<P>
<B>OUT</B> : the clean email
<P>
<H3><A NAME="SECTION002970600000000000000"></A>
<A NAME="tools-make-tt2-include-path"></A><A NAME="6024"></A>
<BR>
28.7.0.6 <FONT SIZE="+1">make_tt2_include_path()</FONT>
</H3>
<P>
Make an array of include path for tt2 parsing
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13078"></A><TT>robot</TT>(+): SCALAR - the robotset
</LI>
<LI><A NAME="13081"></A><TT>dir</TT>: SCALAR - directory ending each path
</LI>
<LI><A NAME="13084"></A><TT>lang</TT>: SCALAR - for lang directories
</LI>
<LI><A NAME="13087"></A><TT>list</TT>: ref(List) - for list directory
</LI>
</OL>
<P>
<B>OUT</B> : ref(ARRAY) - include tt2 path, respecting
path priorities.
<P>
<H1><A NAME="SECTION002980000000000000000"></A>
<A NAME="6034"></A>
<BR>
28.8 Message.pm
</H1>
<P>
This module provides objects to encapsulate file message in order to prevent it from its alteration
for using signatures.
<P>
<H3><A NAME="SECTION002980100000000000000"></A>
<A NAME="message-new"></A><A NAME="6037"></A>
<BR>
28.8.0.1 <FONT SIZE="+1">new()</FONT>
</H3>
<P>
Creates an object Message and initialize it :
<UL>
<LI><A NAME="13090"></A><TT>msg</TT> : ref(MIME::Entity)
</LI>
<LI><A NAME="13093"></A><TT>altered</TT> <I>if the message is altered</I>
</LI>
<LI><A NAME="13096"></A><TT>filename</TT> : the file containing the message
</LI>
<LI><A NAME="13099"></A><TT>size</TT> : the message size
</LI>
<LI><A NAME="13102"></A><TT>sender</TT> : the first email address, in the 'From' field
</LI>
<LI><A NAME="13105"></A><TT>decoded_subject</TT> : the 'Subject' field decoded by MIME::Words::decode_mimewords
</LI>
<LI><A NAME="13108"></A><TT>subject_charset</TT> : the charset used to encode the 'Subject' field
</LI>
<LI><A NAME="13111"></A><TT>rcpt</TT> : the 'X-Sympa-To' field
</LI>
<LI><A NAME="13114"></A><TT>list</TT> : ref(List) <I>if it is a message no addressed to <I>Sympa</I> or a listmaster</I>
</LI>
<LI><A NAME="13118"></A><TT>topic</TT> : the 'X-Sympa-Topic' field.
</LI>
<LI><I>in a 'openssl' context - decrypt message</I> :
<UL>
<LI><A NAME="13121"></A><TT>smime_crypted</TT> : 'smime_crypted' <I>if it is in a 'openssl' context</I>
</LI>
<LI><A NAME="13124"></A><TT>orig_msg</TT> : ref(MIME::Entity) - crypted message
</LI>
<LI><A NAME="13127"></A><TT>msg</TT> : ref(MIME::Entity) - decrypted message (see tools::smime_decrypt())
</LI>
<LI><A NAME="13130"></A><TT>msg_as_string</TT> : string - decrypted message (see tools::smime_decrypt())
</LI>
</UL>
</LI>
<LI><I>in a 'openssl' context - check signature</I> :
<UL>
<LI><A NAME="13133"></A><TT>protected</TT> : 1 <I>if the message should not be altered</I>
</LI>
<LI><A NAME="13136"></A><TT>smime_signed</TT> : 1 <I>if the message is signed</I>
</LI>
<LI><A NAME="13139"></A><TT>smime_subject</TT> : ref(HASH)<I>if the message is signed</I> - information on the signer
see tools::smime_parse_cert().
</LI>
</UL>
</LI>
</UL>
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13142"></A><TT>pkg</TT>(+): Message
</LI>
<LI><A NAME="13145"></A><TT>file</TT>(+): the message file
</LI>
</OL>
<P>
<B>OUT</B> : ref(Message) undef
<P>
<H3><A NAME="SECTION002980200000000000000"></A>
<A NAME="message-dump"></A><A NAME="6077"></A>
<BR>
28.8.0.2 <FONT SIZE="+1">dump()</FONT>
</H3>
<P>
Dump the message object in the file descriptor $output
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13148"></A><TT>self</TT>(+): ref(Message)
</LI>
<LI><A NAME="13151"></A><TT>output</TT>(+): file descriptor
</LI>
</OL>
<P>
<B>OUT</B> : '1'
<P>
<H3><A NAME="SECTION002980300000000000000"></A>
<A NAME="message-add-topic"></A><A NAME="6086"></A>
<BR>
28.8.0.3 <FONT SIZE="+1">add_topic()</FONT>
</H3>
<P>
Adds the message topic in the Message object (<A NAME="13154"></A><TT>topic'</TT> and adds
the 'X-Sympa-Topic' field in the ref(MIME::Entity) <A NAME="13157"></A><TT>msg'</TT>.
<P>
<B>IN</B> :
<OL>
<LI><A NAME="13160"></A><TT>self</TT>(+): ref(Message)
</LI>
<LI><A NAME="13163"></A><TT>topic</TT>(+): string splitted by ',' - list of topic
</LI>
</OL>
<P>
<B>OUT</B> : '1'
<P>
<H3><A NAME="SECTION002980400000000000000"></A>
<A NAME="message-get-topic"></A><A NAME="6097"></A>
<BR>
28.8.0.4 <FONT SIZE="+1">get_topic()</FONT>
</H3>
<P>
Returns the topic(s) of the message
<P>
<B>IN</B> : <A NAME="13166"></A><TT>self</TT>(+): ref(Message)
<P>
<B>OUT</B> : '' <I>if no message topic</I> | string splitted by ',' <I>if message topic</I>
<P>
N.B.:
<UL>
<LI>(+) : required parameter, value must not be empty
</LI>
<LI> : ``or'' for parameters value
</LI>
<LI>$ : reference to code parameters or variables
</LI>
<LI><I>condition for parameter</I>
</LI>
</UL>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1549"
HREF="node30.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html1543"
HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html1537"
HREF="node28.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html1545"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<A NAME="tex2html1547"
HREF="node30.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1550"
HREF="node30.html">Index</A>
<B> Up:</B> <A NAME="tex2html1544"
HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html1538"
HREF="node28.html">27. Using Sympa commands</A>
<B> <A NAME="tex2html1546"
HREF="node1.html">Contents</A></B>
<B> <A NAME="tex2html1548"
HREF="node30.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
root
2006-10-20
</ADDRESS>
</BODY>
</HTML>
|