From 84b7363018573043aa6f2e546dafab5eea6cecd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Sun, 9 Jul 2006 09:34:51 +0000 Subject: [PATCH] r3826@embla: ask | 2006-07-09 02:34:33 -0700 Enhance the spamassassin plugin to support connecting to a remote spamd process (Kjetil Kjernsmo). git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@651 958fd67b-6ff1-0310-b445-bb7760255be9 --- Changes | 3 +++ plugins/spamassassin | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index f1cbf6d..3368173 100644 --- a/Changes +++ b/Changes @@ -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). diff --git a/plugins/spamassassin b/plugins/spamassassin index 09fc796..0f3686a 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -44,11 +44,12 @@ might want to make another plugin that does this on a per user basis. 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 @@ sub hook_data_post { # check_spam 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