Skip to Content.
Sympa Menu

devel - [sympa-dev] Re: Re: Family List instantiation

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Olivier Salaün - CRU <address@concealed>
  • To: sympa dev <address@concealed>
  • Cc: Thomas Berry <address@concealed>
  • Subject: [sympa-dev] Re: Re: Family List instantiation
  • Date: Thu, 26 Apr 2007 10:41:17 +0200

David has let me know that I sent an empty patch, soory about that.
Attached is the reel patch.

The patch does (or should) trigger automatic lists update when a message is send for an existing automatic list.

Olivier Salaün - CRU wrote:
Hi Thomas,

Is this message related to your previous needs, ie updating automatic lists ?
If so I would suggest you add some code to sympa::DoFile(), see attached patch.
Note however that I did not test this patch ; it is just intended as a bootstrap for you.

Let us know what code you eventually add.

Thomas Berry wrote:
I'm trying to follow the logic of the automatic list creation process, but have not been able to identify how Sympa generates an import file based on a Family's configuration (config.tt2).

All Sympa methods that deal with the creation and modification of lists require an import file, but I can find no code that describes how the automatic list creation process creates the initial import file for a new mailing list.

Any help to point me in the direction would be greatly appreciated.


*** sympa.pl	2007-04-26 10:23:03.000000000 +0200
--- sympa.pl	2007-04-26 10:23:03.000000000 +0200
***************
*** 1160,1166 ****
  	$list_address = $name.'@'.$host;
      }else {
  	$list = new List ($listname, $robot);
! 	unless (defined $list) {
  	    unless ($dyn_list_family) {
  		&do_log('err', 'sympa::DoFile() : list %s does not exist',$listname);
  		&report::reject_report_msg('user','list_unknown',$sender,{'listname' => $listname,'message' => $message},$robot,$message->{'msg_as_string'},'');
--- 1160,1192 ----
  	$list_address = $name.'@'.$host;
      }else {
  	$list = new List ($listname, $robot);
! 
! 	if (defined $list) {
! 	    ## Automatic mailing lists should be updated
! 	    if ($dyn_list_family) {
! 
! 		my $dyn_family;
! 		unless ($dyn_family = new Family($dyn_list_family,$robot)) {
! 		    &do_log('err', "Failed to process $file : family $dyn_list_family does not exist, impossible to create the dynamic list.");
! 		    &List::send_notify_to_listmaster('automatic_list_creation_failed',$robot,["Failed to process $file : family $dyn_list_family does not exist, impossible to create the dynamic list."]);
! 		    &report::reject_report_msg('user','list_unknown',$sender,{'listname' => $listname,'message' => $message},$robot,$message->{'msg_as_string'},'');
! 		    return undef;
! 		}
! 
! 		my $result = $dyn_family->modify_list({listname=>$listname}, 1);
! 		unless (defined $result->{'ok'}) {
! 		    my $details = $result->{'string_error'} || $result->{'string_info'} || [];
! 		    &do_log('err', "Failed to add a dynamic list to the family %s : ", $dyn_list_family, join(';', @{$details}));
! 		    &report::reject_report_msg('user','list_unknown',$sender,{'listname' => $listname, 'list'=>{'name'=>$listname},'message' => $message},$robot,$message->{'msg_as_string'},'');
! 		    &List::send_notify_to_listmaster('automatic_list_creation_failed',$robot,["Failed to process $file."]);
! 		    return undef;
! 		}
! 
! 		$list = new List ($listname, $robot);		
! 	    }
! 
! 	}else {
  	    unless ($dyn_list_family) {
  		&do_log('err', 'sympa::DoFile() : list %s does not exist',$listname);
  		&report::reject_report_msg('user','list_unknown',$sender,{'listname' => $listname,'message' => $message},$robot,$message->{'msg_as_string'},'');



Archive powered by MHonArc 2.6.19+.

Top of Page