freebsd-ports/mail/ricochet/files/patch-ricochet
Andrey A. Chernov 6eb81045c2 Strip only leading/trailing spaces when reading config values
(mainly for FROM_EMAIL)
Add > before first From_ header of spam message to avoid mail splitting
here by some MUAs.
2003-10-08 02:57:00 +00:00

41 lines
1.6 KiB
Text

--- ricochet.orig Tue Jun 24 22:40:18 2003
+++ ricochet Wed Oct 8 06:42:08 2003
@@ -566,15 +566,14 @@
my ( $domain ) = @_;
$ua = new LWP::UserAgent;
$ua->agent("Ricochet/0.1 " . $ua->agent);
- my $req = new HTTP::Request POST => 'http://www.abuse.net/lookup.phtml';
- $req->content_type('application/x-www-form-urlencoded');
- $req->content("DOMAIN=$domain");
+ my $req = new HTTP::Request GET => "http://www.abuse.net/lookup.phtml?DOMAIN=$domain";
+ $ua->timeout(20);
my $res = $ua->request($req);
if ($res->is_success) {
my $content = $res->content;
return undef if $content =~ /no information for this domain/;
- my @matches = $content =~ /(\S+\@\S+)\s*<BR>/ig;
+ my @matches = $content =~ /<tt>(\S+\@\S+)<\/tt>/g;
return \@matches;
} else {
return undef;
@@ -607,13 +606,17 @@
sub initialize {
my $self = shift;
- my $rc = "$ENV{RICOCHET}" || "$ENV{HOME}/.ricochet"; $rc .= "/ricochetrc";
+ my $rc = "$ENV{RICOCHET}" || -d "$ENV{HOME}/.ricochet" ? "$ENV{HOME}/.ricochet" : "%%PREFIX%%/share/ricochet";
+ $rc .= "/ricochetrc";
Carp::croak "** Ricochet configuration file $rc doesn't exist. Aborting.\n" unless -e $rc;
open (RC, $rc);
grep {
chomp;
s/#.*$//;
- my ($field, $value) = split /:/, $_, 2; $value =~ s/\s//g; $field =~ s/\s//g;
+ my ($field, $value) = split /:/, $_, 2;
+ $value =~ s/^\s+//;
+ $value =~ s/\s+$//;
+ $field =~ s/\s//g;
$self->{$field} = $value unless $field ne "SENDMAIL" && defined $self->{$field};
} (<RC>);
close RC;