Changeset 504


Ignore:
Timestamp:
May 5, 2010, 3:45:06 PM (10 years ago)
Author:
obibi
Message:

Licence added, see #12,

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postfix-logtools/poststat/anonymizer.pl

    r503 r504  
    11#!/usr/bin/env perl
    22
    3 # 2010-05-04 <vschmitt@bearstech.com>
     3# 2010-05-05 <vschmitt@bearstech.com>
     4
     5# This program is free software: you can redistribute it and/or modify
     6# it under the terms of the GNU General Public License as published by
     7# the Free Software Foundation, either version 3 of the License, or
     8# (at your option) any later version.
     9#
     10# This program is distributed in the hope that it will be useful,
     11# but WITHOUT ANY WARRANTY; without even the implied warranty of
     12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13# GNU General Public License for more details.
     14#
     15# You should have received a copy of the GNU General Public License
     16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    417
    518# Anonymizer for Postfix mail logs.
     
    1326    #and move dates to a fixed offset.
    1427    next unless s/^[a-zA-Z]+ \d+ ([\d:]{8}) \w+ postfix\//Apr 1 $1 host postfix\//;
    15     # Scramble ip addresses
     28    # Scramble ip addresses.
    1629    s| (([\d]{1,3}\.){3}[\d]{1,3}) | join('.', map {int($_/3)} split(/\./, $1)) |gex;
    17     # Scramble email addresses and message ids
     30    # Scramble email addresses and message ids.
    1831    s/<[^<]*@[^<]*(\.[a-zA-Z]{2,6})>/<name\@domain$1>/g;
    1932    s/(sasl_username=).*@.*(\.[a-zA-Z]{2,6})/$1name\@domain$2/g;
    2033    s/(message-id)=<.*@.*>/$1=<$1\@domain>/g;
    21     # Scramble hostnames
     34    # Scramble hostnames.
    2235    s/(hostname |from |connect to |client=|relay=)[\w\-\.]*/$1hostname/g
    2336        unless /(hostname |from |client=|relay=)(localhost|ns3\.bearstech\.net)/;
Note: See TracChangeset for help on using the changeset viewer.