List.pm 384 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
26
27
28

use POSIX qw(strftime);
use Fcntl qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN);
use Encode;

29
30
use Datasource;
use SQLSource qw(create_db %date_format);
31
use Upgrade;
32
use Lock;
33
use Task;
34
use Scenario;
35
use Fetch;
36
use WebAgent;
37
use Exporter;
38
39
use tt2;
use Sympa::Constants;
40
use tools;
41

42

43
44
our @ISA = qw(Exporter);
our @EXPORT = qw(%list_of_lists);
root's avatar
root committed
45

46

root's avatar
root committed
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
=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 )
85
    
root's avatar
root committed
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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.
 
100
101
102
103
=item delete_admin_user ( ROLE, ARRAY )

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

root's avatar
root committed
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
=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.

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

126
Returns a hash with the information regarding the indicated
root's avatar
root committed
127
128
user.

129
130
131
=item get_subscriber ( USER )

Returns a subscriber of the list.
david.verdin's avatar
david.verdin committed
132

133
134
135
136
=item get_admin_user ( ROLE, USER)

Return an admin user of the list with predefined role

root's avatar
root committed
137
138
139
140
=item get_first_user ()

Returns a hash to the first user on the list.

141
142
=item get_first_admin_user ( ROLE )

143
Returns a hash to the first admin user with predefined role on the list.
144

root's avatar
root committed
145
146
147
148
149
=item get_next_user ()

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

150
151
152
153
154
=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
155
156
157
158
=item update_user ( USER, HASHPTR )

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

159
160
161
162
=item update_admin_user ( USER, ROLE, HASHPTR )

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

root's avatar
root committed
163
164
165
166
167
=item add_user ( USER, HASHPTR )

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

168
169
170
171
172
=item add_admin_user ( USER, ROLE, HASHPTR )

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

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

224
Print the list information to the given file descriptor, or the
root's avatar
root committed
225
226
227
228
229
230
currently selected descriptor.

=cut

use Carp;

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

248

root's avatar
root committed
249
## Database and SQL statement handlers
250
my ($dbh, $sth, $db_connected, @sth_stack, $use_db);
251
252
253

my %list_cache;

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

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

## 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
291
## This hash COMPLETELY defines ALL list parameters     
root's avatar
root committed
292
293
294
295
296
297
298
## 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
299
## split_char:   Character used to separate multiple parameters 
root's avatar
root committed
300
301
302
303
## 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)
304
305
## gettext_unit :Unit of the parameter ; this is used in web forms and refers to translated
##               strings in PO catalogs
root's avatar
root committed
306
307
## occurrence :  Occurerence of the parameter in the config file
##               possible values: 0-1 | 1 | 0-n | 1-n
308
##               example : a list may have multiple owner 
salaun's avatar
salaun committed
309
## gettext_id :    Title reference in NLS catalogues
310
## description : deescription text of a parameter
salaun's avatar
salaun committed
311
## group :       Group of parameters
312
313
## obsolete :    Obsolete parameter ; should not be displayed 
##               nor saved
314
315
## obsolete_values : defined obsolete values for a parameter
##                   these values should not get proposed on the web interface edition form
316
## order :       Order of parameters within paragraph
317
318
## internal :    Indicates that the parameter is an internal parameter
##               that should always be saved in the config file
319
## field_type :  used to select passwords web input type
root's avatar
root committed
320
321
322
###############################################################
%::pinfo = ('account' => {'format' => '\S+',
			  'length' => 10,
salaun's avatar
salaun committed
323
			  'gettext_id' => "Account",
salaun's avatar
salaun committed
324
			  'group' => 'other'
root's avatar
root committed
325
326
			  },
	    'add' => {'scenario' => 'add',
salaun's avatar
salaun committed
327
		      'gettext_id' => "Who can add subscribers",
salaun's avatar
salaun committed
328
		      'group' => 'command'
root's avatar
root committed
329
330
		      },
	    'anonymous_sender' => {'format' => '.+',
salaun's avatar
salaun committed
331
				   'gettext_id' => "Anonymous sender",
332
				   'group' => 'sending'
root's avatar
root committed
333
334
335
				   },
	    'archive' => {'format' => {'period' => {'format' => ['day','week','month','quarter','year'],
						    'synonym' => {'weekly' => 'week'},
salaun's avatar
salaun committed
336
						    'gettext_id' => "frequency",
337
						    'order' => 1
root's avatar
root committed
338
339
340
						},
				       'access' => {'format' => ['open','private','public','owner','closed'],
						    'synonym' => {'open' => 'public'},
salaun's avatar
salaun committed
341
						    'gettext_id' => "access right",
342
						    'order' => 2
root's avatar
root committed
343
344
						}
				   },
salaun's avatar
salaun committed
345
			  'gettext_id' => "Text archives",
salaun's avatar
salaun committed
346
			  'group' => 'archives'
root's avatar
root committed
347
		      },
348
	    'archive_crypted_msg' => {'format' => ['original','decrypted'],
349
				    'default' => 'original',
salaun's avatar
salaun committed
350
				    'gettext_id' => "Archive encrypted mails as cleartext",
351
352
				    'group' => 'archives'
				    },
353
           'available_user_options' => {'format' => {'reception' => {'format' => ['mail','notice','digest','digestplain','summary','nomail','txt','html','urlize','not_me'],
serge.aumont's avatar
   
serge.aumont committed
354
355
356
357
358
359
								     '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
360
					 'gettext_id' => "Available subscription options",
361
					 'group' => 'sending'
362
				     },
root's avatar
root committed
363
364
365

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

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

579
580
	    'digest_max_size' => {'format' => '\d+',
				  'length' => 2,
581
				  'gettext_unit' => 'messages',
582
				  'default' => 25,
583
				  'gettext_id' => "Digest maximum number of messages",				  
584
585
				  'group' => 'sending'
		       },	    
586
587
588

	    'distribution_ttl' => {'format' => '\d+',
		      'length' => 6,
589
		      'gettext_unit' => 'seconds',
590
		      'default' => {'conf' => 'default_distribution_ttl'},
591
592
593
594
		      'gettext_id' => "Inclusions timeout for message distribution",
		      'group' => 'data_source'
		      },

595
596
597
598
599
600
601
602
603
604
605
	    'dkim_feature' => {'format' => ['on','off'],
			      'occurence' => '0-1',
			      'default' => {'conf' => 'dkim_feature'},
			      'gettext_id' => "Insert DKIM signature to messages sent to the list",
			      'comment' =>  "Enable/Disable DKIM. This feature require Mail::DKIM to installed and may be some custom scenario to be updated",
			      'group' => 'dkim',
			  },
	    'dkim_signature_apply_on'=> {'format' => ['md5_authenticated_messages','smime_authenticated_messages','dkim_authenticated_messages','editor_validated_messages','none','any'],
					 'occurrence' => '0-n',
					 'split_char' => ',',
					 'default' => {'conf' => 'dkim_signature_apply_on'},
606
607
					 'gettext_id' => "The categories of messages sent to the list that will be signed using DKIM.",
					 'comment' => "This parameter controls in which case messages must be signed using DKIM, you may sign every message choosing 'any' or a subset. The parameter value is a comma separated list of keywords",
608
609
610
611
612
					 'group' => 'dkim',
					 },
	    'dkim_parameters'=> {'format' => {'private_key_path'=> {'format' => '\S+',
		                         			  'occurence' => '0-1',
			                                          'default' => {'conf' => 'dkim_private_key_path'},
613
614
			                                          'gettext_id' => "File path for list DKIM private key",
								  'comment' => "The file must contain a RSA pem encoded private key", 
615
616
617
618
619
								  'order' => 1
					                         },
					     'selector' => { 'format' => '\S+',
		                         			  'occurence' => '0-1',
			                                          'default' => {'conf' => 'dkim_selector'},
620
							          'comment' => "The selector is used in order to build the DNS query for public key. It is up to you to choose the value you want but verify that you can query the public DKIM key for <selector>._domainkey.your_domain",
621
622
623
624
625
626
627
			                                          'gettext_id' => "Selector for DNS lookup of DKIM public key",
								  'order' => 2
                                                                  },
							          
					     'header_list'=>      { 'format' => '\S+',
		                         			  'occurence' => '0-1',
			                                          'default' => {'conf' => 'dkim_header_list'},
628
			                                          'gettext_id' => 'List of headers to be included ito the message for signature',
629
630
631
632
633
634
635
636
637
638
639
640
								  'comment' => 'You should probably use teh default value which is the value recommended by RFC4871',
								  'order' => 4
                                                                  },
					     'signer_domain' =>   {'format' => '\S+',
		                         			  'occurence' => '0-1',
			                                          'default' => {'conf' => 'dkim_signer_domain'},
			                                          'gettext_id' => 'DKIM "d=" tag, you should probably use the default value',
								   'omment' => ' The DKIM "d=" tag, is the domain of the signing entity. the list domain MUST must be included in the "d=" domain',
								  'order' => 5
								 },
                                             'signer_identity'=>  {'format' => '\S+',
		                         			  'occurence' => '0-1',
641
642
								  'comment' => 'DKIM "i=" tag, you should probably not use this parameter, as recommended by RFC 4871, default for list brodcasted messages is i=<listname>-request@<domain>',
			                                          'gettext_id' => 'DKIM "i=" tag, you should probably leave this parameter empty',
643
644
645
646
647
648
649
650
651
								  'order' => 6
								 },
					     },
			      'group' => 'dkim',
			      'comment' => 'A set of parameters in order to define outgoing DKIM signature', 
			      'occurrence' => '0-1',
			      'gettext_id' => "DKIM configuration",
			  },
			      
652
	    'editor' => {'format' => {'email' => {'format' => &tools::get_regexp('email'),
root's avatar
root committed
653
654
						  'length' => 30,
						  'occurrence' => '1',
salaun's avatar
salaun committed
655
						  'gettext_id' => "email address",
656
						  'order' => 1
root's avatar
root committed
657
658
659
						  },
				      'reception' => {'format' => ['mail','nomail'],
						      'default' => 'mail',
salaun's avatar
salaun committed
660
						      'gettext_id' => "reception mode",
661
						      'order' => 4
root's avatar
root committed
662
						      },
663
664
665
666
667
				      'visibility' => {'format' => ['conceal','noconceal'],
						      'default' => 'noconceal',
						      'gettext_id' => "visibility",
						      'order' => 5
						      },
root's avatar
root committed
668
669
				      'gecos' => {'format' => '.+',
						  'length' => 30,
salaun's avatar
salaun committed
670
						  'gettext_id' => "name",
671
						  'order' => 2
root's avatar
root committed
672
673
674
						  },
				      'info' => {'format' => '.+',
						 'length' => 30,
salaun's avatar
salaun committed
675
						 'gettext_id' => "private information",
676
						 'order' => 3
root's avatar
root committed
677
678
679
						 }
				  },
			 'occurrence' => '0-n',
salaun's avatar
salaun committed
680
			 'gettext_id' => "Moderators",
salaun's avatar
salaun committed
681
			 'group' => 'description'
root's avatar
root committed
682
			 },
683
684
	    'editor_include' => {'format' => {'source' => {'datasource' => 1,
							   'occurrence' => '1',
685
							   'gettext_id' => 'the data source',
686
							   'order' => 1
687
							   },
688
689
					      'source_parameters' => {'format' => '.*',
								      'occurrence' => '0-1',
690
								      'gettext_id' => 'data source parameters',
691
								      'order' => 2
692
    								      },
693
694
695
					      'reception' => {'format' => ['mail','nomail'],
							      'default' => 'mail',
							      'gettext_id' => 'reception mode',
696
							       'order' => 3
697
698
699
700
701
702
							      },
				              'visibility' => {'format' => ['conceal','noconceal'],
							       'default' => 'noconceal',
							       'gettext_id' => "visibility",
							       'order' => 5
					                      }
703
					      
704
705
					      },
				  'occurrence' => '0-n',
706
				  'gettext_id' => 'Moderators defined in an external data source',
707
708
				  'group' => 'description',
			      },
709
	    'expire_task' => {'task' => 'expire',
sympa-authors's avatar
sympa-authors committed
710
			      'gettext_id' => "Periodical subscription expiration task",
711
			      'group' => 'other'
712
			 },
713
 	    'family_name' => {'format' => &tools::get_regexp('family_name'),
714
715
716
717
718
 			      'occurrence' => '0-1',
 			      'gettext_id' => 'Family name',
			      'internal' => 1,
 			      'group' => 'description'
 			      },
root's avatar
root committed
719
720
	    'footer_type' => {'format' => ['mime','append'],
			      'default' => 'mime',
salaun's avatar
salaun committed
721
			      'gettext_id' => "Attachment type",
722
			      'group' => 'sending'
root's avatar
root committed
723
724
			      },
	    'forced_reply_to' => {'format' => '\S+',
salaun's avatar
salaun committed
725
				  'gettext_id' => "Forced reply address",
726
				  'obsolete' => 1
root's avatar
root committed
727
			 },
728
	    'host' => {'format' => &tools::get_regexp('host'),
root's avatar
root committed
729
		       'length' => 20,
730
		       'default' => {'conf' => 'host'},
salaun's avatar
salaun committed
731
		       'gettext_id' => "Internet domain",
salaun's avatar
salaun committed
732
		       'group' => 'description'
root's avatar
root committed
733
734
735
736
		   },
	    'include_file' => {'format' => '\S+',
			       'length' => 20,
			       'occurrence' => '0-n',
salaun's avatar
salaun committed
737
			       'gettext_id' => "File inclusion",
salaun's avatar
salaun committed
738
			       'group' => 'data_source'
root's avatar
root committed
739
			       },
740
741
742
743
744
745
746
747
748
749
750
751
752
	    '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,
753
								'field_type' => 'password',
754
755
756
757
758
759
760
761
762
763
764
765
766
767
								'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'
				      },				  
768
	    'include_ldap_query' => {'format' => {'host' => {'format' => &tools::get_regexp('multiple_host_with_port'),
root's avatar
root committed
769
							     'occurrence' => '1',
salaun's avatar
salaun committed
770
							     'gettext_id' => "remote host",
771
							     'order' => 2
root's avatar
root committed
772
773
774
							     },
						  'port' => {'format' => '\d+',
							     'length' => 4,
salaun's avatar
salaun committed
775
							     'gettext_id' => "remote port",
776
							     'obsolete' => 1,
777
							     'order' => 2
root's avatar
root committed
778
							     },
779
						  'user' => {'format' => '.+',
salaun's avatar
salaun committed
780
							     'gettext_id' => "remote user",
781
							     'order' => 3
root's avatar
root committed
782
							     },
783
						  'passwd' => {'format' => '.+',
root's avatar
root committed
784
							       'length' => 10,
785
							       'field_type' => 'password',
salaun's avatar
salaun committed
786
							       'gettext_id' => "remote password",
787
							       'order' => 3
root's avatar
root committed
788
							       },
789
						  'suffix' => {'format' => '.+',
salaun's avatar
salaun committed
790
							       'gettext_id' => "suffix",
791
							       'order' => 4
root's avatar
root committed
792
							       },
793
						  'filter' => {'format' => '.+',
root's avatar
root committed
794
795
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
796
							       'gettext_id' => "filter",
797
							       'order' => 7
root's avatar
root committed
798
799
800
801
							       },
						  'attrs' => {'format' => '\w+',
							      'length' => 15,
							      'default' => 'mail',
salaun's avatar
salaun committed
802
							      'gettext_id' => "extracted attribute",
803
							      'order' => 8
root's avatar
root committed
804
805
806
							      },
						  'select' => {'format' => ['all','first'],
							       'default' => 'first',
salaun's avatar
salaun committed
807
							       'gettext_id' => "selection (if multiple)",
808
809
810
811
							       'order' => 9
							       },
					          'scope' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
812
							      'gettext_id' => "search scope",
813
814
815
816
							      'order' => 5
							      },
						  'timeout' => {'format' => '\w+',
								'default' => 30,
817
								'gettext_unit' => 'seconds',
salaun's avatar
salaun committed
818
								'gettext_id' => "connection timeout",
819
								'order' => 6
820
821
								},
						   'name' => {'format' => '.+',
salaun's avatar
salaun committed
822
							      'gettext_id' => "short name for this source",
823
824
							      'length' => 15,
							      'order' => 1
825
							      },
826
827
828
829
830
831
							      '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
832
										'default' => 'sslv3',
833
834
835
										'gettext_id' => 'SSL version',
										'order' => 2.5,
									    },
sympa-authors's avatar
sympa-authors committed
836
							      'ssl_ciphers' => {'format' => '.+',
837
838
839
840
841
842
843
										'default' => 'ALL',
										'gettext_id' => 'SSL ciphers used',
										'order' => 2.5,
									   },
							      
							      
									    
root's avatar
root committed
844
845
					      },
				     'occurrence' => '0-n',
salaun's avatar
salaun committed
846
				     'gettext_id' => "LDAP query inclusion",
salaun's avatar
salaun committed
847
				     'group' => 'data_source'
root's avatar
root committed
848
				     },
849
	    'include_ldap_2level_query' => {'format' => {'host' => {'format' => &tools::get_regexp('multiple_host_with_port'),
850
							     'occurrence' => '1',
salaun's avatar
salaun committed
851
							     'gettext_id' => "remote host",
852
853
854
855
							     'order' => 1
							     },
						  'port' => {'format' => '\d+',
							     'length' => 4,
salaun's avatar
salaun committed
856
							     'gettext_id' => "remote port",
857
							     'obsolete' => 1,
858
859
							     'order' => 2
							     },
860
						  'user' => {'format' => '.+',
salaun's avatar
salaun committed
861
							     'gettext_id' => "remote user",
862
863
							     'order' => 3
							     },
864
						  'passwd' => {'format' => '.+',
865
							       'length' => 10,
866
							       'field_type' => 'password',
salaun's avatar
salaun committed
867
							       'gettext_id' => "remote password",
868
869
							       'order' => 3
							       },
870
						  'suffix1' => {'format' => '.+',
salaun's avatar
salaun committed
871
							       'gettext_id' => "first-level suffix",
872
873
							       'order' => 4
							       },
874
						  'filter1' => {'format' => '.+',
875
876
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
877
							       'gettext_id' => "first-level filter",
878
879
880
881
							       'order' => 7
							       },
						  'attrs1' => {'format' => '\w+',
							      'length' => 15,
salaun's avatar
salaun committed
882
							      'gettext_id' => "first-level extracted attribute",
883
884
885
886
							      'order' => 8
							      },
						  'select1' => {'format' => ['all','first','regex'],
							       'default' => 'first',
salaun's avatar
salaun committed
887
							       'gettext_id' => "first-level selection",
888
889
890
891
							       'order' => 9
							       },
					          'scope1' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
892
							      'gettext_id' => "first-level search scope",
893
894
895
896
							      'order' => 5
							      },
						  'timeout1' => {'format' => '\w+',
								'default' => 30,
897
								'gettext_unit' => 'seconds',
salaun's avatar
salaun committed
898
								'gettext_id' => "first-level connection timeout",
899
900
901
902
903
								'order' => 6
								},
						  'regex1' => {'format' => '.+',
								'length' => 50,
								'default' => '',
salaun's avatar
salaun committed
904
								'gettext_id' => "first-level regular expression",
905
906
								'order' => 10
								},
907
						  'suffix2' => {'format' => '.+',
salaun's avatar
salaun committed
908
							       'gettext_id' => "second-level suffix template",
909
910
							       'order' => 11
							       },
911
						  'filter2' => {'format' => '.+',
912
913
							       'length' => 50,
							       'occurrence' => '1',
salaun's avatar
salaun committed
914
							       'gettext_id' => "second-level filter template",
915
916
917
918
919
							       'order' => 14
							       },
						  'attrs2' => {'format' => '\w+',
							      'length' => 15,
							      'default' => 'mail',
salaun's avatar
salaun committed
920
							      'gettext_id' => "second-level extracted attribute",
921
922
923
924
							      'order' => 15
							      },
						  'select2' => {'format' => ['all','first','regex'],
							       'default' => 'first',
salaun's avatar
salaun committed
925
							       'gettext_id' => "second-level selection",
926
927
928
929
							       'order' => 16
							       },
					          'scope2' => {'format' => ['base','one','sub'],
							      'default' => 'sub',
salaun's avatar
salaun committed
930
							      'gettext_id' => "second-level search scope",
931
932
933
934
							      'order' => 12
							      },
						  'timeout2' => {'format' => '\w+',
								'default' => 30,
935
								'gettext_unit' => 'seconds',
salaun's avatar
salaun committed
936
								'gettext_id' => "second-level connection timeout",
937
938
939
940
941
								'order' => 13
								},
						  'regex2' => {'format' => '.+',
								'length' => 50,
								'default' => '',
salaun's avatar
salaun committed
942
								'gettext_id' => "second-level regular expression",
943
								'order' => 17
944
945
								},
						   'name' => {'format' => '.+',
salaun's avatar
salaun committed
946
							      'gettext_id' => "short name for this source",
947
948
							      'length' => 15,
							      'order' => 1
949
950
951
952
953
954
955
956
957
958
959
							      },
							      '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
960
							      'ssl_ciphers' => {'format' => '.+',
961
962
963
964
										'default' => 'ALL',
										'gettext_id' => 'SSL ciphers used',
										'order' => 2.5,
									    },
965

966
967
					      },
				     'occurrence' => '0-n',
salaun's avatar
salaun committed
968
				     'gettext_id' => "LDAP 2-level query inclusion",
969
970
				     'group' => 'data_source'
				     },
971
	    'include_list' => {'format' => &tools::get_regexp('listname').'(\@'.&tools::get_regexp('host').')?',
root's avatar
root committed
972
			       'occurrence' => '0-n',
salaun's avatar
salaun committed
973
			       'gettext_id' => "List inclusion",
salaun's avatar
salaun committed
974
			       'group' => 'data_source'
root's avatar
root committed
975
			       },
976
	    'include_remote_sympa_list' => {'format' => {'host' => {'format' => &tools::get_regexp('host'),
977
							    'occurrence' => '1',
salaun's avatar
salaun committed
978
							    'gettext_id' => "remote host",
979
980
981
982
983
							    'order' => 1
							    },
							 'port' => {'format' => '\d+',
							     'default' => 443,
							     'length' => 4,
salaun's avatar
salaun committed
984
							     'gettext_id' => "remote port",
985
986
987
988
989
							     'order' => 2
							     },
							 'path' => {'format' => '\S+',
			                                     'length' => 20,
			                                     'occurrence' => '1',
salaun's avatar
salaun committed
990
			                                     'gettext_id' => "remote path of sympa list dump",
991
992
993
994
							     'order' => 3 

			                                     },
                                                         'cert' => {'format' => ['robot','list'],
salaun's avatar
salaun committed
995
							           'gettext_id' => "certificate for authentication by remote Sympa",
996
								   'default' => 'list',
997
998
999
								    'order' => 4
								    },
							   'name' => {'format' => '.+',
salaun's avatar
salaun committed
1000
								      'gettext_id' => "short name for this source",