1#!/usr/local/bin/perl
2
3# If located in a lib path, this module will be loaded and called by ASSP before sending BlockReports.
4# ASSP will call the sub modify of this module.
5# The complete BlockReport mail will be in 'shift' or $_[0]. The module has to return the new contents.
6
7package BlockReport::modify;
8use strict;
9use re 'eval';
10
11sub modify {
12    my $bl = shift;
13
14    my %toReplace = (       # define what is to be replaced
15#                     &makeRe('powered by ASSP') =>  'Powered by Synergy',
16#                     &makeRe("request ASSP on $main::myName to resend") =>  'Request Synergy Spam Filtering to resend',
17);
18
19    while (my ($k,$v) = each %toReplace) {
20        $bl =~ s/$k/$v=\n/g;
21    }
22
23    return $bl;
24}
25
26sub makeRe {
27    my $string = shift;
28    my $le = "(?:[=]\n)?";   # HTML line end
29    $string =~ s/(.)/$1$le/go;  # a HTML line end could follow any character
30    $string =~ s/\Q$le\E$//o;
31    return qr/$string/;
32}
33
341; # keep this !
35