diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-06-24 14:26:54 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-06-24 14:26:54 +0000 |
commit | 76727fac0c43bdbab5d7b1affda6c0a6dc0db117 (patch) | |
tree | 6f64dc34d0cec234693b1b9c20a88497c0988a64 | |
parent | a685f90180d936448fac9bc45536b1925e5002c6 (diff) | |
download | ports-76727fac0c43bdbab5d7b1affda6c0a6dc0db117.tar.gz ports-76727fac0c43bdbab5d7b1affda6c0a6dc0db117.zip |
Add geographical (3rd level) domains for .ru .su and .ua
Don't treat in-addr.arpa as hostname
Notes
Notes:
svn path=/head/; revision=83533
-rw-r--r-- | mail/ricochet/Makefile | 2 | ||||
-rw-r--r-- | mail/ricochet/files/patch-ricochet | 61 |
2 files changed, 57 insertions, 6 deletions
diff --git a/mail/ricochet/Makefile b/mail/ricochet/Makefile index 8c9b740f3689..7524b529a092 100644 --- a/mail/ricochet/Makefile +++ b/mail/ricochet/Makefile @@ -7,7 +7,7 @@ PORTNAME= ricochet PORTVERSION= 0.97 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= mail MASTER_SITES= http://vipul.net/perl/sources/spamcontrol/ricochet/ diff --git a/mail/ricochet/files/patch-ricochet b/mail/ricochet/files/patch-ricochet index 384f492e6304..024202c379bf 100644 --- a/mail/ricochet/files/patch-ricochet +++ b/mail/ricochet/files/patch-ricochet @@ -1,5 +1,5 @@ --- ricochet.orig Thu Feb 8 22:23:19 2001 -+++ ricochet Wed Jun 18 15:19:43 2003 ++++ ricochet Tue Jun 24 18:14:09 2003 @@ -128,7 +128,10 @@ ## List of receipients at ORIG_DOMAN ## besides the CONTACTS. @@ -119,6 +119,15 @@ } $self->debug (2, "+ Seems Authentic.\n"); +@@ -464,7 +497,7 @@ + my $email = $header->get ($_); chomp $email; + $email = _email ($email); + my $host = _host ($email); +- $self->{CONTACTS}->add ($email) if $email; ++ $self->{CONTACTS}->add ($email) if ($email && $host); + } @{$self->{EXTRA_EMAIL_HEADERS}}; + } + @@ -574,7 +607,8 @@ sub initialize { @@ -129,18 +138,55 @@ Carp::croak "** Ricochet configuration file $rc doesn't exist. Aborting.\n" unless -e $rc; open (RC, $rc); grep { -@@ -758,8 +792,8 @@ +@@ -639,7 +673,6 @@ + my ($cinfo, $list, @mails, %mailhash, $add); + + $domainname = _domain ($domainname); +- $domainname =~ y/A-Z/a-z/; + + $level = 0 unless $level; + +@@ -756,10 +789,37 @@ + ## FUNCTION Returns the domain part of the host. + ## --------------------------------------------------------------------------- ++my @geo_rusu = ( ++'adygeya','altai','amur','amursk','arkhangelsk','astrakhan','baikal', ++'bashkiria','belgorod','bir','bryansk','buryatia','cbg','chel','chelyabinsk', ++'chita','chukotka','chuvashia','cmw','dagestan','dudinka','e-burg','fareast', ++'grozny','irkutsk','ivanovo','izhevsk','jamal','jar','joshkar-ola','k-uralsk', ++'kalmykia','kaluga','kamchatka','karelia','kazan','kchr','kemerovo', ++'khabarovsk','khakassia','khv','kirov','kms','koenig','komi','kostroma', ++'krasnoyarsk','kuban','kurgan','kursk','kustanai','kuzbass','lipetsk', ++'magadan','magnitka','mari-el','mari','marine','mordovia','mosreg','msk', ++'murmansk','mytis','nakhodka','nalchik','nkz','nnov','norilsk','nov', ++'novosibirsk','nsk','omsk','orenburg','oryol','oskol','palana','penza','perm', ++'pskov','ptz','pyatigorsk','rnd','rubtsovsk','ryazan','sakhalin','samara', ++'saratov','simbirsk','smolensk','snz','spb','stavropol','stv','surgut', ++'syzran','tambov','tatarstan','tom','tomsk','tsaritsyn','tsk','tula','tuva', ++'tver','tyumen','udm','udmurtia','ulan-ude','vdonsk','vladikavkaz','vladimir', ++'vladivostok','volgograd','vologda','voronezh','vrn','vyatka','yakutia', ++'yamal','yaroslavl','yekaterinburg','yuzhno-sakhalinsk','zgrad' ++); ++ sub _domain { my $host = shift; $host =~ y/A-Z/a-z/; my $domain = ''; - ($domain) = $host =~ /([\da-z\-]+\.[a-z]{2,3}\.[a-z]{2})$/; - ($domain) = $host =~ /([\da-z\-]+\.[a-z]{2,3})$/ unless $domain; -+ ($domain) = $host =~ /([\da-z\-]+\.(edu?|com?|net?|org?|gov?|int|ac|pp)\.[a-z]{2})$/; ++ return undef if ($host =~ /\.in-addr\.arpa$/); ++ ($domain) = $host =~ /([\da-z\-]+\.(kiev|kharkiv|dp|zp)\.ua)$/; ++ ($domain) = $host =~ /([\da-z\-]+\.(edu?|com?|net?|org?|gov?|int|ac|pp)\.[a-z]{2})$/ unless $domain; ++ if (!$domain && $host =~ /\.[rs]u$/) { ++ for (@geo_rusu) { ++ ($domain) = $host =~ /([\da-z\-]+\.$_\.[rs]u)$/; ++ last if ($domain); ++ } ++ } + ($domain) = $host =~ /([\da-z\-]+\.[a-z]{2,4})$/ unless $domain; return $domain ? $domain : undef; } -@@ -769,7 +803,7 @@ +@@ -769,10 +829,11 @@ ## --------------------------------------------------------------------------- sub _host { @@ -148,4 +194,9 @@ + my $hostre = '[\dA-Za-z\-\.]+\.[A-Za-z]{2,4}(?=[^A-Za-z\-\d]|$)'; my $data = shift; my ($host) = $data =~ /($hostre)/; - return $host if $host ne ''; +- return $host if $host ne ''; ++ return undef if ($host =~ /\.in-addr\.arpa$/); ++ return $host ? $host : undef; + } + + ## -- SUBROUTINE _email () -------------------------------------- INTERNAL -- |