[svn:qpsmtpd] r651 - in branches/0.3x: . plugins

[email protected] Sun, 9 Jul 2006 02:34:52 -0700 (PDT)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: ask
Date: Sun Jul  9 02:34:51 2006
New Revision: 651

Modified:
   branches/0.3x/   (props changed)
   branches/0.3x/Changes
   branches/0.3x/plugins/spamassassin

Log:
 r3826@embla:  ask | 2006-07-09 02:34:33 -0700
   Enhance the spamassassin plugin to support connecting to a remote
   spamd process (Kjetil Kjernsmo). 


Modified: branches/0.3x/Changes
==============================================================================
--- branches/0.3x/Changes	(original)
+++ branches/0.3x/Changes	Sun Jul  9 02:34:51 2006
@@ -2,6 +2,9 @@
 
   Support "module" plugins ("My::Plugin" in the config/plugins file)
 
+  Enhance the spamassassin plugin to support connecting to a remote
+  spamd process (Kjetil Kjernsmo). 
+
   Add SSL encryption method to header to mirror other qmail/SSL patches.
   Add tls_before_auth to suppress AUTH unless TLS has already been 
   established (Robin Johnson).

Modified: branches/0.3x/plugins/spamassassin
==============================================================================
--- branches/0.3x/plugins/spamassassin	(original)
+++ branches/0.3x/plugins/spamassassin	Sun Jul  9 02:34:51 2006
@@ -44,11 +44,12 @@
 
 The default is to never munge the subject based on the SpamAssassin score.
 
-=item spamd_socket [/path/to/socket]
+=item spamd_socket [/path/to/socket|spamd.host:port]
 
-Beginning with Mail::SpamAssassin 2.60, it is possible to use Unix 
-domain sockets for spamd.  This is faster and more secure than using
-a TCP connection.
+Beginning with Mail::SpamAssassin 2.60, it is possible to use Unix
+domain sockets for spamd.  This is faster and more secure than using a
+TCP connection, but if you run spamd on a remote machine, you need to
+use a TCP connection.
 
 =item leave_old_headers [drop|rename|keep]
 
@@ -101,6 +102,10 @@
 
   my $remote  = 'localhost';
   my $port    = 783;
+  if ($self->{_args}->{spamd_socket} =~ /^([\w.-]+):(\d+)$/) {
+    $remote  = $1;
+    $port    = $2;
+  }
   if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
   die "No port" unless $port;
   my $iaddr   = inet_aton($remote) or