File: node17.html

package info (click to toggle)
sympa 5.2.3-1.2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 21,384 kB
  • ctags: 3,566
  • sloc: perl: 27,368; sh: 3,990; makefile: 1,366; ansic: 226; php: 105; lisp: 32
file content (842 lines) | stat: -rw-r--r-- 26,734 bytes parent folder | download | duplicates (2)
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
<!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>16. Customizing Sympa/WWSympa </TITLE>
<META NAME="description" CONTENT="16. 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="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="sympa.css">

<LINK REL="next" HREF="node18.html">
<LINK REL="previous" HREF="node16.html">
<LINK REL="up" HREF="sympa.html">
<LINK REL="next" HREF="node18.html">
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html1216"
  HREF="node18.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1210"
  HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1204"
  HREF="node16.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1212"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1214"
  HREF="node30.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1217"
  HREF="node18.html">17. Mailing list definition</A>
<B> Up:</B> <A NAME="tex2html1211"
  HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html1205"
  HREF="node16.html">15. Interaction between Sympa and other</A>
 &nbsp; <B>  <A NAME="tex2html1213"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1215"
  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="tex2html1218"
  HREF="node17.html#SECTION001710000000000000000">16.1 Template file format</A>
<LI><A NAME="tex2html1219"
  HREF="node17.html#SECTION001720000000000000000">16.2 Site template files</A>
<UL>
<LI><A NAME="tex2html1220"
  HREF="node17.html#SECTION001721000000000000000">16.2.1 helpfile.tt2</A>
<LI><A NAME="tex2html1221"
  HREF="node17.html#SECTION001722000000000000000">16.2.2 lists.tt2</A>
<LI><A NAME="tex2html1222"
  HREF="node17.html#SECTION001723000000000000000">16.2.3 global_remind.tt2</A>
<LI><A NAME="tex2html1223"
  HREF="node17.html#SECTION001724000000000000000">16.2.4 your_infected_msg.tt2</A>
</UL>
<BR>
<LI><A NAME="tex2html1224"
  HREF="node17.html#SECTION001730000000000000000">16.3 Web template files</A>
<LI><A NAME="tex2html1225"
  HREF="node17.html#SECTION001740000000000000000">16.4 Internationalization</A>
<UL>
<LI><A NAME="tex2html1226"
  HREF="node17.html#SECTION001741000000000000000">16.4.1 <I>Sympa</I> internationalization</A>
<LI><A NAME="tex2html1227"
  HREF="node17.html#SECTION001742000000000000000">16.4.2 List internationalization</A>
<LI><A NAME="tex2html1228"
  HREF="node17.html#SECTION001743000000000000000">16.4.3 User internationalization</A>
</UL>
<BR>
<LI><A NAME="tex2html1229"
  HREF="node17.html#SECTION001750000000000000000">16.5 Topics</A>
<LI><A NAME="tex2html1230"
  HREF="node17.html#SECTION001760000000000000000">16.6 Authorization scenarios</A>
<LI><A NAME="tex2html1231"
  HREF="node17.html#SECTION001770000000000000000">16.7 Loop detection</A>
<LI><A NAME="tex2html1232"
  HREF="node17.html#SECTION001780000000000000000">16.8 Tasks</A>
<UL>
<LI><A NAME="tex2html1233"
  HREF="node17.html#SECTION001781000000000000000">16.8.1 List task creation</A>
<LI><A NAME="tex2html1234"
  HREF="node17.html#SECTION001782000000000000000">16.8.2 Global task creation</A>
<LI><A NAME="tex2html1235"
  HREF="node17.html#SECTION001783000000000000000">16.8.3 Model file format</A>
<LI><A NAME="tex2html1236"
  HREF="node17.html#SECTION001784000000000000000">16.8.4 Model file examples</A>
</UL></UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION001700000000000000000"></A><A NAME="9412"></A>
    <A NAME="customization"></A>
<BR>
16. Customizing <I>Sympa</I>/<I>WWSympa</I> 
</H1>

<P>

<H1><A NAME="SECTION001710000000000000000"></A>
<A NAME="tpl-format"></A><A NAME="2135"></A>
<BR>
16.1 Template file format
</H1>

<P>
Template files within <I>Sympa</I> used to be in a proprietary format that has been
replaced with the <A NAME="tex2html34"
  HREF="http://www.tt2.org">TT2</A>
template format.

<P>
You will find detailed documentation about the TT2 syntax on the web site : <B>http://www.tt2.org</B>

<P>
Here are some aspects regarding templates that are specific to <I>Sympa</I>: 

<UL>
<LI>References to PO catalogue are noted with the <B>[% loc %]</B> tag that may include 
  parameters. Example: <TT>[%|loc(list.name,list.host)%]Welcome to list %1%2[%END%]</TT>.

<P>
</LI>
<LI>Few exceptions apart, templates cannot insert or parse a file given its full or relative 
   path, for security reason. Only the file name should be provided ; the TT2 parser will then
   use the INCLUDE_PATH provided by <I>Sympa</I> to find the relevant file to insert/parse.

<P>
</LI>
<LI>The <B>qencode</B> filter should be used if a template includes SMTP header fields
  that should be Q-encoded. Example: <TT>[% FILTER qencode %]Message &#224; mod&#233;rer[%END%]</TT>

<P>
</LI>
<LI>You can write different versions of a template file in different language, each of them 
  being located in a subdirectory of the <B>tt2</B> directory. Example: <TT>/web_tt2/fr_FR/helpfile.tt2</TT>

<P>
</LI>
</UL>

<P>

<H1><A NAME="SECTION001720000000000000000"></A>
<A NAME="site-tpl"></A><A NAME="2149"></A>
<BR>
16.2 Site template files
</H1>

<P>
These files are used by Sympa as service messages for the <A NAME="9421"></A><TT>HELP</TT>, 
<A NAME="9424"></A><TT>LISTS</TT> and <A NAME="9427"></A><TT>REMIND *</TT> commands. These files are interpreted 
(parsed) by <I>Sympa</I> and respect the TT2 template format ; every file has a <B>.tt2</B> extension. 
See <A HREF="#tpl-format">16.1</A>, 
page&nbsp;<A HREF="node17.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>&lt;</TT>list<TT>&gt;</TT> is the
listname if defined, <TT>&lt;</TT>action<TT>&gt;</TT> is the name of the command, and <TT>&lt;</TT>lang<TT>&gt;</TT> is
the preferred language of the user) :

<OL>
<LI><A NAME="9455"></A><TT>/home/sympa/expl/<TT>&lt;</TT>list<TT>&gt;</TT>/mail_tt2/<TT>&lt;</TT>lang<TT>&gt;</TT>/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9494"></A><TT>/home/sympa/expl/<TT>&lt;</TT>list<TT>&gt;</TT>/mail_tt2/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9527"></A><TT>/home/sympa/etc/my.domain.org/mail_tt2/<TT>&lt;</TT>lang<TT>&gt;</TT>/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9554"></A><TT>/home/sympa/etc/my.domain.org/mail_tt2/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9581"></A><TT>/home/sympa/etc/mail_tt2/<TT>&lt;</TT>lang<TT>&gt;</TT>/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9608"></A><TT>/home/sympa/etc/mail_tt2/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>. 
</LI>
<LI><A NAME="9635"></A><TT>/home/sympa/bin/etc/mail_tt2/<TT>&lt;</TT>lang<TT>&gt;</TT>/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</TT>.
</LI>
<LI><A NAME="9662"></A><TT>/home/sympa/bin/etc/mail_tt2/<TT>&lt;</TT>action<TT>&gt;</TT>.tt2</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.email %] : sympa e-mail address local part

<P>
</DD>
<DT>-</DT>
<DD>[% conf.domain %] : sympa robot domain name

<P>
</DD>
<DT>-</DT>
<DD>[% conf.sympa %] : sympa's complete e-mail address

<P>
</DD>
<DT>-</DT>
<DD>[% conf.wwsympa_url %] : <A NAME="9671"></A><I>WWSympa</I> root URL

<P>
</DD>
<DT>-</DT>
<DD>[% conf.listmaster %] : listmaster e-mail addresses

<P>
</DD>
<DT>-</DT>
<DD>[% user.email %] : user e-mail address

<P>
</DD>
<DT>-</DT>
<DD>[% user.gecos %] : user gecos field (usually his/her name)

<P>
</DD>
<DT>-</DT>
<DD>[% user.password %] : user password

<P>
</DD>
<DT>-</DT>
<DD>[% user.lang %] : user language	
</DD>
</DL>

<P>

<H2><A NAME="SECTION001721000000000000000">
16.2.1 helpfile.tt2</A>
</H2> 

<P>
This file is sent in response to a <A NAME="9674"></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="SECTION001722000000000000000">
16.2.2 lists.tt2</A>
</H2> 

<P>
File returned by <A NAME="9677"></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="9680"></A><TT>visibility</TT> 
			list parameter) are listed.
</DD>
</DL>

<P>
<I>Example:</I> 

<P><PRE>
These are the public lists for [conf-&gt;email]@[conf-&gt;domain]

[% FOREACH l = lists %]
[% l.key %]@[% l.value.host %] : [% l.value.subject %]

[% END %]
</PRE>

<P>

<H2><A NAME="SECTION001723000000000000000">
16.2.3 global_remind.tt2</A>
</H2> 

<P>
This file is sent in response to a <A NAME="9683"></A><TT>REMIND *</TT> command. 
	(see&nbsp;<A HREF="node28.html#cmd-remind">27.2</A>, page&nbsp;<A HREF="node28.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 = lists %]
	
 [% l %] : [% conf.wwsympa\_url \%]/info/[% l %]

[% END %]

Your subscriber e-mail : [% user.email %]
Your password : [% user.password %]
</PRE>

<P>

<H2><A NAME="SECTION001724000000000000000">
16.2.4 your_infected_msg.tt2</A>
</H2> 

<P>
This message is sent to warn the sender of a virus infected mail,
indicating the name of the virus found 
(see&nbsp;<A HREF="#Antivirus"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>, page&nbsp;<A HREF="#Antivirus"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).

<P>

<H1><A NAME="SECTION001730000000000000000"></A>
<A NAME="web-tpl"></A><A NAME="2224"></A>
<BR>
16.3 Web template files
</H1>

<P>
You may define your own web template files, different from the standard
ones. <A NAME="9686"></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="9689"></A><TT>/home/sympa/expl/mylist/web_tt2</TT> 
directory ; your site web templates in <A NAME="9692"></A><TT>~/home/sympa/etc/web_tt2</TT> directory.

<P>
Note that web colors are defined in <I>Sympa</I>'s main Makefile (see <A HREF="node4.html#makefile">3.3</A>,
page&nbsp;<A HREF="node4.html#makefile"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>).

<P>

<H1><A NAME="SECTION001740000000000000000"></A>
<A NAME="internationalization"></A><A NAME="2231"></A>
<A NAME="2232"></A>
<BR>
16.4 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="9700"></A><TT>lang</TT> list parameter was introduced.
Nowadays <I>Sympa</I> is able to keep track of individual users' language preferences.

<P>
If you are willing to provide Sympa into your native language, please check the <B>translation howto</B> (<A NAME="tex2html35"
  HREF="http://www.sympa.org/howtotranslate.html"><TT>http://www.sympa.org/howtotranslate.html</TT></A>);

<P>

<H2><A NAME="SECTION001741000000000000000">
16.4.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="9706"></A><TT>/home/sympa/locale</TT> directory. 

<P>
To tell <I>Sympa</I> to use a particular message catalog, you can should set 
the <A NAME="9710"></A><TT>lang</TT> parameter in <A NAME="9713"></A><TT>sympa.conf</TT>.

<P>

<H2><A NAME="SECTION001742000000000000000">
16.4.2 List internationalization</A>
</H2>

<P>
The <A NAME="9716"></A><TT>lang</TT> list parameter defines the language for a list.
It is currently used by <A NAME="9719"></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="SECTION001743000000000000000">
16.4.3 User internationalization</A>
</H2>

<P>
The user language preference is currently used by <A NAME="9723"></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="9726"></A><I>WWSympa</I> allows the user to change 
it.

<P>

<H1><A NAME="SECTION001750000000000000000"></A>
<A NAME="topics"></A><A NAME="2246"></A>
<BR>
16.5 Topics
</H1>

<P>
<A NAME="9729"></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="9732"></A><TT>topics</TT> configuration parameters. A list may appear 
in multiple categories (This parameter is different from <A NAME="9735"></A><TT>msg_topic</TT>
used to tag list messages)

<P>
The list of topics is defined in the <A NAME="9738"></A><TT>topics.conf</TT> configuration
file, located in the <A NAME="9741"></A><TT>/home/sympa/etc</TT> directory. The format of this file is 
as follows :<PRE>
&lt;topic1_name&gt;
title	&lt;topic1 title&gt;
title.fr &lt;topic french title&gt;
visibility &lt;topic1 visibility&gt;
....
&lt;topicn_name/subtopic_name&gt;
title	&lt;topicn title&gt;
title.de &lt;topicn german title&gt;
</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="9744"></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="9747"></A><TT>topics.conf</TT> in the <A NAME="9750"></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="SECTION001760000000000000000">
16.6 Authorization scenarios</A>
</H1>

<P>
See <A HREF="node14.html#scenarios">13</A>, page&nbsp;<A HREF="node14.html#scenarios"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.

<P>

<H1><A NAME="SECTION001770000000000000000"></A>
    <A NAME="loop-detection"></A>    <A NAME="2265"></A>
<BR>
16.7 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="9760"></A><TT>loop_command_sampling_delay</TT> parameter)

<P>

<UL>
<LI>If the counter exceeds the 
		<A NAME="9763"></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="9766"></A><TT>loop_command_decrease_factor</TT> parameter
	
</LI>
</UL>

<P>
</LI>
</UL>

<P>

<H1><A NAME="SECTION001780000000000000000"></A>
    <A NAME="tasks"></A>    <A NAME="2279"></A>
<BR>
16.8 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="9787"></A><TT><TT>&lt;</TT>model name<TT>&gt;</TT>.<TT>&lt;</TT>model version<TT>&gt;</TT>.task</TT>.
For instance <A NAME="9802"></A><TT>remind.annual.task</TT>  or <A NAME="9805"></A><TT>remind.semestrial.task</TT>.

<P>
<I>Sympa</I> provides several task models stored in <A NAME="9809"></A><TT>/home/sympa/bin/etc/global_task_models</TT> 
  and <A NAME="9812"></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="SECTION001781000000000000000">
16.8.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="node21.html#list-task-parameters">20.3.5</A>, page&nbsp;<A HREF="node21.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="9827"></A><TT>/home/sympa/expl/<TT>&lt;</TT>list name<TT>&gt;</TT>/</TT>
</LI>
<LI><A NAME="9836"></A><TT>/home/sympa/etc/list_task_models/</TT>
</LI>
<LI><A NAME="9839"></A><TT>/home/sympa/bin/etc/list_task_models/</TT>
</LI>
</OL>

<P>
See also <A HREF="node18.html#Listmodelfiles">17.10</A>, page&nbsp;<A HREF="node18.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="SECTION001782000000000000000">
16.8.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="9843"></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="9846"></A><TT>/home/sympa/etc/global_task_models/</TT>
</LI>
<LI><A NAME="9849"></A><TT>/home/sympa/bin/etc/global_task_models/</TT>
</LI>
</OL>

<P>

<H2><A NAME="SECTION001783000000000000000">
16.8.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>&gt;</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="node18.html#list-tpl">17.8</A>, see 
page&nbsp;<A HREF="node18.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>&lt;</TT>date value<TT>&gt;</TT>, <TT>&lt;</TT>label<TT>&gt;</TT>)

<P>
Stop the execution. The task will go on at the date value and begin at the label line.
</LI>
<LI><TT>&lt;</TT>deleted_users<TT>&gt;</TT> = delete_subs (<TT>&lt;</TT>user_selection<TT>&gt;</TT>)

<P>
Delete @user_selection email list and stores user emails successfully deleted in @deleted_users.
</LI>
<LI>send_msg (<TT>&lt;</TT>user_selection<TT>&gt;</TT>, <TT>&lt;</TT>template<TT>&gt;</TT>)

<P>
Send the template message to emails stored in @user_selection.
</LI>
<LI>user_selection = select_subs (<TT>&lt;</TT>condition<TT>&gt;</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>&lt;</TT>list name<TT>&gt;</TT>), <TT>&lt;</TT>model type<TT>&gt;</TT>, <TT>&lt;</TT>model<TT>&gt;</TT>)

<P>
Create a task for object with model file <A NAME="9852"></A><TT>~model type.model.task</TT>.
</LI>
<LI>chk_cert_expiration (<TT>&lt;</TT>template<TT>&gt;</TT>, <TT>&lt;</TT>date value<TT>&gt;</TT>)

<P>
Send the template message to emails whose certificate has expired or will expire before the date value.
</LI>
<LI>update_crl (<TT>&lt;</TT>file name<TT>&gt;</TT>, <TT>&lt;</TT>date value<TT>&gt;</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="9857"></A><TT>task/</TT> spool if needed. Task file names have the following format : 

<P>
<A NAME="9890"></A><TT><TT>&lt;</TT>date<TT>&gt;</TT>.<TT>&lt;</TT>label<TT>&gt;</TT>.<TT>&lt;</TT>model name<TT>&gt;</TT>.<TT>&lt;</TT>list name | global<TT>&gt;</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="SECTION001784000000000000000">
16.8.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.gettext daily update of the certificate revocation list

/ACTION
update_crl (CA_list, [execution_date]+1d)
next ([execution_date] + 1d, ACTION)
</PRE>

<P>
</LI>
</UL>

<P>

<HR>
<!--Navigation Panel-->
<A NAME="tex2html1216"
  HREF="node18.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1210"
  HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1204"
  HREF="node16.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1212"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1214"
  HREF="node30.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1217"
  HREF="node18.html">17. Mailing list definition</A>
<B> Up:</B> <A NAME="tex2html1211"
  HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html1205"
  HREF="node16.html">15. Interaction between Sympa and other</A>
 &nbsp; <B>  <A NAME="tex2html1213"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1215"
  HREF="node30.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
root
2006-10-20
</ADDRESS>
</BODY>
</HTML>