From 7169c9f0bcc4ae868c60374c80a84f43266c9707 Mon Sep 17 00:00:00 2001 From: Robert Spier Date: Sat, 17 May 2008 03:54:24 +0000 Subject: [PATCH] Revert accidental commit 909. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@910 958fd67b-6ff1-0310-b445-bb7760255be9 --- log/run | 2 +- plugins/spamassassin | 14 -------------- plugins/uribl | 10 +++++----- qpsmtpd | 2 +- run | 34 ---------------------------------- 5 files changed, 7 insertions(+), 55 deletions(-) diff --git a/log/run b/log/run index c25d679..5a4d84b 100755 --- a/log/run +++ b/log/run @@ -1,5 +1,5 @@ #! /bin/sh export LOGDIR=./main mkdir -p $LOGDIR -exec multilog t s10000000 n40 $LOGDIR +exec multilog t s1000000 n20 $LOGDIR diff --git a/plugins/spamassassin b/plugins/spamassassin index fcad2be..468b84a 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -67,10 +67,6 @@ The username to pass to spamd, if different from the user qpsmtpd runs as. =back -=item timeout [seconds] - -How long to wait for spamd? Default 60 seconds. - With both of the first options the configuration line will look like the following spamasssasin reject_threshold 18 munge_subject_threshold 8 @@ -100,7 +96,6 @@ sub register { $self->register_hook("data_post", "check_spam_munge_subject") if $self->{_args}->{munge_subject_threshold}; - $self->{timeout} = $self->{_args}->{timeout} || 60; } sub hook_data_post { # check_spam @@ -142,14 +137,6 @@ sub hook_data_post { # check_spam $self->log(LOGDEBUG, "check_spam: connected to spamd"); SPAMD->autoflush(1); - - local $SIG{ALRM} = sub { - $self->qp->respond(451, "An error occured while processing your mail. (#SA)"); - $self->log(LOGERROR, "spamassassin timeout"); - exit(1); - }; - - alarm $self->{timeout}; $transaction->body_resetpos; my $username = $self->{_args}->{spamd_user} || getpwuid($>); @@ -199,7 +186,6 @@ sub hook_data_post { # check_spam } my $tests = ; - alarm 0; $tests =~ s/\015//; # hack for outlook $flag = $flag eq 'True' ? 'Yes' : 'No'; $self->log(LOGDEBUG, "check_spam: finished reading from spamd"); diff --git a/plugins/uribl b/plugins/uribl index a9454ed..ac45966 100644 --- a/plugins/uribl +++ b/plugins/uribl @@ -323,11 +323,11 @@ sub data_handler { } } while ($l =~ m{ - ([Ww]{3,3}\.[\w\-.]+\.[a-zA-Z]{2,32}| # www.hostname + ([Ww]{3,3}\.[\w\-.]+\.[a-zA-Z]{2,8}| # www.hostname [a-zA-Z0-9][a-zA-Z0-9\-.]+\. # hostname. ... (?:com|net|org|biz|info|[a-zA-Z]{2,2}))(?!\w) # (cc)TLD - }gix) { - my $host = lc $1; + }gx) { + my $host = $1; my @host_domains = split /\./, $host; $self->log(LOGDEBUG, "uribl: matched 'www.' hostname $host"); @@ -352,9 +352,9 @@ sub data_handler { while ($l =~ m{ \w{3,16}:/+ # protocol (?:\S+@)? # user/pass - ([\w\-.]+\.[a-zA-Z]{2,32}) # hostname + ([\w\-.]+\.[a-zA-Z]{2,8}) # hostname }gx) { - my $host = lc $1; + my $host = $1; my @host_domains = split /\./, $host; $self->log(LOGDEBUG, "uribl: matched full URI hostname $host"); diff --git a/qpsmtpd b/qpsmtpd index 4cfafd2..b11a489 100755 --- a/qpsmtpd +++ b/qpsmtpd @@ -1,4 +1,4 @@ -#!/pkg/bin/perl -Tw +#!/usr/bin/perl -Tw # Copyright (c) 2001 Ask Bjoern Hansen. See the LICENSE file for details. # The "command dispatch" system is taken from colobus - http://trainedmonkey.com/colobus/ # diff --git a/run b/run index 542b360..aa23428 100755 --- a/run +++ b/run @@ -1,42 +1,8 @@ #!/bin/sh QMAILDUID=`id -u smtpd` NOFILESGID=`id -g smtpd` - -export SLOWROOT=/home/smtpd/slowforward - -method=forkserver - -# robert bumped up max-from-ip to 5 to make postfix on x6 happier. dropped connections to 40 from 90 - -if [ ${method} = "forkserver" ]; then - -exec /usr/local/bin/softlimit -m 25000000 \ - /pkg/bin/perl -T ./qpsmtpd-forkserver \ - --port 25 \ - --limit-connections 40 \ - --user smtpd \ - --listen-address `head -1 config/IP` \ - --max-from-ip 5 \ - 2>&1 - -elif [ ${method} = "prefork" ]; then - -exec /usr/local/bin/softlimit -m 25000000 \ - /pkg/bin/perl -T ./qpsmtpd-prefork \ - --port 25 \ - --user smtpd \ - --interface `head -1 config/IP` \ - --max-from-ip 3 \ - --children 90 \ - --idle-children 10 \ - --pretty-child \ - 2>&1 - -else - exec /usr/local/bin/softlimit -m 25000000 \ /usr/local/bin/tcpserver -c 10 -v -R -p \ -u $QMAILDUID -g $NOFILESGID `head -1 config/IP` smtp \ ./qpsmtpd 2>&1 -fi