# (2) Added rules based paging (Stephen Johnson Nov 14, 1998)
# (3) Added checks against Acks and downtime (Stephen Johnson Mar 17, 1999)
#
-# $Id: spong-message.pl,v 1.31 2001/06/21 17:05:00 supermathie Exp $
+# $Id: spong-message.pl,v 1.32 2002/01/30 16:54:39 supermathie Exp $
use lib "@@LIBDIR@@";
&debug("Adding contact " . (ref($contact) eq 'HASH' ? "hash: " .
$contact->{'rcpt'} : ": " . $contact));
if ( ref($contact) eq 'HASH') {
-# foreach $rcpt ( split /[, \t]+/, $contact->{'rcpt'} ) {
- if ( $HUMANS{ $contact->{'rcpt'} }{'group'} ) {
+ $contact->{'rcpt'} =~ /^([^:]+)(:(.*))?/;
+ my($rcpt,$form) = ($1,$3);
+ if ( $HUMANS{$rcpt}{'group'} ) {
+ &debug("Found group: $rcpt");
my $groupee;
- foreach $groupee ( split /[, \t]+/,
- $HUMANS{ $contact->{'rcpt'} }{'group'} ) {
+ foreach $groupee ( split /[, \t]+/, $HUMANS{ $rcpt }{'group'} ) {
+ $groupee =~ /^([^:]+)(:(.*))?/;
+ my($groupee,$gform) = ($1,$3);
+ (defined $form and defined $gform and $form ne $gform) && next;
+ if (defined $form) { $groupee="$groupee:$form"; }
+ elsif (defined $gform) { $groupee="$groupee:$gform"; }
my $newent = {'rcpt' => $groupee};
if ( defined $contact->{'delay'} )
{ $newent->{'delay'} = $contact->{'delay'}; }
push @con, $contact;
}
# }
- } elsif ( $HUMANS{$contact}->{'group'} ) {
- my $groupee;
- foreach $groupee ( split /[, \t]+/, $HUMANS{$contact}->{'group'} ) {
- &add_contact(\@con, $groupee);
- }
} else {
- push @con,$contact;
+ $contact =~ /^([^:]+)(:(.*))?/;
+ my($rcpt,$form) = ($1,$3);
+ if ( $HUMANS{$rcpt}->{'group'} ) {
+ my $groupee;
+ foreach $groupee ( split /[, \t]+/, $HUMANS{$rcpt}->{'group'} ) {
+ $groupee =~ /^([^:]+)(:(.*))?/;
+ my($groupee,$gform) = ($1,$3);
+ (defined $form and defined $gform and $form ne $gform) && next;
+ if (defined $form) { $groupee="$groupee:$form"; }
+ elsif (defined $gform) { $groupee="$groupee:$gform"; }
+ &add_contact(\@con, $groupee);
+ }
+ } else {
+ push @con,$contact;
+ }
}
}