Skip to Content.
Sympa Menu

devel - patch for sympa.pl special aliases handling

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Sergiy Zhuk <address@concealed>
  • To: address@concealed
  • Subject: patch for sympa.pl special aliases handling
  • Date: Fri, 15 Mar 2002 16:20:15 -0800 (PST)

hi

So, we have list_check_suffixes which sympa admins can set to whatever
service aliases they use on per robot basis.
sympa.pl, on the other hand is always trying to interpret the list name
with hardcoded aliases.
So, if you only have '-owner' and '-unsubscribe' service aliases according
to list_check_suffixes, it will still check for '-editor' too, and instead
of sending the message to sample-editor mail list, it will try to forward
the message to the editors of list <sample>.

The attached patch will check the service aliases against
list_check_suffixes and will only process the service alias if it's defined
in list_check_suffixes.

thanks

--
rgds,
serge

--- sympa.pl.orig Fri Mar 15 15:28:28 2002
+++ sympa.pl Fri Mar 15 16:10:31 2002
@@ -394,7 +394,9 @@
}
# do_log('debug2', "listname %s robot %s", $t_listname,$t_robot);

- if ($t_listname =~
/^(\S+)-(request|owner|editor|subscribe|unsubscribe)$/) {
+ my $regx = $Conf{'robots'}{$robot}{'list_check_suffixes'} ||
$Conf{'list_check_suffixes'};
+ $regx =~ s/,/\|/g;
+ if ($t_listname =~ /^(\S+)-(${regx})$/) {
($t_listname, $type) = ($1, $2);
}

@@ -663,6 +665,18 @@
do_log('debug', "message is signed, signature is checked");
}

+ # only allow commands which have aliases (list_check_suffixes)
+ my $regx;
+ my @reg;
+ my $word;
+ my $suffixes = $Conf{'robots'}{$robot}{'list_check_suffixes'} ||
$Conf{'list_check_suffixes'};
+ undef @reg;
+ foreach $word ('owner','request','editor')
+ {
+ push @reg,$word if ($suffixes =~ /(^|,)${word}(,|$)/);
+ }
+ $regx = join('|',@reg);
+
if ($rcpt =~ /^listmaster(\@(\S+))?$/) {
$status = &DoForward('sympa', 'listmaster', $robot, $msg, $file,
$sender);

@@ -672,7 +686,7 @@
$status = &DoCommand($rcpt, $robot, $msg, $file);

## forward mails to <list>-request <list>-owner etc
- }elsif ($rcpt =~ /^(\S+)-(request|owner|editor)(\@(\S+))?$/o) {
+ }elsif ($rcpt =~ /^(\S+)-(${regx})(\@(\S+))?$/o) {
my ($name, $function) = ($1, $2);

## Simulate Smartlist behaviour with command in subject


  • patch for sympa.pl special aliases handling, Sergiy Zhuk, 03/16/2002

Archive powered by MHonArc 2.6.19+.

Top of Page