List.pm 342 KB
Newer Older
1
# list.pm - This module includes all list processing functions
2
3
4
# RCS Identication ; $Revision$ ; $Date$ 
#
# Sympa - SYsteme de Multi-Postage Automatique
5
# Copyrigh (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright (c) 1997,1998, 1999 Institut Pasteur & Christophe Wolfhugel
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
18
# You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
root's avatar
root committed
20
21
22
23

package List;

use strict;
24
25
use Datasource;
use SQLSource qw(create_db %date_format);
26
use Upgrade;
27
use Lock;
28
use Task;
29
use Scenario;
30
require Fetch;
31
require Exporter;
32
require Encode;
33
require 'tools.pl';
34
require "--LIBDIR--/tt2.pl";
35

36
37
my @ISA = qw(Exporter);
my @EXPORT = qw(%list_of_lists);
root's avatar
root committed
38

39
40
41
42
43
sub LOCK_SH {1};
sub LOCK_EX {2};
sub LOCK_NB {4};
sub LOCK_UN {8};

root's avatar
root committed
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
=head1 CONSTRUCTOR

=item new( [PHRASE] )

 List->new();

Creates a new object which will be used for a list and
eventually loads the list if a name is given. Returns
a List object.

=back

=head1 METHODS

=over 4

=item load ( LIST )

Loads the indicated list into the object.

=item save ( LIST )

Saves the indicated list object to the disk files.

=item savestats ()

Saves updates the statistics file on disk.

=item update_stats( BYTES )

Updates the stats, argument is number of bytes, returns the next
sequence number. Does nothing if no stats.

=item send_sub_to_owner ( WHO, COMMENT )
Send a message to the list owners telling that someone
wanted to subscribe to the list.

=item send_to_editor ( MSG )
82
    
root's avatar
root committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Send a Mail::Internet type object to the editor (for approval).

=item send_msg ( MSG )

Sends the Mail::Internet message to the list.

=item send_file ( FILE, USER, GECOS )

Sends the file to the USER. FILE may only be welcome for now.

=item delete_user ( ARRAY )

Delete the indicated users from the list.
 
97
98
99
100
=item delete_admin_user ( ROLE, ARRAY )

Delete the indicated admin user with the predefined role from the list.

root's avatar
root committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
=item get_cookie ()

Returns the cookie for a list, if available.

=item get_max_size ()

Returns the maximum allowed size for a message.

=item get_reply_to ()

Returns an array with the Reply-To values.

=item get_default_user_options ()

Returns a default option of the list for subscription.

=item get_total ()

Returns the number of subscribers to the list.

121
=item get_user_db ( USER )
root's avatar
root committed
122
123
124
125

Returns a hash with the informations regarding the indicated
user.

126
127
128
129
130
131
132
133
=item get_subscriber ( USER )

Returns a subscriber of the list.

=item get_admin_user ( ROLE, USER)

Return an admin user of the list with predefined role

root's avatar
root committed
134
135
136
137
=item get_first_user ()

Returns a hash to the first user on the list.

138
139
=item get_first_admin_user ( ROLE )

140
Returns a hash to the first admin user with predefined role on the list.
141

root's avatar
root committed
142
143
144
145
146
=item get_next_user ()

Returns a hash to the next users, until we reach the end of
the list.

147
148
149
150
151
=item get_next_admin_user ()

Returns a hash to the next admin users, until we reach the end of
the list.

root's avatar
root committed
152
153
154
155
=item update_user ( USER, HASHPTR )

Sets the new values given in the hash for the user.

156
157
158
159
=item update_admin_user ( USER, ROLE, HASHPTR )

Sets the new values given in the hash for the admin user.

root's avatar
root committed
160
161
162
163
164
=item add_user ( USER, HASHPTR )

Adds a new user to the list. May overwrite existing
entries.

165
166
167
168
169
=item add_admin_user ( USER, ROLE, HASHPTR )

Adds a new admin user to the list. May overwrite existing
entries.

root's avatar
root committed
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
=item is_user ( USER )

Returns true if the indicated user is member of the list.
 
=item am_i ( FUNCTION, USER )

Returns true is USER has FUNCTION (owner, editor) on the
list.

=item get_state ( FLAG )

Returns the value for a flag : sig or sub.

=item may_do ( ACTION, USER )

Chcks is USER may do the ACTION for the list. ACTION can be
one of following : send, review, index, getm add, del,
reconfirm, purge.

=item is_moderated ()

Returns true if the list is moderated.

=item archive_exist ( FILE )

Returns true if the indicated file exists.

=item archive_send ( WHO, FILE )

Send the indicated archive file to the user, if it exists.

=item archive_ls ()

Returns the list of available files, if any.

=item archive_msg ( MSG )

Archives the Mail::Internet message given as argument.

=item is_archived ()

Returns true is the list is configured to keep archives of
its messages.

=item get_stats ( OPTION )

Returns either a formatted printable strings or an array whith
the statistics. OPTION can be 'text' or 'array'.

=item print_info ( FDNAME )

Print the list informations to the given file descriptor, or the
currently selected descriptor.

=cut

use Carp;

228
use IO::Scalar;
229
use Storable;
root's avatar
root committed
230
231
232
233
234
use Mail::Header;
use Archive;
use Language;
use Log;
use Conf;
salaun's avatar
salaun committed
235
use mail;
236
use Ldap;
root's avatar
root committed
237
238
use Time::Local;
use MIME::Entity;
239
use MIME::EncWords;
240
use MIME::WordDecoder;
root's avatar
root committed
241
use MIME::Parser;
242
use Message;
243
use Family;
244
use PlainDigest;
root's avatar
root committed
245
246

## Database and SQL statement handlers
247
my ($dbh, $sth, $db_connected, @sth_stack, $use_db);
248
249
250

my %list_cache;

251
252
253
254
255
256
257
258
259
260
## DB fields with numeric type
## We should not do quote() for these while inserting data
my %numeric_field = ('cookie_delay_user' => 1,
		      'bounce_score_subscriber' => 1,
		      'subscribed_subscriber' => 1,
		      'included_subscriber' => 1,
		      'subscribed_admin' => 1,
		      'included_admin' => 1,
		      );
		      
root's avatar
root committed
261
262
263
264
265
## List parameters defaults
my %default = ('occurrence' => '0-1',
	       'length' => 25
	       );

266
267
my @param_order = qw (subject visibility info subscribe add unsubscribe del owner owner_include
		      send editor editor_include account topics 
268
		      host lang web_archive archive digest digest_max_size available_user_options 
269
		      default_user_options msg_topic msg_topic_keywords_apply_on msg_topic_tagging reply_to_header reply_to forced_reply_to * 
270
		      verp_rate welcome_return_path remind_return_path user_data_source include_file include_remote_file 
271
		      include_list include_remote_sympa_list include_ldap_query
272
                      include_ldap_2level_query include_sql_query include_admin ttl distribution_ttl creation update 
273
		      status serial custom_attribute);
root's avatar
root committed
274
275
276
277
278
279
280
281
282
283
284
285
286

## List parameters aliases
my %alias = ('reply-to' => 'reply_to',
	     'replyto' => 'reply_to',
	     'forced_replyto' => 'forced_reply_to',
	     'forced_reply-to' => 'forced_reply_to',
	     'custom-subject' => 'custom_subject',
	     'custom-header' => 'custom_header',
	     'subscription' => 'subscribe',
	     'unsubscription' => 'unsubscribe',
	     'max-size' => 'max_size');

##############################################################
salaun's avatar
salaun committed
287
## This hash COMPLETELY defines ALL list parameters     
root's avatar
root committed
288
289
290
291
292
293
294
## It is then used to load, save, view, edit list config files
##############################################################
## List parameters format accepts the following keywords :
## format :      Regexp aplied to the configuration file entry; 
##               some common regexps are defined in %regexp
## file_format : Config file format of the parameter might not be
##               the same in memory
295
## split_char:   Character used to separate multiple parameters 
root's avatar
root committed
296
297
298
299
300
301
302
## length :      Length of a scalar variable ; used in web forms
## scenario :    tells that the parameter is a scenario, providing its name
## default :     Default value for the param ; may be a configuration parameter (conf)
## synonym :     Defines synonyms for parameter values (for compatibility reasons)
## unit :        Unit of the parameter ; this is used in web forms
## occurrence :  Occurerence of the parameter in the config file
##               possible values: 0-1 | 1 | 0-n | 1-n
303
##               example : a list may have multiple owner 
salaun's avatar
salaun committed
304
## gettext_id :    Title reference in NLS catalogues
305
## description : deescription text of a parameter
salaun's avatar
salaun committed
306
## group :       Group of parameters
307
308
## obsolete :    Obsolete parameter ; should not be displayed 
##               nor saved
309
310
## obsolete_values : defined obsolete values for a parameter
##                   these values should not get proposed on the web interface edition form
311
## order :       Order of parameters within paragraph
312
313
## internal :    Indicates that the parameter is an internal parameter
##               that should always be saved in the config file
314
## field_type :  used to select passwords web input type
root's avatar
root committed
315
316
317
###############################################################
%::pinfo = ('account' => {'format' => '\S+',
			  'length' => 10,
salaun's avatar
salaun committed
318
			  'gettext_id' => "Account",
salaun's avatar
salaun committed
319
			  'group' => 'other'
root's avatar
root committed
320
321
			  },
	    'add' => {'scenario' => 'add',
salaun's avatar
salaun committed
322
		      'gettext_id' => "Who can add subscribers",
salaun's avatar
salaun committed
323
		      'group' => 'command'
root's avatar
root committed
324
325
		      },
	    'anonymous_sender' => {'format' => '.+',
salaun's avatar
salaun committed
326
				   'gettext_id' => "Anonymous sender",
327
				   'group' => 'sending'
root's avatar
root committed
328
329
330
				   },
	    'archive' => {'format' => {'period' => {'format' => ['day','week','month','quarter','year'],
						    'synonym' => {'weekly' => 'week'},
salaun's avatar
salaun committed
331
						    'gettext_id' => "frequency",
332
						    'order' => 1
root's avatar
root committed
333
334
335
						},
				       'access' => {'format' => ['open','private','public','owner','closed'],
						    'synonym' => {'open' => 'public'},
salaun's avatar
salaun committed
336
						    'gettext_id' => "access right",
337
						    'order' => 2
root's avatar
root committed
338
339
						}
				   },
salaun's avatar
salaun committed
340
			  'gettext_id' => "Text archives",
salaun's avatar
salaun committed
341
			  'group' => 'archives'
root's avatar
root committed
342
		      },
343
	    'archive_crypted_msg' => {'format' => ['original','decrypted'],
344
				    'default' => 'original',
salaun's avatar
salaun committed
345
				    'gettext_id' => "Archive encrypted mails as cleartext",
346
347
				    'group' => 'archives'
				    },
348
           'available_user_options' => {'format' => {'reception' => {'format' => ['mail','notice','digest','digestplain','summary','nomail','txt','html','urlize','not_me'],
serge.aumont's avatar
   
serge.aumont committed
349
350
351
352
353
354
								     'occurrence' => '1-n',
								     'split_char' => ',',
								     'default' => 'mail,notice,digest,digestplain,summary,nomail,txt,html,urlize,not_me',
								     'gettext_id' => "reception mode"
								     },
						     },
salaun's avatar
salaun committed
355
					 'gettext_id' => "Available subscription options",
356
					 'group' => 'sending'
357
				     },
root's avatar
root committed
358
359
360
361
362

	    'bounce' => {'format' => {'warn_rate' => {'format' => '\d+',
						      'length' => 3,
						      'unit' => '%',
						      'default' => {'conf' => 'bounce_warn_rate'},
salaun's avatar
salaun committed
363
						      'gettext_id' => "warn rate",
364
						      'order' => 1
root's avatar
root committed
365
366
367
368
369
						  },
				      'halt_rate' => {'format' => '\d+',
						      'length' => 3,
						      'unit' => '%',
						      'default' => {'conf' => 'bounce_halt_rate'},
salaun's avatar
salaun committed
370
						      'gettext_id' => "halt rate",
371
						      'order' => 2
root's avatar
root committed
372
373
						  }
				  },
salaun's avatar
salaun committed
374
			 'gettext_id' => "Bounces management",
salaun's avatar
salaun committed
375
			 'group' => 'bounces'
root's avatar
root committed
376
		     },
salaun's avatar
salaun committed
377
378
379
380
	    'bouncers_level1' => {'format' => {'rate' => {'format' => '\d+',
								 'length' => 2,
								 'unit' => 'Points',
								 'default' => {'conf' => 'default_bounce_level1_rate'},
381
								 'gettext_id' => "threshold",
salaun's avatar
salaun committed
382
383
384
385
								 'order' => 1
								 },
				               'action' => {'format' => ['remove_bouncers','notify_bouncers','none'],
								   'default' => 'notify_bouncers',
386
								   'gettext_id' => "action for this population",
salaun's avatar
salaun committed
387
388
389
390
								   'order' => 2
								   },
					       'notification' => {'format' => ['none','owner','listmaster'],
									 'default' => 'owner',
391
									 'gettext_id' => "notification",
salaun's avatar
salaun committed
392
393
394
									 'order' => 3
									 }
					   },
395
				      'gettext_id' => "Management of bouncers, 1st level",
salaun's avatar
salaun committed
396
397
398
399
400
401
				      'group' => 'bounces'
				  },
	     'bouncers_level2' => {'format' => {'rate' => {'format' => '\d+',
								 'length' => 2,
								 'unit' => 'Points',
								 'default' => {'conf' => 'default_bounce_level2_rate'},
402
								 'gettext_id' => "threshold",
salaun's avatar
salaun committed
403
404
405
406
								 'order' => 1
								 },
				               'action' => {'format' =>  ['remove_bouncers','notify_bouncers','none'],
								   'default' => 'remove_bouncers',
407
								   'gettext_id' => "action for this population",
salaun's avatar
salaun committed
408
409
410
411
								   'order' => 2
								   },
					       'notification' => {'format' => ['none','owner','listmaster'],
									 'default' => 'owner',
412
									 'gettext_id' => "notification",
salaun's avatar
salaun committed
413
414
415
									 'order' => 3
									 }
								     },
416
				      'gettext_id' => "Management of bouncers, 2nd level",
salaun's avatar
salaun committed
417
418
				      'group' => 'bounces'
				  },
root's avatar
root committed
419
420
421
422
	    'clean_delay_queuemod' => {'format' => '\d+',
				       'length' => 3,
				       'unit' => 'days',
				       'default' => {'conf' => 'clean_delay_queuemod'},
salaun's avatar
salaun committed
423
				       'gettext_id' => "Expiration of unmoderated messages",
salaun's avatar
salaun committed
424
				       'group' => 'other'
root's avatar
root committed
425
426
427
428
				       },
	    'cookie' => {'format' => '\S+',
			 'length' => 15,
			 'default' => {'conf' => 'cookie'},
salaun's avatar
salaun committed
429
			 'gettext_id' => "Secret string for generating unique keys",
salaun's avatar
salaun committed
430
			 'group' => 'other'
root's avatar
root committed
431
432
433
		     },
	    'creation' => {'format' => {'date_epoch' => {'format' => '\d+',
							 'occurrence' => '1',
salaun's avatar
salaun committed
434
							 'gettext_id' => "",
435
							 'order' => 3
root's avatar
root committed
436
437
						     },
					'date' => {'format' => '.+',
salaun's avatar
salaun committed
438
						   'gettext_id' => "",
439
						   'order' => 2
root's avatar
root committed
440
						   },
441
					'email' => {'format' => 'listmaster|'.&tools::get_regexp('email'),
root's avatar
root committed
442
						    'occurrence' => '1',
salaun's avatar
salaun committed
443
						    'gettext_id' => "",
444
						    'order' => 1
root's avatar
root committed
445
446
						    }
				    },
salaun's avatar
salaun committed
447
			   'gettext_id' => "Creation of the list",
448
			   'occurrence' => '0-1',
449
			   'internal' => 1,
salaun's avatar
salaun committed
450
			   'group' => 'other'
root's avatar
root committed
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
	'custom_attribute' => {
		'format' => {
			'id' => {
				'format' => '\w+',
				'length' => 20,
				'gettext_id' => "internal identifier",
				'occurrence' => '1',
				'order' =>1
			},
			'name' => {
				'format' => '.+',
				'length' =>30,
				'occurrence' => '1',
				'gettext_id' => "label",
				'order' => 2
			},
			'comment' => {
				'format' => '.+',
				'length' => 100,
				'gettext_id' => "additional comment",
				'order' => 3
			},
			'type' => {
				'format' => ['string','text','integer','enum'],
				'default' => 'string',
				'occurence' => 1,
				'gettext_id' => "type",
				'order' => 4
			},
			'enum_values' => {
				'format' => '.+',
				'length' => 100,
				'gettext_id' => "possible attribute values (if enum is used)",
				'order' => 5
			},
			'optional' => {
				'format' => ['required','optional'],
				'gettext_id' => "is the attribute optionnal ?",
				'order' => 6
			}
		
		},
		'occurrence' => '0-n',
		'gettext_id' => "Custom user attributes",
		'group' => 'other'
	},
root's avatar
root committed
499
500
501
	    'custom_header' => {'format' => '\S+:\s+.*',
				'length' => 30,
				'occurrence' => '0-n',
salaun's avatar
salaun committed
502
				'gettext_id' => "Custom header field",
503
				'group' => 'sending'
root's avatar
root committed
504
				},
505
	    'custom_subject' => {'format' => '.+',
root's avatar
root committed
506
				 'length' => 15,
salaun's avatar
salaun committed
507
				 'gettext_id' => "Subject tagging",
508
				 'group' => 'sending'
root's avatar
root committed
509
				 },
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
	    'custom_vars' => {'format' => {'name' => {'format' => '\S+',
						      'occurrence' => '1',
						      'gettext_id' => 'var name',
						      'order' => 1
						      },
					   'value' => {'format' => '\S+',
						       'occurrence' => '1',
						       'gettext_id' => 'var value',
						       'order' => 2
						       }
				       },
			      'gettext_id' => "custom parameters",
			      'occurrence' => '0-n',
			      'group' => 'other'
			      },			      

526
        'default_user_options' => {'format' => {'reception' => {'format' => ['digest','digestplain','mail','nomail','summary','notice','txt','html','urlize','not_me'],
root's avatar
root committed
527
								    'default' => 'mail',
salaun's avatar
salaun committed
528
								    'gettext_id' => "reception mode",
529
								    'order' => 1
root's avatar
root committed
530
531
532
								    },
						    'visibility' => {'format' => ['conceal','noconceal'],
								     'default' => 'noconceal',
salaun's avatar
salaun committed
533
								     'gettext_id' => "visibility",
534
								     'order' => 2
root's avatar
root committed
535
536
								     }
						},
salaun's avatar
salaun committed
537
				       'gettext_id' => "Subscription profile",
538
				       'group' => 'sending'
root's avatar
root committed
539
540
				   },
	    'del' => {'scenario' => 'del',
salaun's avatar
salaun committed
541
		      'gettext_id' => "Who can delete subscribers",
salaun's avatar
salaun committed
542
		      'group' => 'command'
root's avatar
root committed
543
544
		      },
	    'digest' => {'file_format' => '\d+(\s*,\s*\d+)*\s+\d+:\d+',
545
			 'format' => {'days' => {'format' => [0..6],
salaun's avatar
salaun committed
546
						 'file_format' => '1|2|3|4|5|6|7',
root's avatar
root committed
547
						 'occurrence' => '1-n',
salaun's avatar
salaun committed
548
						 'gettext_id' => "days",
549
						 'order' => 1
root's avatar
root committed
550
551
552
553
						 },
				      'hour' => {'format' => '\d+',
						 'length' => 2,
						 'occurrence' => '1',
salaun's avatar
salaun committed
554
						 'gettext_id' => "hour",
555
						 'order' => 2
root's avatar
root committed
556
557
558
559
						 },
				      'minute' => {'format' => '\d+',
						   'length' => 2,
						   'occurrence' => '1',
salaun's avatar
salaun committed
560
						   'gettext_id' => "minute",
561
						   'order' => 3
root's avatar
root committed
562
563
						   }
				  },
salaun's avatar
salaun committed
564
			 'gettext_id' => "Digest frequency",
565
			 'group' => 'sending'
root's avatar
root committed
566
		     },
salaun's avatar
salaun committed
567

568
569
570
571
572
573
574
	    'digest_max_size' => {'format' => '\d+',
				  'length' => 2,
				  'unit' => 'messages',
				  'default' => 25,
				  'gettext_id' => "Digest maximum number of messages",
				  'group' => 'sending'
		       },	    
575
576
577
578
579
580
581
582

	    'distribution_ttl' => {'format' => '\d+',
		      'length' => 6,
		      'unit' => 'seconds',
		      'gettext_id' => "Inclusions timeout for message distribution",
		      'group' => 'data_source'
		      },

583
	    'editor' => {'format' => {'email' => {'format' => &tools::get_regexp('email'),
root's avatar
root committed
584
585
						  'length' => 30,
						  'occurrence' => '1',
salaun's avatar
salaun committed
586
						  'gettext_id' => "email address",
587
						  'order' => 1
root's avatar
root committed
588
589
590
						  },
				      'reception' => {'format' => ['mail','nomail'],
						      'default' => 'mail',
salaun's avatar
salaun committed
591
						      'gettext_id' => "reception mode",
592
						      'order' => 4
root's avatar
root committed
593
						      },
594
595
596
597
598
				      'visibility' => {'format' => ['conceal','noconceal'],
						      'default' => 'noconceal',
						      'gettext_id' => "visibility",
						      'order' => 5
						      },
root's avatar
root committed
599
600
				      'gecos' => {'format' => '.+',
						  'length' => 30,
salaun's avatar
salaun committed
601
						  'gettext_id' => "name",
602
						  'order' => 2
root's avatar
root committed
603
604
605
						  },
				      'info' => {'format' => '.+',
						 'length' => 30,
salaun's avatar
salaun committed
606
						 'gettext_id' => "private information",
607
						 'order' => 3
root's avatar
root committed
608
609
610
						 }
				  },
			 'occurrence' => '0-n',
salaun's avatar
salaun committed
611
			 'gettext_id' => "Moderators",
salaun's avatar
salaun committed
612
			 'group' => 'description'
root's avatar
root committed
613
			 },
614
615
616
	    'editor_include' => {'format' => {'source' => {'datasource' => 1,
							   'occurrence' => '1',
							   'gettext_id' => 'the datasource',
617
							   'order' => 1
618
							   },
619
620
621
622
					      'source_parameters' => {'format' => '.*',
								      'occurrence' => '0-1',
								      'gettext_id' => 'datasource parameters',
								      'order' => 2
623
    								      },
624
625
626
					      'reception' => {'format' => ['mail','nomail'],
							      'default' => 'mail',
							      'gettext_id' => 'reception mode',
627
							       'order' => 3
628
629
630
631
632
633
							      },
				              'visibility' => {'format' => ['conceal','noconceal'],
							       'default' => 'noconceal',
							       'gettext_id' => "visibility",
							       'order' => 5
					                      }
634
					      
635
636
637
638
639
					      },
				  'occurrence' => '0-n',
				  'gettext_id' => 'Moderators defined in an external datasource',
				  'group' => 'description',
			      },
640
	    'expire_task' => {'task' => 'expire',
sympa-authors's avatar
sympa-authors committed
641
			      'gettext_id' => "Periodical subscription expiration task",
642
			      'group' => 'other'
643
			 },
644
 	    'family_name' => {'format' => &tools::get_regexp('family_name'),
645
646
647
648
649
 			      'occurrence' => '0-1',
 			      'gettext_id' => 'Family name',
			      'internal' => 1,
 			      'group' => 'description'
 			      },
root's avatar
root committed
650
651
	    'footer_type' => {'format' => ['mime','append'],
			      'default' => 'mime',
salaun's avatar
salaun committed
652
			      'gettext_id' => "Attachment type",
653
			      'group' => 'sending'
root's avatar
root committed
654
655
			      },
	    'forced_reply_to' => {'format' => '\S+',
salaun's avatar
salaun committed
656
				  'gettext_id' => "Forced reply address",
657
				  'obsolete' => 1
root's avatar
root committed
658
			 },
659
	    'host' => {'format' => &tools::get_regexp('host'),
root's avatar
root committed
660
		       'length' => 20,
661
		       'default' => {'conf' => 'host'},
salaun's avatar
salaun committed
662
		       'gettext_id' => "Internet domain",
salaun's avatar
salaun committed
663
		       'group' => 'description'
root's avatar
root committed
664
665
666
667
		   },
	    'include_file' => {'format' => '\S+',
			       'length' => 20,
			       'occurrence' => '0-n',
salaun's avatar
salaun committed
668
			       'gettext_id' => "File inclusion",
salaun's avatar
salaun committed
669
			       'group' => 'data_source'
root's avatar
root committed
670
			       },
671
672
673
674
675
676
677
678
679
680
681
682
683
	    'include_remote_file' => {'format' => {'url' => {'format' => '.+',
							     'gettext_id' => "data location URL",
							     'occurrence' => '1',
							     'length' => 50,
							     'order' => 2
							     },					       
						   'user' => {'format' => '.+',
							      'gettext_id' => "remote user",
							      'order' => 3,
							      'occurrence' => '0-1'
							      },
						   'passwd' => {'format' => '.+',
								'length' => 10,
684
								'field_type' => 'password',
685
686
687
688
689
690
691
692
693
694
695
696
697
698
								'gettext_id' => "remote password",
								'order' => 4,
								'occurrence' => '0-1'
								},							      
						    'name' => {'format' => '.+',
							       'gettext_id' => "short name for this source",
							       'length' => 15,
							       'order' => 1
							       }
						     },
				      'gettext_id' => "Remote file inclusion",
				      'occurrence' => '0-n',
				      'group' => 'data_source'
				      },				  
699
	    'include_ldap_query' => {'format' => {'host' => {'format' => &tools::get_regexp('multiple_host_with_port'),
root's avatar
root committed
700
							     'occurrence' => '1',
salaun's avatar
salaun committed
701
							     'gettext_id' => "remote host",
702
							     'order' => 2
root's avatar
root committed
703
704
705
							     },
						  'port' => {'format' => '\d+',
							     'length' => 4,
salaun's avatar
salaun committed
706
							     'gettext_id' => "remote port",
707
							     'obsolete' => 1,
708
							     'order' => 2
root's avatar
root committed
709
							     },
710
						  'user' => {'format' => '.+',
salaun's avatar
salaun committed
711
							     'gettext_id' => "remote user",
712
							     'order' => 3
root's avatar
root committed
713
							     },
714
						  'passwd' => {'format' => '.+',
root's avatar
root committed
715
							       'length' => 10,
716
							       'field_type' => 'password',
salaun's avatar
salaun committed
717
							       'gettext_id' => "remote password",
718
							       'order' => 3
root's avatar
root committed
719
							       },
720
						  'suffix' => {'format' => '.+',
salaun's avatar
salaun committed
721
							       'gettext_id' => "suffix",
722
							       'order' => 4
root's avatar
root committed
723
							       },
724
						  'filter' => {'format' => '.+',
root's avatar
root committed
725
726
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
727
							       'gettext_id' => "filter",
728
							       'order' => 7
root's avatar
root committed
729
730
731
732
							       },
						  'attrs' => {'format' => '\w+',
							      'length' => 15,
							      'default' => 'mail',
salaun's avatar
salaun committed
733
							      'gettext_id' => "extracted attribute",
734
							      'order' => 8
root's avatar
root committed
735
736
737
							      },
						  'select' => {'format' => ['all','first'],
							       'default' => 'first',
salaun's avatar
salaun committed
738
							       'gettext_id' => "selection (if multiple)",
739
740
741
742
							       'order' => 9
							       },
					          'scope' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
743
							      'gettext_id' => "search scope",
744
745
746
747
748
							      'order' => 5
							      },
						  'timeout' => {'format' => '\w+',
								'default' => 30,
								'unit' => 'seconds',
salaun's avatar
salaun committed
749
								'gettext_id' => "connection timeout",
750
								'order' => 6
751
752
								},
						   'name' => {'format' => '.+',
salaun's avatar
salaun committed
753
							      'gettext_id' => "short name for this source",
754
755
							      'length' => 15,
							      'order' => 1
756
							      },
757
758
759
760
761
762
							      'use_ssl' => {'format' => ['yes','no'],
									    'default' => 'no',
									    'gettext_id' => 'use SSL (LDAPS)',
									    'order' => 2.5,
									},
							      'ssl_version' => {'format' => ['sslv2','sslv3','tls'],
sympa-authors's avatar
sympa-authors committed
763
										'default' => 'sslv3',
764
765
766
										'gettext_id' => 'SSL version',
										'order' => 2.5,
									    },
sympa-authors's avatar
sympa-authors committed
767
							      'ssl_ciphers' => {'format' => '.+',
768
769
770
771
772
773
774
										'default' => 'ALL',
										'gettext_id' => 'SSL ciphers used',
										'order' => 2.5,
									   },
							      
							      
									    
root's avatar
root committed
775
776
					      },
				     'occurrence' => '0-n',
salaun's avatar
salaun committed
777
				     'gettext_id' => "LDAP query inclusion",
salaun's avatar
salaun committed
778
				     'group' => 'data_source'
root's avatar
root committed
779
				     },
780
	    'include_ldap_2level_query' => {'format' => {'host' => {'format' => &tools::get_regexp('multiple_host_with_port'),
781
							     'occurrence' => '1',
salaun's avatar
salaun committed
782
							     'gettext_id' => "remote host",
783
784
785
786
							     'order' => 1
							     },
						  'port' => {'format' => '\d+',
							     'length' => 4,
salaun's avatar
salaun committed
787
							     'gettext_id' => "remote port",
788
							     'obsolete' => 1,
789
790
							     'order' => 2
							     },
791
						  'user' => {'format' => '.+',
salaun's avatar
salaun committed
792
							     'gettext_id' => "remote user",
793
794
							     'order' => 3
							     },
795
						  'passwd' => {'format' => '.+',
796
							       'length' => 10,
797
							       'field_type' => 'password',
salaun's avatar
salaun committed
798
							       'gettext_id' => "remote password",
799
800
							       'order' => 3
							       },
801
						  'suffix1' => {'format' => '.+',
salaun's avatar
salaun committed
802
							       'gettext_id' => "first-level suffix",
803
804
							       'order' => 4
							       },
805
						  'filter1' => {'format' => '.+',
806
807
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
808
							       'gettext_id' => "first-level filter",
809
810
811
812
							       'order' => 7
							       },
						  'attrs1' => {'format' => '\w+',
							      'length' => 15,
salaun's avatar
salaun committed
813
							      'gettext_id' => "first-level extracted attribute",
814
815
816
817
							      'order' => 8
							      },
						  'select1' => {'format' => ['all','first','regex'],
							       'default' => 'first',
salaun's avatar
salaun committed
818
							       'gettext_id' => "first-level selection",
819
820
821
822
							       'order' => 9
							       },
					          'scope1' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
823
							      'gettext_id' => "first-level search scope",
824
825
826
827
828
							      'order' => 5
							      },
						  'timeout1' => {'format' => '\w+',
								'default' => 30,
								'unit' => 'seconds',
salaun's avatar
salaun committed
829
								'gettext_id' => "first-level connection timeout",
830
831
832
833
834
								'order' => 6
								},
						  'regex1' => {'format' => '.+',
								'length' => 50,
								'default' => '',
salaun's avatar
salaun committed
835
								'gettext_id' => "first-level regular expression",
836
837
								'order' => 10
								},
838
						  'suffix2' => {'format' => '.+',
salaun's avatar
salaun committed
839
							       'gettext_id' => "second-level suffix template",
840
841
							       'order' => 11
							       },
842
						  'filter2' => {'format' => '.+',
843
844
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
845
							       'gettext_id' => "second-level filter template",
846
847
848
849
850
							       'order' => 14
							       },
						  'attrs2' => {'format' => '\w+',
							      'length' => 15,
							      'default' => 'mail',
salaun's avatar
salaun committed
851
							      'gettext_id' => "second-level extracted attribute",
852
853
854
855
							      'order' => 15
							      },
						  'select2' => {'format' => ['all','first','regex'],
							       'default' => 'first',
salaun's avatar
salaun committed
856
							       'gettext_id' => "second-level selection",
857
858
859
860
							       'order' => 16
							       },
					          'scope2' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
861
							      'gettext_id' => "second-level search scope",
862
863
864
865
866
							      'order' => 12
							      },
						  'timeout2' => {'format' => '\w+',
								'default' => 30,
								'unit' => 'seconds',
salaun's avatar
salaun committed
867
								'gettext_id' => "second-level connection timeout",
868
869
870
871
872
								'order' => 13
								},
						  'regex2' => {'format' => '.+',
								'length' => 50,
								'default' => '',
salaun's avatar
salaun committed
873
								'gettext_id' => "second-level regular expression",
874
								'order' => 17
875
876
								},
						   'name' => {'format' => '.+',
salaun's avatar
salaun committed
877
							      'gettext_id' => "short name for this source",
878
879
							      'length' => 15,
							      'order' => 1
880
881
882
883
884
885
886
887
888
889
890
							      },
							      'use_ssl' => {'format' => ['yes','no'],
									    'default' => 'no',
									    'gettext_id' => 'use SSL (LDAPS)',
									    'order' => 2.5,
									},
							      'ssl_version' => {'format' => ['sslv2','sslv3','tls'],
										'default' => '',
										'gettext_id' => 'SSL version',
										'order' => 2.5,
									    },
sympa-authors's avatar
sympa-authors committed
891
							      'ssl_ciphers' => {'format' => '.+',
892
893
894
895
										'default' => 'ALL',
										'gettext_id' => 'SSL ciphers used',
										'order' => 2.5,
									    },
896

897
898
					      },
				     'occurrence' => '0-n',
salaun's avatar
salaun committed
899
				     'gettext_id' => "LDAP 2-level query inclusion",
900
901
				     'group' => 'data_source'
				     },
902
	    'include_list' => {'format' => &tools::get_regexp('listname').'(\@'.&tools::get_regexp('host').')?',
root's avatar
root committed
903
			       'occurrence' => '0-n',
salaun's avatar
salaun committed
904
			       'gettext_id' => "List inclusion",
salaun's avatar
salaun committed
905
			       'group' => 'data_source'
root's avatar
root committed
906
			       },
907
	    'include_remote_sympa_list' => {'format' => {'host' => {'format' => &tools::get_regexp('host'),
908
							    'occurrence' => '1',
salaun's avatar
salaun committed
909
							    'gettext_id' => "remote host",
910
911
912
913
914
							    'order' => 1
							    },
							 'port' => {'format' => '\d+',
							     'default' => 443,
							     'length' => 4,
salaun's avatar
salaun committed
915
							     'gettext_id' => "remote port",
916
917
918
919
920
							     'order' => 2
							     },
							 'path' => {'format' => '\S+',
			                                     'length' => 20,
			                                     'occurrence' => '1',
salaun's avatar
salaun committed
921
			                                     'gettext_id' => "remote path of sympa list dump",
922
923
924
925
							     'order' => 3 

			                                     },
                                                         'cert' => {'format' => ['robot','list'],
salaun's avatar
salaun committed
926
							           'gettext_id' => "certificate for authentication by remote Sympa",
927
								   'default' => 'list',
928
929
930
								    'order' => 4
								    },
							   'name' => {'format' => '.+',
salaun's avatar
salaun committed
931
								      'gettext_id' => "short name for this source",
932
933
934
935
								      'length' => 15,
								      'order' => 1
								      }
					},
936
937

			       'occurrence' => '0-n',
salaun's avatar
salaun committed
938
			       'gettext_id' => "remote list inclusion",
939
940
			       'group' => 'data_source'
			       },
941
	    'include_sql_query' => {'format' => {'db_type' => {'format' => '\S+',
root's avatar
root committed
942
							       'occurrence' => '1',
salaun's avatar
salaun committed
943
							       'gettext_id' => "database type",
944
							       'order' => 1
root's avatar
root committed
945
							       },
946
						 'host' => {'format' => &tools::get_regexp('host'),
root's avatar
root committed
947
							    'occurrence' => '1',
salaun's avatar
salaun committed
948
							    'gettext_id' => "remote host",
949
							    'order' => 2
root's avatar
root committed
950
							    },
951
952
953
954
955
						 'db_port' => {'format' => '\d+',
							       'gettext_id' => "database port",
							       'order' => 3 
							       },
					         'db_name' => {'format' => '\S+',
root's avatar
root committed
956
							       'occurrence' => '1',
salaun's avatar
salaun committed
957
							       'gettext_id' => "database name",
958
							       'order' => 4 
root's avatar
root committed
959
							       },
960
						 'connect_options' => {'format' => '.+',
salaun's avatar
salaun committed
961
								       'gettext_id' => "connection options",
962
963
								       'order' => 4
								       },
964
						 'db_env' => {'format' => '\w+\=\S+(;\w+\=\S+)*',
965
							      'order' => 5,
salaun's avatar
salaun committed
966
							      'gettext_id' => "environment variables for database connexion"
967
							      },
968
						 'user' => {'format' => '\S+',
root's avatar
root committed
969
							    'occurrence' => '1',
salaun's avatar
salaun committed
970
							    'gettext_id' => "remote user",
971
							    'order' => 6
root's avatar
root committed
972
973
							    },
						 'passwd' => {'format' => '.+',
974
							      'field_type' => 'password',
salaun's avatar
salaun committed
975
							      'gettext_id' => "remote password",
976
							      'order' => 7
root's avatar
root committed
977
							      },
978
						 'sql_query' => {'format' => &tools::get_regexp('sql_query'),
root's avatar
root committed
979
980
								 'length' => 50,
								 'occurrence' => '1',
salaun's avatar
salaun committed
981
								 'gettext_id' => "SQL query",
982
								 'order' => 8
root's avatar
root committed
983
								 },
984
						  'f_dir' => {'format' => '.+',
sympa-authors's avatar
sympa-authors committed
985
							     'gettext_id' => "Directory where the database is stored (used for DBD::CSV only)",
986
							     'order' => 9
987
988
							     },
						  'name' => {'format' => '.+',
salaun's avatar
salaun committed
989
							     'gettext_id' => "short name for this source",
990
991
							     'length' => 15,
							     'order' => 1
root's avatar
root committed
992
							     }
993
						 
root's avatar
root committed
994
995
					     },
				    'occurrence' => '0-n',
salaun's avatar
salaun committed
996
				    'gettext_id' => "SQL query inclusion",
salaun's avatar
salaun committed
997
				    'group' => 'data_source'
root's avatar
root committed
998
999
				    },
	    'info' => {'scenario' => 'info',
salaun's avatar
salaun committed
1000
		       'gettext_id' => "Who can view list information",