Author: robert
Date: Fri May 16 20:52:00 2008
New Revision: 909

Modified:
   trunk/log/run
   trunk/plugins/spamassassin
   trunk/plugins/uribl
   trunk/qpsmtpd
   trunk/run

Log:
hostnames come in lower case, and might even be longer than 8 characters


Modified: trunk/log/run
==============================================================================
--- trunk/log/run       (original)
+++ trunk/log/run       Fri May 16 20:52:00 2008
@@ -1,5 +1,5 @@
 #! /bin/sh
 export LOGDIR=./main
 mkdir -p $LOGDIR
-exec multilog t s1000000 n20 $LOGDIR
+exec multilog t s10000000 n40 $LOGDIR
 

Modified: trunk/plugins/spamassassin
==============================================================================
--- trunk/plugins/spamassassin  (original)
+++ trunk/plugins/spamassassin  Fri May 16 20:52:00 2008
@@ -67,6 +67,10 @@
 
 =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
@@ -96,6 +100,7 @@
   $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
@@ -137,6 +142,14 @@
   $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($>);
@@ -186,6 +199,7 @@
 
   }
   my $tests = <SPAMD>;
+  alarm 0;
   $tests =~ s/\015//;  # hack for outlook
   $flag = $flag eq 'True' ? 'Yes' : 'No';
   $self->log(LOGDEBUG, "check_spam: finished reading from spamd");

Modified: trunk/plugins/uribl
==============================================================================
--- trunk/plugins/uribl (original)
+++ trunk/plugins/uribl Fri May 16 20:52:00 2008
@@ -323,11 +323,11 @@
             }
         }
         while ($l =~ m{
-            ([Ww]{3,3}\.[\w\-.]+\.[a-zA-Z]{2,8}|    # www.hostname
+            ([Ww]{3,3}\.[\w\-.]+\.[a-zA-Z]{2,32}|    # www.hostname
              [a-zA-Z0-9][a-zA-Z0-9\-.]+\.           # hostname.   ...
                (?:com|net|org|biz|info|[a-zA-Z]{2,2}))(?!\w)  # (cc)TLD
-            }gx) {
-            my $host = $1;
+            }gix) {
+            my $host = lc $1;
             my @host_domains = split /\./, $host;
             $self->log(LOGDEBUG, "uribl: matched 'www.' hostname $host");
 
@@ -352,9 +352,9 @@
         while ($l =~ m{
             \w{3,16}:/+                 # protocol
             (?:\S+@)?                   # user/pass
-            ([\w\-.]+\.[a-zA-Z]{2,8})   # hostname
+            ([\w\-.]+\.[a-zA-Z]{2,32})   # hostname
             }gx) {
-            my $host = $1;
+            my $host = lc $1;
             my @host_domains = split /\./, $host;
             $self->log(LOGDEBUG, "uribl: matched full URI hostname $host");
 

Modified: trunk/qpsmtpd
==============================================================================
--- trunk/qpsmtpd       (original)
+++ trunk/qpsmtpd       Fri May 16 20:52:00 2008
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -Tw
+#!/pkg/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/
 #

Modified: trunk/run
==============================================================================
--- trunk/run   (original)
+++ trunk/run   Fri May 16 20:52:00 2008
@@ -1,8 +1,42 @@
 #!/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

Reply via email to