Skip to content

Commit

Permalink
Revert accidental commit 909.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@910 958fd67b-6ff1-0310-b445-bb7760255be9
  • Loading branch information
rspier authored and abh committed May 17, 2008
1 parent 6563dcc commit 7169c9f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 55 deletions.
2 changes: 1 addition & 1 deletion log/run
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
export LOGDIR=./main export LOGDIR=./main
mkdir -p $LOGDIR mkdir -p $LOGDIR
exec multilog t s10000000 n40 $LOGDIR exec multilog t s1000000 n20 $LOGDIR


14 changes: 0 additions & 14 deletions plugins/spamassassin
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ The username to pass to spamd, if different from the user qpsmtpd runs as.
=back =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 With both of the first options the configuration line will look like the following
spamasssasin reject_threshold 18 munge_subject_threshold 8 spamasssasin reject_threshold 18 munge_subject_threshold 8
Expand Down Expand Up @@ -100,7 +96,6 @@ sub register {
$self->register_hook("data_post", "check_spam_munge_subject") $self->register_hook("data_post", "check_spam_munge_subject")
if $self->{_args}->{munge_subject_threshold}; if $self->{_args}->{munge_subject_threshold};


$self->{timeout} = $self->{_args}->{timeout} || 60;
} }


sub hook_data_post { # check_spam sub hook_data_post { # check_spam
Expand Down Expand Up @@ -142,14 +137,6 @@ sub hook_data_post { # check_spam
$self->log(LOGDEBUG, "check_spam: connected to spamd"); $self->log(LOGDEBUG, "check_spam: connected to spamd");


SPAMD->autoflush(1); 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; $transaction->body_resetpos;
my $username = $self->{_args}->{spamd_user} || getpwuid($>); my $username = $self->{_args}->{spamd_user} || getpwuid($>);
Expand Down Expand Up @@ -199,7 +186,6 @@ sub hook_data_post { # check_spam


} }
my $tests = <SPAMD>; my $tests = <SPAMD>;
alarm 0;
$tests =~ s/\015//; # hack for outlook $tests =~ s/\015//; # hack for outlook
$flag = $flag eq 'True' ? 'Yes' : 'No'; $flag = $flag eq 'True' ? 'Yes' : 'No';
$self->log(LOGDEBUG, "check_spam: finished reading from spamd"); $self->log(LOGDEBUG, "check_spam: finished reading from spamd");
Expand Down
10 changes: 5 additions & 5 deletions plugins/uribl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ sub data_handler {
} }
} }
while ($l =~ m{ 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. ... [a-zA-Z0-9][a-zA-Z0-9\-.]+\. # hostname. ...
(?:com|net|org|biz|info|[a-zA-Z]{2,2}))(?!\w) # (cc)TLD (?:com|net|org|biz|info|[a-zA-Z]{2,2}))(?!\w) # (cc)TLD
}gix) { }gx) {
my $host = lc $1; my $host = $1;
my @host_domains = split /\./, $host; my @host_domains = split /\./, $host;
$self->log(LOGDEBUG, "uribl: matched 'www.' hostname $host"); $self->log(LOGDEBUG, "uribl: matched 'www.' hostname $host");


Expand All @@ -352,9 +352,9 @@ sub data_handler {
while ($l =~ m{ while ($l =~ m{
\w{3,16}:/+ # protocol \w{3,16}:/+ # protocol
(?:\S+@)? # user/pass (?:\S+@)? # user/pass
([\w\-.]+\.[a-zA-Z]{2,32}) # hostname ([\w\-.]+\.[a-zA-Z]{2,8}) # hostname
}gx) { }gx) {
my $host = lc $1; my $host = $1;
my @host_domains = split /\./, $host; my @host_domains = split /\./, $host;
$self->log(LOGDEBUG, "uribl: matched full URI hostname $host"); $self->log(LOGDEBUG, "uribl: matched full URI hostname $host");


Expand Down
2 changes: 1 addition & 1 deletion qpsmtpd
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/pkg/bin/perl -Tw #!/usr/bin/perl -Tw
# Copyright (c) 2001 Ask Bjoern Hansen. See the LICENSE file for details. # Copyright (c) 2001 Ask Bjoern Hansen. See the LICENSE file for details.
# The "command dispatch" system is taken from colobus - http://trainedmonkey.com/colobus/ # The "command dispatch" system is taken from colobus - http://trainedmonkey.com/colobus/
# #
Expand Down
34 changes: 0 additions & 34 deletions run
Original file line number Original file line Diff line number Diff line change
@@ -1,42 +1,8 @@
#!/bin/sh #!/bin/sh
QMAILDUID=`id -u smtpd` QMAILDUID=`id -u smtpd`
NOFILESGID=`id -g 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 \ exec /usr/local/bin/softlimit -m 25000000 \
/usr/local/bin/tcpserver -c 10 -v -R -p \ /usr/local/bin/tcpserver -c 10 -v -R -p \
-u $QMAILDUID -g $NOFILESGID `head -1 config/IP` smtp \ -u $QMAILDUID -g $NOFILESGID `head -1 config/IP` smtp \
./qpsmtpd 2>&1 ./qpsmtpd 2>&1


fi

0 comments on commit 7169c9f

Please sign in to comment.