Giampaolo Tomassoni wrote:

Which kind of algorithm you use for address "massacring"?

To see it in context, read the code at
http://whatever.frukt.org/mimedefangfilter.text.shtml

The following sub routine is the main part of the mail address changing:
---8<---
sub greylist_strip_mail($$$) {
        my($a,$d,$s) = @_;
        $a = address_strip($a);
        my $au = $a;
        my $ad = $a;
        $ad =~ s/.*@([EMAIL PROTECTED])$/$1/;
        $au =~ s/@[EMAIL PROTECTED]//;
        if ($d) {
                $au = "*";
        } elsif ($s) {
                $au =~ s/(.+)\+.*$/$1/;
                my $aut;
                my $autt = $au;
                do {
                        $aut = $autt;
                        $autt =~ 
s/^(|.*[^a-z0-9])[a-f0-9]*\d[a-f0-9]*(|[^a-z0-9].*)$/$1#$2/;
                } until ($autt eq $aut);
                $au = $aut if ($aut =~ /[a-z0-9]/);
                #$au =~ s/[^-a-z0-9_.#]/?/g;
        }
        return greylist_strip($au."@".$ad);
}
---8<---

Below are two examples where parts of the sender address has been replaced 
before using in the greylist:
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Regards
/Jonas
--
Jonas Eckerman, FSDB & Fruktträdet
http://whatever.frukt.org/
http://www.fsdb.org/
http://www.frukt.org/

Reply via email to