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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4
patched version by: Kenshi Muto, Debian Project.
LaTeX2HTML 2002 (1.62),
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>12. Customizing Sympa/WWSympa </TITLE>
<META NAME="description" CONTENT="12. Customizing Sympa/WWSympa ">
<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="jLaTeX2HTML v2002 JA patch-1.4">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="sympa.css">
<LINK REL="next" HREF="node14.html">
<LINK REL="previous" HREF="node12.html">
<LINK REL="up" HREF="sympa.html">
<LINK REL="next" HREF="node14.html">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html967"
HREF="node14.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html961"
HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html955"
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html963"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<A NAME="tex2html965"
HREF="node23.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html968"
HREF="node14.html">13. Mailing list definition</A>
<B> Up:</B> <A NAME="tex2html962"
HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html956"
HREF="node12.html">11. Virtual robot</A>
  <B> <A NAME="tex2html964"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html966"
HREF="node23.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="tex2html969"
HREF="node13.html#SECTION001310000000000000000">12.1 Template file format</A>
<UL>
<LI><A NAME="tex2html970"
HREF="node13.html#SECTION001311000000000000000">12.1.1 Variables</A>
<LI><A NAME="tex2html971"
HREF="node13.html#SECTION001312000000000000000">12.1.2 Conditions</A>
<LI><A NAME="tex2html972"
HREF="node13.html#SECTION001313000000000000000">12.1.3 Loops</A>
<LI><A NAME="tex2html973"
HREF="node13.html#SECTION001314000000000000000">12.1.4 File inclusions</A>
<LI><A NAME="tex2html974"
HREF="node13.html#SECTION001315000000000000000">12.1.5 Stop parsing</A>
<LI><A NAME="tex2html975"
HREF="node13.html#SECTION001316000000000000000">12.1.6 Parsing options</A>
</UL>
<BR>
<LI><A NAME="tex2html976"
HREF="node13.html#SECTION001320000000000000000">12.2 Site template files</A>
<UL>
<LI><A NAME="tex2html977"
HREF="node13.html#SECTION001321000000000000000">12.2.1 helpfile.tpl</A>
<LI><A NAME="tex2html978"
HREF="node13.html#SECTION001322000000000000000">12.2.2 lists.tpl</A>
<LI><A NAME="tex2html979"
HREF="node13.html#SECTION001323000000000000000">12.2.3 global_remind.tpl</A>
<LI><A NAME="tex2html980"
HREF="node13.html#SECTION001324000000000000000">12.2.4 your_infected_msg.tpl</A>
</UL>
<BR>
<LI><A NAME="tex2html981"
HREF="node13.html#SECTION001330000000000000000">12.3 Web template files</A>
<LI><A NAME="tex2html982"
HREF="node13.html#SECTION001340000000000000000">12.4 Sharing data with other applications</A>
<LI><A NAME="tex2html983"
HREF="node13.html#SECTION001350000000000000000">12.5 Sharing <I>WWSympa</I> authentication with other applications</A>
<LI><A NAME="tex2html984"
HREF="node13.html#SECTION001360000000000000000">12.6 Internationalization</A>
<UL>
<LI><A NAME="tex2html985"
HREF="node13.html#SECTION001361000000000000000">12.6.1 <I>Sympa</I> internationalization</A>
<LI><A NAME="tex2html986"
HREF="node13.html#SECTION001362000000000000000">12.6.2 List internationalization</A>
<LI><A NAME="tex2html987"
HREF="node13.html#SECTION001363000000000000000">12.6.3 User internationalization</A>
</UL>
<BR>
<LI><A NAME="tex2html988"
HREF="node13.html#SECTION001370000000000000000">12.7 Topics</A>
<LI><A NAME="tex2html989"
HREF="node13.html#SECTION001380000000000000000">12.8 Authorization scenarios</A>
<LI><A NAME="tex2html990"
HREF="node13.html#SECTION001390000000000000000">12.9 Loop detection</A>
<LI><A NAME="tex2html991"
HREF="node13.html#SECTION0013100000000000000000">12.10 Tasks</A>
<UL>
<LI><A NAME="tex2html992"
HREF="node13.html#SECTION0013101000000000000000">12.10.1 List task creation</A>
<LI><A NAME="tex2html993"
HREF="node13.html#SECTION0013102000000000000000">12.10.2 Global task creation</A>
<LI><A NAME="tex2html994"
HREF="node13.html#SECTION0013103000000000000000">12.10.3 Model file format</A>
<LI><A NAME="tex2html995"
HREF="node13.html#SECTION0013104000000000000000">12.10.4 Model file examples</A>
</UL></UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION001300000000000000000"></A><A NAME="6419"></A>
<A NAME="customization"></A>
<BR>
12. Customizing <I>Sympa</I>/<I>WWSympa</I>
</H1>
<P>
<H1><A NAME="SECTION001310000000000000000"></A>
<A NAME="tpl-format"></A><A NAME="1718"></A>
<BR>
12.1 Template file format
</H1>
<P>
Template files within <I>Sympa</I> and <A NAME="6423"></A><I>WWSympa</I> are text files containing
programming elements (variables, conditions, loops, file inclusions)
that will be parsed in order to adapt to the runtime context. These
templates are an extension of programs and therefore give access to
a limited list of variables (those defined in the '<I>hash</I>'
parameter given to the parser).
<P>
Review the Site template files (<A HREF="node13.html#site-tpl">12.2</A>, page <A HREF="node13.html#site-tpl"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
and List template files (<A HREF="node14.html#list-tpl">13.7</A>, page <A HREF="node14.html#list-tpl"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
The following describes the syntactical elements of templates.
<P>
<H2><A NAME="SECTION001311000000000000000">
12.1.1 Variables</A>
</H2>
<P>
Variables are enclosed between brackets '<I>[]</I>'. The variable name
is composed of alphanumerics (0-1a-zA-Z) or underscores (_).
The syntax for accessing an element in a '<I>hash</I>' is [hash-<TT>></TT>elt].
<P>
<I>Examples:</I> <PRE>
[url]
[is_owner]
[list->name]
[user->lang]
</PRE>
<P>
For each template you wish to customize, check the available variables in the
documentation.
<P>
<H2><A NAME="SECTION001312000000000000000">
12.1.2 Conditions</A>
</H2>
<P>
Conditions include variable comparisons (= and <TT><></TT>), or existence.
Syntactical elements for conditions are [IF xxx], [ELSE], [ELSIF xxx] and
[ENDIF].
<P>
<I>Examples:</I> <PRE>
[IF user->lang=fr]
Bienvenue dans la liste [list->name]
[ELSIF user->lang=es]
Bienvenida en la lista [list->name]
[ELSE]
Welcome in list [list->name]
[ENDIF]
[IF is_owner]
The following commands are available only
for lists owners or moderators:
....
[ENDIF]
</PRE>
<P>
<H2><A NAME="SECTION001313000000000000000">
12.1.3 Loops</A>
</H2>
<P>
Loops make it possible to traverse a list of elements (internally represented by a
'<I>hash</I>' or an '<I>array</I>').
<P>
<TT>Example :</TT><PRE>
A review of public lists
[FOREACH l IN lists]
[l->NAME]
[l->subject]
[END]
</PRE>
<P>
<TT>[elt-<TT>></TT>NAME]</TT> is a special element of the current entry providing
the key in the '<I>hash</I>' (in this example the name of the list). When traversing
an '<I>array</I>', <TT>[elt-<TT>></TT>INDEX]</TT> is the index of the current
entry.
<P>
<H2><A NAME="SECTION001314000000000000000">
12.1.4 File inclusions</A>
</H2>
<P>
You can include another file within a template . The specified file can be
included as is, or itself parsed (there is no loop detection). The file
path is either specified in the directive or accessed in a variable.
<P>
Inclusion of a text file :
<P><PRE>
[INCLUDE 'archives/last_message']
[INCLUDE file_path]
</PRE>
<P>
The first example includes a file whose relative path is <A NAME="6426"></A><TT>archives/last_message</TT>.
The second example includes a file whose path is in file_path variable.
<P>
Inclusion and parsing of a template file :
<P><PRE>
[PARSE 'welcome.tpl']
[PARSE file_path]
</PRE>
<P>
The first example includes the template file <A NAME="6429"></A><TT>welcome.tpl</TT>.
The second example includes a template file whose path is in file_path variable.
<P>
<H2><A NAME="SECTION001315000000000000000">
12.1.5 Stop parsing</A>
</H2>
<P>
You may need to exclude certain lines in a template from the parsing
process. You can perform this by stopping and restarting the
parsing.
<P>
Escaping sensitive JavaScript functions :
<P><PRE>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- for other browsers
function toggle_selection(myfield) {
for (i = 0; i < myfield.length; i++) {
[escaped_stop]
if (myfield[i].checked) {
myfield[i].checked = false;
}else {
myfield[i].checked = true;
}
[escaped_start]
}
}
// end browsers -->
</SCRIPT>
</HEAD>
</PRE>
<P>
<H2><A NAME="SECTION001316000000000000000">
12.1.6 Parsing options</A>
</H2>
<P>
You can change the parser's behvior by setting unsetting options. Available options are :
<UL>
<LI><B>ignore_undef</B> : undefined variables won't be parsed. Default behavior is
to process undef variables like empty variables.
<P><PRE>
[SETOPTION ignore_undef]
Here is an unparsed undef variable : [unknown_var]
[UNSETOPTION ignore_undef]
</PRE>
<P>
</LI>
<LI><B>escape_html</B> : escape some HTML tag characters while including files
<P>
</LI>
</UL>
<P><PRE>
[SETOPTION escape_html]
[INCLUDE '/var/www/html/sample.html]
[UNSETOPTION escape_html]
</PRE>
<P>
<H1><A NAME="SECTION001320000000000000000"></A>
<A NAME="site-tpl"></A><A NAME="1784"></A>
<BR>
12.2 Site template files
</H1>
<P>
These files are used by Sympa as service messages for the <A NAME="6432"></A><TT>HELP</TT>,
<A NAME="6435"></A><TT>LISTS</TT> and <A NAME="6438"></A><TT>REMIND *</TT> commands. These files are interpreted
(parsed) by <I>Sympa</I> and respect the template format ; every file has a .tpl extension.
See <A HREF="node13.html#tpl-format">12.1</A>,
page <A HREF="node13.html#tpl-format"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
<P>
Sympa looks for these files in the following order (where <TT><</TT>list<TT>></TT> is the
listname if defined, <TT><</TT>action<TT>></TT> is the name of the command, and <TT><</TT>lang<TT>></TT> is
the preferred language of the user) :
<OL>
<LI><A NAME="6466"></A><TT>/home/sympa/expl/<TT><</TT>list<TT>></TT>/<TT><</TT>action<TT>></TT>.<TT><</TT>lang<TT>></TT>.tpl</TT>.
</LI>
<LI><A NAME="6505"></A><TT>/home/sympa/expl/<TT><</TT>list<TT>></TT>/<TT><</TT>action<TT>></TT>.tpl</TT>.
</LI>
<LI><A NAME="6538"></A><TT>/home/sympa/etc/templates/<TT><</TT>action<TT>></TT>.<TT><</TT>lang<TT>></TT>.tpl</TT>.
</LI>
<LI><A NAME="6565"></A><TT>/home/sympa/etc/templates/<TT><</TT>action<TT>></TT>.tpl</TT>.
</LI>
<LI><A NAME="6592"></A><TT>/home/sympa/bin/etc/templates/<TT><</TT>action<TT>></TT>.<TT><</TT>lang<TT>></TT>.tpl</TT>.
</LI>
<LI><A NAME="6619"></A><TT>/home/sympa/bin/etc/templates/<TT><</TT>action<TT>></TT>.tpl</TT>.
</LI>
</OL>
<P>
If the file starts with a From: line, it is considered as
a full message and will be sent (after parsing) without adding SMTP
headers. Otherwise the file is treated as a text/plain message body.
<P>
The following variables may be used in these template files :
<P>
<DL COMPACT>
<DT>-</DT>
<DD>[conf-<TT>></TT>email] : sympa e-mail address local part
<P>
</DD>
<DT>-</DT>
<DD>[conf-<TT>></TT>domain] : sympa robot domain name
<P>
</DD>
<DT>-</DT>
<DD>[conf-<TT>></TT>sympa] : sympa's complete e-mail address
<P>
</DD>
<DT>-</DT>
<DD>[conf-<TT>></TT>wwsympa_url] : <A NAME="6628"></A><I>WWSympa</I> root URL
<P>
</DD>
<DT>-</DT>
<DD>[conf-<TT>></TT>listmaster] : listmaster e-mail addresses
<P>
</DD>
<DT>-</DT>
<DD>[user-<TT>></TT>email] : user e-mail address
<P>
</DD>
<DT>-</DT>
<DD>[user-<TT>></TT>gecos] : user gecos field (usually his/her name)
<P>
</DD>
<DT>-</DT>
<DD>[user-<TT>></TT>password] : user password
<P>
</DD>
<DT>-</DT>
<DD>[user-<TT>></TT>lang] : user language
</DD>
</DL>
<P>
<H2><A NAME="SECTION001321000000000000000">
12.2.1 helpfile.tpl</A>
</H2>
<P>
This file is sent in response to a <A NAME="6631"></A><TT>HELP</TT> command.
You may use additional variables
<DL COMPACT>
<DT>-</DT>
<DD>[is_owner] : TRUE if the user is list owner
<P>
</DD>
<DT>-</DT>
<DD>[is_editor] : TRUE if the user is list editor
<P>
</DD>
</DL>
<P>
<H2><A NAME="SECTION001322000000000000000">
12.2.2 lists.tpl</A>
</H2>
<P>
File returned by <A NAME="6634"></A><TT>LISTS</TT> command.
An additional variable is available :
<DL COMPACT>
<DT>-</DT>
<DD>[lists] : this is a hash table indexed by list names and
containing lists' subjects. Only lists visible
to this user (according to the <A NAME="6637"></A><TT>visibility</TT>
list parameter) are listed.
</DD>
</DL>
<P>
<I>Example:</I>
<P><PRE>
These are the public lists for [conf->email]@[conf->domain]
[FOREACH l IN lists]
[l->NAME]: [l->subject]
[END]
</PRE>
<P>
<H2><A NAME="SECTION001323000000000000000">
12.2.3 global_remind.tpl</A>
</H2>
<P>
This file is sent in response to a <A NAME="6640"></A><TT>REMIND *</TT> command.
(see <A HREF="node22.html#cmd-remind">21.2</A>, page <A HREF="node22.html#cmd-remind"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)
You may use additional variables
<DL COMPACT>
<DT>-</DT>
<DD>[lists] : this is an array containing the list names the user
is subscribed to.
</DD>
</DL>
<P>
<I>Example:</I>
<P><PRE>
This is a subscription reminder.
You are subscribed to the following lists :
[FOREACH l IN lists
[l] : [conf->wwsympa\_url]/info/[l]
[END]
Your subscriber e-mail : [user->email]
Your password : [user->password]
</PRE>
<P>
<H2><A NAME="SECTION001324000000000000000">
12.2.4 your_infected_msg.tpl</A>
</H2>
<P>
This message is sent to warn the sender of a virus infected mail,
indicating the name of the virus found
(see <A HREF="#Antivirus"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page <A HREF="#Antivirus"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<H1><A NAME="SECTION001330000000000000000"></A>
<A NAME="web-tpl"></A><A NAME="1861"></A>
<BR>
12.3 Web template files
</H1>
<P>
You may define your own web template files, different from the standard
ones. <A NAME="6643"></A><I>WWSympa</I> first looks for list specific web templates, then for
site web templates, before falling back on its defaults.
<P>
Your list web template files should be placed in the <A NAME="6646"></A><TT>/home/sympa/expl/mylist/wws_templates</TT>
directory ; your site web templates in <A NAME="6649"></A><TT>~/home/sympa/etc/wws_templates</TT> directory.
<P>
There are actually 2 ways a template can include another template :
<P>
<OL>
<LI>directy, as in subrequest.us.tpl : <PRE>
[PARSE '/home/sympa/bin/etc/wws_templates/loginbanner.us.tpl'].
</PRE>
If you customize the loginbanner.us.tpl, you also have to customize templates that refer to it.
<P>
</LI>
<LI>indirectly, via a variable, as in main.tpl : <PRE>
[PARSE action_template]
</PRE>
</LI>
</OL>
<P>
Then <A NAME="6654"></A><TT>wwsympa.fcgi</TT> sets action_template variable to the appropriate template file path (ie : in the best place according to Sympa default rules, and in the current language).
<P>
We use (2) for some high level templates (action_template, error_template, notice_template, title_template, menu_template, list_menu_template, admin_menu_template) but then we use (1) for lower-level template inclusions.
<P>
Note that web colors are defined in <I>Sympa</I>'s main Makefile (see <A HREF="node4.html#makefile">3.3</A>,
page <A HREF="node4.html#makefile"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<H1><A NAME="SECTION001340000000000000000">
12.4 Sharing data with other applications</A>
</H1>
<P>
You may extract subscribers for a list from any of :
<UL>
<LI>a text file
<P>
</LI>
<LI>a Relational database
<P>
</LI>
<LI>a LDAP directory
<P>
</LI>
</UL>
<P>
See lparam user_data_source liste parameter <A HREF="node16.html#user-data-source">15.2.1</A>, page <A HREF="node16.html#user-data-source"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
<P>
The <B>subscriber_table</B> and <B>user_table</B> can have more fields than
the one used by <I>Sympa</I>. by defining these additional fields, they will be available
from within <I>Sympa</I>'s authorization scenarios and templates (see <A HREF="node6.html#db-additional-subscriber-fields">5.10.9</A>,
page <A HREF="node6.html#db-additional-subscriber-fields"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A> and <A HREF="node6.html#db-additional-user-fields">5.10.10</A>, page <A HREF="node6.html#db-additional-user-fields"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).
<P>
<H1><A NAME="SECTION001350000000000000000"></A><A NAME="6660"></A>
<BR>
12.5 Sharing <I>WWSympa</I> authentication with other applications
</H1>
<P>
See <A HREF="node10.html#sharing-auth">9.6</A>, page <A HREF="node10.html#sharing-auth"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
<P>
<H1><A NAME="SECTION001360000000000000000"></A>
<A NAME="internationalization"></A><A NAME="1894"></A>
<A NAME="1895"></A>
<BR>
12.6 Internationalization
</H1>
<P>
<I>Sympa</I> was originally designed as a multilingual Mailing List
Manager. Even in its earliest versions, <I>Sympa</I> separated messages from
the code itself, messages being stored in NLS catalogues (according
to the XPG4 standard). Later a <A NAME="6665"></A><TT>lang</TT> list parameter was introduced.
Nowadays <I>Sympa</I> is able to keep track of individual users' language preferences.
<P>
<H2><A NAME="SECTION001361000000000000000">
12.6.1 <I>Sympa</I> internationalization</A>
</H2>
<P>
Every message sent by <I>Sympa</I> to users, owners and editors is outside
the code, in a message catalog. These catalogs are located in the
<A NAME="6671"></A><TT>/home/sympa/nls</TT> directory. Messages have currently been
translated into 14 different languages :
<P>
<UL>
<LI>cn-big5: BIG5 Chinese (Hong Kong, Taiwan)
<P>
</LI>
<LI>cn-gb: GB Chinese (Mainland China)
<P>
</LI>
<LI>cz: Czech
<P>
</LI>
<LI>de: German
<P>
</LI>
<LI>es: Spanish
<P>
</LI>
<LI>fi: Finnish
<P>
</LI>
<LI>fr: French
<P>
</LI>
<LI>hu: Hungarian
<P>
</LI>
<LI>it: Italian
<P>
</LI>
<LI>pl: Polish
<P>
</LI>
<LI>us: US English
<P>
</LI>
</UL>
<P>
To tell <I>Sympa</I> to use a particular message catalog, you can either set
the <A NAME="6675"></A><TT>lang</TT> parameter in <A NAME="6678"></A><TT>sympa.conf</TT>, or
set the <A NAME="6681"></A><TT>sympa.pl</TT> <TT>-l</TT> option on the command line.
<P>
<H2><A NAME="SECTION001362000000000000000">
12.6.2 List internationalization</A>
</H2>
<P>
The <A NAME="6684"></A><TT>lang</TT> list parameter defines the language for a list.
It is currently used by <A NAME="6687"></A><I>WWSympa</I> and to initialize users'
language preferences at subscription time.
<P>
In future versions, all messages returned by <I>Sympa</I> concerning
a list should be in the list's language.
<P>
<H2><A NAME="SECTION001363000000000000000">
12.6.3 User internationalization</A>
</H2>
<P>
The user language preference is currently used by <A NAME="6691"></A><I>WWSympa</I>
only. There is no e-mail-based command for a user to set his/her
language. The language preference is initialized when the user
subscribes to his/her first list. <A NAME="6694"></A><I>WWSympa</I> allows the user to change
it.
<P>
<H1><A NAME="SECTION001370000000000000000"></A>
<A NAME="topics"></A><A NAME="1910"></A>
<BR>
12.7 Topics
</H1>
<P>
<A NAME="6697"></A><I>WWSympa</I>'s homepage shows a list of topics for classifying
mailing lists. This is dynamically generated using the different lists'
<A NAME="6700"></A><TT>topics</TT> configuration parameters. A list may appear
in multiple categories.
<P>
The list of topics is defined in the <A NAME="6703"></A><TT>topics.conf</TT> configuration
file, located in the <A NAME="6706"></A><TT>/home/sympa/etc</TT> directory. The format of this file is
as follows :<PRE>
<topic1_name>
title <topic1 title>
visibility <topic1 visibility>
....
<topicn_name/subtopic_name>
title <topicn title>
</PRE>
<P>
You will notice that subtopics can be used, the separator being <I>/</I>.
The topic name is composed of alphanumerics (0-1a-zA-Z) or underscores (_).
The order in which the topics are listed is respected in <A NAME="6709"></A><I>WWSympa</I>'s homepage.
The <B>visibility</B> line defines who can view the topic (now available for subtopics).
It refers to the associated topics_visibility authorization scenario.
You will find a sample <A NAME="6712"></A><TT>topics.conf</TT> in the <A NAME="6715"></A><TT>sample</TT>
directory ; NONE is installed as the default.
<P>
A default topic is hard-coded in <I>Sympa</I>: <I>default</I>. This default topic
contains all lists for which a topic has not been specified.
<P>
<H1><A NAME="SECTION001380000000000000000">
12.8 Authorization scenarios</A>
</H1>
<P>
See <A HREF="node11.html#scenarios">10</A>, page <A HREF="node11.html#scenarios"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
<P>
<H1><A NAME="SECTION001390000000000000000"></A>
<A NAME="loop-detection"></A> <A NAME="1928"></A>
<BR>
12.9 Loop detection
</H1>
<P>
<I>Sympa</I> uses multiple heuristics to avoid loops in Mailing lists
<P>
First, it rejects messages coming from a robot (as indicated by the
From: and other header fields), and messages containing commands.
<P>
Secondly, every message sent by <I>Sympa</I> includes an X-Loop header field set to
the listname. If the message comes back, <I>Sympa</I> will detect that
it has already been sent (unless X-Loop header fields have been
erased).
<P>
Thirdly, <I>Sympa</I> keeps track of Message IDs and will refuse to send multiple
messages with the same message ID to the same mailing list.
<P>
Finally, <I>Sympa</I> detect loops arising from command reports (i.e. sympa-generated replies to commands).
This sort of loop might occur as follows:
<P><PRE>
1 - X sends a command to Sympa
2 - Sympa sends a command report to X
3 - X has installed a home-made vacation program replying to programs
4 - Sympa processes the reply and sends a report
5 - Looping to step 3
</PRE>
<P>
<I>Sympa</I> keeps track (via an internal counter) of reports sent to any particular address.
The loop detection algorithm is :
<P>
<UL>
<LI>Increment the counter
<P>
</LI>
<LI>If we are within the sampling period (as defined by the
<A NAME="6725"></A><TT>loop_command_sampling_delay</TT> parameter)
<P>
<UL>
<LI>If the counter exceeds the
<A NAME="6728"></A><TT>loop_command_max</TT> parameter, then
do not send the report, and notify the listmaster
<P>
</LI>
<LI>Else, start a new sampling period and reinitialize
the counter, i.e. multiply it by the
<A NAME="6731"></A><TT>loop_command_decrease_factor</TT> parameter
</LI>
</UL>
<P>
</LI>
</UL>
<P>
<H1><A NAME="SECTION0013100000000000000000"></A>
<A NAME="tasks"></A> <A NAME="1942"></A>
<BR>
12.10 Tasks
</H1>
<P>
A task is a sequence of simple actions which realize a complex routine. It is executed in background
by the task manager daemon and allow the list master to automate the processing of recurrent tasks.
For example a task sends every year the subscribers of a list a message to remind their subscription.
<P>
A task is created with a task model. It is a text file which describes a sequence of simple actions.
It may have different versions (for instance reminding subscribers every year or semester).
A task model file name has the following format : <A NAME="6752"></A><TT><TT><</TT>model name<TT>></TT>.<TT><</TT>model version<TT>></TT>.task</TT>.
For instance <A NAME="6767"></A><TT>remind.annual.task</TT> or <A NAME="6770"></A><TT>remind.semestrial.task</TT>.
<P>
<I>Sympa</I> provides several task models stored in <A NAME="6774"></A><TT>/home/sympa/bin/etc/global_task_models</TT>
and <A NAME="6777"></A><TT>/home/sympa/bin/etc/list_task_models</TT> directories.
Others can be designed by the listmaster.
<P>
A task is global or related to a list.
<P>
<H2><A NAME="SECTION0013101000000000000000">
12.10.1 List task creation</A>
</H2>
<P>
You define in the list config file the model and the version you want to use (see
<A HREF="node16.html#list-task-parameters">15.3.5</A>, page <A HREF="node16.html#list-task-parameters"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>). Then the task manager daemon will automatically
create the task by looking for the appropriate model file in different directories in the
following order :
<P>
<OL>
<LI><A NAME="6792"></A><TT>/home/sympa/expl/<TT><</TT>list name<TT>></TT>/</TT>
</LI>
<LI><A NAME="6801"></A><TT>/home/sympa/etc/list_task_models/</TT>
</LI>
<LI><A NAME="6804"></A><TT>/home/sympa/bin/etc/list_task_models/</TT>
</LI>
</OL>
<P>
See also <A HREF="node14.html#Listmodelfiles">13.9</A>, page <A HREF="node14.html#Listmodelfiles"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, to know more about standard list models provided with <I>Sympa</I>.
<P>
<H2><A NAME="SECTION0013102000000000000000">
12.10.2 Global task creation</A>
</H2>
<P>
The task manager daemon checks if a version of a global task model is specified in <A NAME="6808"></A><TT>sympa.conf</TT>
and then creates a task as soon as it finds the model file by looking in different directories
in the following order :
<P>
<OL>
<LI><A NAME="6811"></A><TT>/home/sympa/etc/global_task_models/</TT>
</LI>
<LI><A NAME="6814"></A><TT>/home/sympa/bin/etc/global_task_models/</TT>
</LI>
</OL>
<P>
<H2><A NAME="SECTION0013103000000000000000">
12.10.3 Model file format</A>
</H2>
<P>
Model files are composed of comments, labels, references, variables, date values
and commands. All those syntactical elements are composed of alphanumerics (0-9a-zA-Z) and underscores (_).
<P>
<UL>
<LI>Comment lines begin by '#' and are not interpreted by the task manager.
</LI>
<LI>Label lines begin by '/' and are used by the next command (see below).
</LI>
<LI>References are enclosed between brackets '[]'. They refer to a value
depending on the object of the task (for instance [list-<TT>></TT>name]). Those variables
are instantiated when a task file is created from a model file. The list of available
variables is the same as for templates (see <A HREF="node14.html#list-tpl">13.7</A>, see
page <A HREF="node14.html#list-tpl"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>) plus [creation_date] (see below).
</LI>
<LI>Variables store results of some commands and are paramaters for others.
Their name begins with '@'.
</LI>
<LI>A date value may be written in two ways :
<P>
<UL>
<LI>absolute dates follow the format : xxxxYxxMxxDxxHxxMin. Y is the year,
M the month (1-12), D the day (1-28<TT>|</TT>30<TT>|</TT>31, leap-years are not managed),
H the hour (0-23), Min the minute (0-59). H and Min are optionnals.
For instance, 2001y12m4d44min is the 4th of December 2001 at 00h44.
<P>
</LI>
<LI>relative dates use the [creation_date] or [execution_date] references.
[creation_date] is the date when the task file is created, [execution_date]
when the command line is executed.
A duration may follow with '+' or '-' operators. The duration is expressed
like an absolute date whose all parameters are optionnals.
Examples : [creation_date], [execution_date]+1y, [execution_date]-6m4d
</LI>
</UL>
<P>
</LI>
<LI>Command arguments are separated by commas and enclosed between parenthesis '()'.
</LI>
</UL>
<P>
Here is the list of current avalable commands :
<UL>
<LI>stop ()
<P>
Stops the execution of the task and delete the task file
</LI>
<LI>next (<TT><</TT>date value<TT>></TT>, <TT><</TT>label<TT>></TT>)
<P>
Stop the execution. The task will go on at the date value and begin at the label line.
</LI>
<LI><TT><</TT>deleted_users<TT>></TT> = delete_subs (<TT><</TT>user_selection<TT>></TT>)
<P>
Delete @user_selection email list and stores user emails successfully deleted in @deleted_users.
</LI>
<LI>send_msg (<TT><</TT>user_selection<TT>></TT>, <TT><</TT>template<TT>></TT>)
<P>
Send the template message to emails stored in @user_selection.
</LI>
<LI>user_selection = select_subs (<TT><</TT>condition<TT>></TT>)
<P>
Store emails which match the condition in @user_selection. See 8.6 Authorization Scenarios section to know how to write conditions. Only available for list models.
</LI>
<LI>create (global | list (<TT><</TT>list name<TT>></TT>), <TT><</TT>model type<TT>></TT>, <TT><</TT>model<TT>></TT>)
<P>
Create a task for object with model file <A NAME="6817"></A><TT>~model type.model.task</TT>.
</LI>
<LI>chk_cert_expiration (<TT><</TT>template<TT>></TT>, <TT><</TT>date value<TT>></TT>)
<P>
Send the template message to emails whose certificate has expired or will expire before the date value.
</LI>
<LI>update_crl (<TT><</TT>file name<TT>></TT>, <TT><</TT>date value<TT>></TT>)
<P>
Update certificate revocation lists (CRL) which are expired or will expire before the date value. The file stores the CRL's URLs.
<P>
</LI>
<LI>purge_orphan_bounces()
<P>
Clean bounces by removing unsubscribed-users archives.
<P>
</LI>
<LI>eval_bouncers()
<P>
Evaluate all bouncing users of all list and give them a score from 0 to 100. (0 = no bounces for this user, 100 is for users who should be removed).
<P>
</LI>
<LI>process_bouncers()
<P>
Execute actions defined in list configuration on each bouncing users, according to their score.
</LI>
</UL>
<P>
Model files may have a scenario-like title line at the beginning.
<P>
When you change a configuration file by hand, and a task parameter is created or modified, it is up to you
to remove existing task files in the <A NAME="6822"></A><TT>task/</TT> spool if needed. Task file names have the following format :
<P>
<A NAME="6855"></A><TT><TT><</TT>date<TT>></TT>.<TT><</TT>label<TT>></TT>.<TT><</TT>model name<TT>></TT>.<TT><</TT>list name | global<TT>></TT></TT> where :
<P>
<UL>
<LI>date is when the task is executed, it is an epoch date
</LI>
<LI>label states where in the task file the execution begins. If empty, starts at the beginning
</LI>
</UL>
<P>
<H2><A NAME="SECTION0013104000000000000000">
12.10.4 Model file examples</A>
</H2>
<P>
<UL>
<LI>remind.annual.task
<A NAME="remind-annual-task"></A> <PRE>
</PRE>
<P>
</LI>
<LI>expire.annual.task
<A NAME="expire-annual-task"></A> <PRE>
</PRE>
<P>
</LI>
<LI>crl_update.daily.task
<BR> <PRE>
title.fr mise a jour quotidienne des listes de rvocation
title.us daily certificate revocation list update
title.et sertifikaatide kehtivuse nimekirja uuendatakse iga pev
title.hu napi frisstse a hitelestsi bizonylatok visszavonsnak
title.cz denn aktualizace seznamu revokac certifikt
/ACTION
update_crl (CA_list, [execution_date]+1d)
next ([execution_date] + 1d, ACTION)
</PRE>
<P>
</LI>
</UL>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html967"
HREF="node14.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html961"
HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html955"
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html963"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<A NAME="tex2html965"
HREF="node23.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html968"
HREF="node14.html">13. Mailing list definition</A>
<B> Up:</B> <A NAME="tex2html962"
HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html956"
HREF="node12.html">11. Virtual robot</A>
  <B> <A NAME="tex2html964"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html966"
HREF="node23.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
root
2004-09-10
</ADDRESS>
</BODY>
</HTML>
|