Git Product home page Git Product logo

spampd's Introduction

        

Featured Repositories
Featured Contributions

spampd's People

Contributors

grembo avatar kevinoid avatar kritzefitz avatar mpaperno avatar roubert avatar stoecker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

spampd's Issues

auto-whitelist ended up being owned by root

Hi Maxim,

I've just discovered something strange: I wanted to change my SA config to use AWL instead of TxRep for some reason. Therefore I've modified the SA config and restarted spampd.

Then when checking the homedir of spampd, I found these two new files being owned by root

/var/spool/spampd/auto-whitelist
/var/spool/spampd/auto-whitelist.mutex

Of course this didn't work and I had to manually change ownership of the files to spampd to make it work.

This happens when starting spampd like so as root: spampd --user=spampd --group=spampd...

I guess that there is something initializing SA on startup before the UID/GID change happens.

If there is an easy fix I'd like to fix it, otherwise it's not really a deal breaker. Any ideas where exactly it goes wrong?

Thanks,
Simon

spampd tries to use Unix socket when not defined

I'm running spampd with Perl 5.22.3, and this line is returning true even though $socket is actually not set anywhere.

I'm not sure if it's related to the version of Perl I'm using, but basically if I do:

my $x = defined $socket; 
print "'${x}' '${socket}'\n";

I get '1' ''.

This causes the |unix string to be added to @ports, resulting in the following error: Could not determine port number from host [*]:unix.

Any idea why this happens and how to fix it? I'd like to help but I really don't know much about Perl.

Log runtime configuration on SIGUSR2

Hi Maxim,

I'm coming back to you with an idea to improve configuration management.

While we can use spampd --show config to show the current config, it shows only the config options defined in config files.

Would it be possible to add a signal handler so that one can send a SIGUSR2 to the master spampd process to it will send the current runtime config to the log? (The idea is shamelessly taken from OpenVPN which logs statistics on SIGUSR2)

That way it would be possible to see what spampd really runs, even with a combination of command options and config files.

Unfortunately I don't know perl enough to do this myself. I saw that Net::Server handles HUP and provides a hook for it but is it possible to handle USR2 with Net::Server?

Thanks,
Simon

Socket Connect Failure: Connection Refused

I have setup a mail server using mail-in-a-box, which in turn installed spampd. spampd is running in the background, but all incoming emails don't get delivered to the respective inbox.

Upon inspecting the log found out the following line which causes this to fail

spampd[1944]: WARNING!! Error in process_request eval block: /usr/sbin/spampd: socket connect failure: Connection refused

it appears that the application is not listening on port 10026.

syntax error at /usr/sbin/spampd line 1386, near "}{"

Hi,

I've tried to update my spampd packages to 2.60 but got this error on RHEL7:

spampd: syntax error at /usr/sbin/spampd line 1386, near "}{"
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1387.
spampd: Global symbol "$k" requires explicit package name at /usr/sbin/spampd line 1388.
spampd: Global symbol "$k" requires explicit package name at /usr/sbin/spampd line 1388.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1389.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1389.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1389.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1390.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1390.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1390.
spampd: Global symbol "$k" requires explicit package name at /usr/sbin/spampd line 1391.
spampd: Global symbol "$v" requires explicit package name at /usr/sbin/spampd line 1391.
spampd: Global symbol "$exit" requires explicit package name at /usr/sbin/spampd line 1394.
spampd: Global symbol "$exit" requires explicit package name at /usr/sbin/spampd line 1394.
spampd: syntax error at /usr/sbin/spampd line 1395, near "}"
spampd: /usr/sbin/spampd has too many errors.

Commenting out the offending lines makes it start up:

--- /usr/sbin/spampd.orig	2021-07-28 17:00:23.000000000 +0200
+++ /usr/sbin/spampd	2021-07-29 12:25:18.402015655 +0200
@@ -1382,14 +1382,14 @@
   print "# Configuration options for ".ref($self)." v".$self->VERSION." with ".$type." values.\n";
   print "# This format is suitable as a configuration file. Just remove\n".
         "# the '#' marks (comment characters) and change values as needed.\n\n" if $exit > -1;
-  for my $k (sort keys %{$opts}) {
-    my $v = %{$opts}{$k};
-    next if ref($v) !~ /SCALAR|REF/;
-    $k = $1 if $k =~ /([\w-]+).*/;
-    $v = defined(${$v}) ? ${$v} : "(undefined)";
-    $v = join(":", @{$v}) if ref($v) eq 'ARRAY';
-    printf("# %-24s %s\n", $k, $v);
-  }
+#  for my $k (sort keys %{$opts}) {
+#    my $v = %{$opts}{$k};
+#    next if ref($v) !~ /SCALAR|REF/;
+#    $k = $1 if $k =~ /([\w-]+).*/;
+#    $v = defined(${$v}) ? ${$v} : "(undefined)";
+#    $v = join(":", @{$v}) if ref($v) eq 'ARRAY';
+#    printf("# %-24s %s\n", $k, $v);
+#  }

Maybe this is because perl is too old (perl-5.16.3)?
Do you have an idea how to make this work here?

Thank you from a long time spampd user,
Simon

Logs end up in different place when running 2.60 with --nodetach than with older versions.

Hi Maxim,

While working on my spampd-2.60 RPMs for RHEL7 and later, I wondering how to get the logging the same way than it was with older versions up to 2.53.

On these system, systemd is starting spampd with the option --nodetach so that spampd doesn't daemonize and systemd can to the baby sitting. Unfortunately starting with 2.60, I don't get the log messages in /var/log/maillog anymore but they go to /var/log/messages instead.

The reason seems to be that with --nodetach on 2.60, messages are not going to syslog anymore but to STDERR, while with older versions, they still went to syslog.

Is this wanted or can it be changed to how it has worked before?

Thanks,
Simon

Feature request: LICENSE file

Could you add a LICENSE file at the root of your source code repository? That would make my employer's lawyers happy, and they'd let me send you pull requests.

`spampd` exit code 1 with no apparent error in debug logs

Logs

Jun 27 13:01:40.726 [35782] dbg: dns: entering helper-app run mode
Jun 27 13:01:43.820 [35782] dbg: dns: leaving helper-app run mode
Jun 27 13:01:43.821 [35782] dbg: razor2: part=0 noresponse
Jun 27 13:01:43.821 [35782] dbg: razor2: results: spam? 0
Jun 27 13:01:43.821 [35782] dbg: razor2: results: engine 8, highest cf score: 0
Jun 27 13:01:43.821 [35782] dbg: razor2: results: engine 4, highest cf score: 0
Jun 27 13:01:43.822 [35782] dbg: rules: running meta tests; score so far=1.206
Jun 27 13:01:43.822 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 346 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_20_1
Jun 27 13:01:43.822 [35782] dbg: rules: run_generic_tests - compiling eval code: meta, priority 20
Jun 27 13:01:43.822 [35782] dbg: rules: compiled meta tests
Jun 27 13:01:43.823 [35782] dbg: check: running tests for priority: 30
Jun 27 13:01:43.823 [35782] dbg: rules: running head tests; score so far=1.206
Jun 27 13:01:43.823 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 343 chars of Mail::SpamAssassin::Plugin::Check::_head_tests_30_1
Jun 27 13:01:43.824 [35782] dbg: rules: run_generic_tests - compiling eval code: head, priority 30
Jun 27 13:01:43.824 [35782] dbg: rules: compiled head tests
Jun 27 13:01:43.824 [35782] dbg: rules: running body tests; score so far=1.206
Jun 27 13:01:43.824 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 286 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_30_1
Jun 27 13:01:43.825 [35782] dbg: rules: run_generic_tests - compiling eval code: body, priority 30
Jun 27 13:01:43.825 [35782] dbg: rules: compiled body tests
Jun 27 13:01:43.825 [35782] dbg: rules: running uri tests; score so far=1.206
Jun 27 13:01:43.825 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 284 chars of Mail::SpamAssassin::Plugin::Check::_uri_tests_30_1
Jun 27 13:01:43.826 [35782] dbg: rules: run_generic_tests - compiling eval code: uri, priority 30
Jun 27 13:01:43.826 [35782] dbg: rules: compiled uri tests
Jun 27 13:01:43.826 [35782] dbg: rules: running body_eval tests; score so far=1.206
Jun 27 13:01:43.826 [35782] dbg: rules: running rawbody tests; score so far=1.206
Jun 27 13:01:43.826 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 292 chars of Mail::SpamAssassin::Plugin::Check::_rawbody_tests_30_1
Jun 27 13:01:43.827 [35782] dbg: rules: run_generic_tests - compiling eval code: rawbody, priority 30
Jun 27 13:01:43.827 [35782] dbg: rules: compiled rawbody tests
Jun 27 13:01:43.827 [35782] dbg: rules: running full tests; score so far=1.206
Jun 27 13:01:43.828 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 321 chars of Mail::SpamAssassin::Plugin::Check::_full_tests_30_1
Jun 27 13:01:43.828 [35782] dbg: rules: run_generic_tests - compiling eval code: full, priority 30
Jun 27 13:01:43.828 [35782] dbg: rules: compiled full tests
Jun 27 13:01:43.828 [35782] dbg: rules: running full_eval tests; score so far=1.206
Jun 27 13:01:43.829 [35782] dbg: rules: run_eval_tests - compiling eval code: 13, priority 30
Jun 27 13:01:43.829 [35782] dbg: util: current PATH is: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
Jun 27 13:01:43.830 [35782] dbg: util: executable for pyzor was found at /bin/pyzor
Jun 27 13:01:43.830 [35782] dbg: pyzor: pyzor is available: /bin/pyzor
Jun 27 13:01:43.830 [35782] dbg: util: secure_tmpfile created a temporary file /tmp/.spamassassin35782apwr0htmp
Jun 27 13:01:43.830 [35782] dbg: check: create_fulltext_tmpfile, written 1443 bytes to file /tmp/.spamassassin35782apwr0htmp
Jun 27 13:01:43.830 [35782] dbg: dns: entering helper-app run mode
Jun 27 13:01:43.831 [35782] dbg: pyzor: opening pipe: /bin/pyzor --homedir /etc/spamassassin/pyzor check < /tmp/.spamassassin35782apwr0htmp
Jun 27 13:01:43.834 [35783] dbg: util: get_user_groups: uid is 0
Jun 27 13:01:43.835 [35783] info: util: setuid: ruid=0 euid=0 rgid=0 0 egid=0 0
Jun 27 13:01:44.255 [35782] dbg: pyzor: [35783] finished: exit 1
Jun 27 13:01:44.255 [35782] dbg: pyzor: got response: public.pyzor.org:24441 (200, 'OK') 0 0
Jun 27 13:01:44.256 [35782] dbg: dns: leaving helper-app run mode
Jun 27 13:01:44.256 [35782] dbg: check: tagrun - tag PYZOR is now ready, value: Reported 0 times.
Jun 27 13:01:44.257 [35782] dbg: rules: running meta tests; score so far=1.206
Jun 27 13:01:44.257 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 346 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_30_1
Jun 27 13:01:44.257 [35782] dbg: rules: run_generic_tests - compiling eval code: meta, priority 30
Jun 27 13:01:44.257 [35782] dbg: rules: compiled meta tests
Jun 27 13:01:44.258 [35782] dbg: check: running tests for priority: 500
Jun 27 13:01:44.258 [35782] dbg: dns: harvest_dnsbl_queries
Jun 27 13:01:44.258 [35782] dbg: async: timing: 0.005 . askdns:A:compiling.spamassassin.taint.org.fresh.fmb.la.
Jun 27 13:01:44.259 [35782] dbg: rules: running head tests; score so far=1.206
Jun 27 13:01:44.259 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 345 chars of Mail::SpamAssassin::Plugin::Check::_head_tests_500_1
Jun 27 13:01:44.260 [35782] dbg: rules: run_generic_tests - compiling eval code: head, priority 500
Jun 27 13:01:44.260 [35782] dbg: rules: compiled head tests
Jun 27 13:01:44.260 [35782] dbg: rules: running body tests; score so far=1.206
Jun 27 13:01:44.260 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 288 chars of Mail::SpamAssassin::Plugin::Check::_body_tests_500_1
Jun 27 13:01:44.260 [35782] dbg: rules: run_generic_tests - compiling eval code: body, priority 500
Jun 27 13:01:44.261 [35782] dbg: rules: compiled body tests
Jun 27 13:01:44.261 [35782] dbg: rules: running uri tests; score so far=1.206
Jun 27 13:01:44.261 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 286 chars of Mail::SpamAssassin::Plugin::Check::_uri_tests_500_1
Jun 27 13:01:44.261 [35782] dbg: rules: run_generic_tests - compiling eval code: uri, priority 500
Jun 27 13:01:44.261 [35782] dbg: rules: compiled uri tests
Jun 27 13:01:44.262 [35782] dbg: rules: running rawbody tests; score so far=1.206
Jun 27 13:01:44.262 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 294 chars of Mail::SpamAssassin::Plugin::Check::_rawbody_tests_500_1
Jun 27 13:01:44.262 [35782] dbg: rules: run_generic_tests - compiling eval code: rawbody, priority 500
Jun 27 13:01:44.262 [35782] dbg: rules: compiled rawbody tests
Jun 27 13:01:44.263 [35782] dbg: rules: running full tests; score so far=1.206
Jun 27 13:01:44.263 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 323 chars of Mail::SpamAssassin::Plugin::Check::_full_tests_500_1
Jun 27 13:01:44.263 [35782] dbg: rules: run_generic_tests - compiling eval code: full, priority 500
Jun 27 13:01:44.263 [35782] dbg: rules: compiled full tests
Jun 27 13:01:44.263 [35782] dbg: rules: running meta tests; score so far=1.206
Jun 27 13:01:44.265 [35782] dbg: rules: meta test DIGEST_MULTIPLE has undefined dependency 'DCC_CHECK'
Jun 27 13:01:44.273 [35782] dbg: rules: meta test FSL_BULK_SIG has undefined dependency 'DCC_CHECK'
Jun 27 13:01:44.288 [35782] dbg: rules: flush_evalstr (add_evalstr) compiling 60050 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_500_1
Jun 27 13:01:44.296 [35782] dbg: rules: flush_evalstr (add_evalstr) compiling 60026 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_500_2
Jun 27 13:01:44.304 [35782] dbg: rules: flush_evalstr (add_evalstr) compiling 60114 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_500_3
Jun 27 13:01:44.312 [35782] dbg: rules: flush_evalstr (add_evalstr) compiling 61390 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_500_4
Jun 27 13:01:44.322 [35782] dbg: rules: flush_evalstr (run_generic_tests) compiling 22104 chars of Mail::SpamAssassin::Plugin::Check::_meta_tests_500_5
Jun 27 13:01:44.325 [35782] dbg: rules: run_generic_tests - compiling eval code: meta, priority 500
Jun 27 13:01:44.325 [35782] dbg: rules: compiled meta tests
Jun 27 13:01:44.328 [35782] dbg: check: is spam? score=4.368 required=5
Jun 27 13:01:44.328 [35782] dbg: check: tests=MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS
Jun 27 13:01:44.328 [35782] dbg: check: subtests=__BODY_TEXT_LINE,__DKIM_DEPENDABLE,__EMPTY_BODY,__E_LIKE_LETTER(160),__GATED_THROUGH_RCVD_REMOVER,__HAS_FROM,__HAS_MESSAGE_ID,__HAS_MSGID,__KHOP_NO_FULL_NAME,__LOWER_E(160),__MISSING_REF,__MISSING_REPLY,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__MSOE_MID_WRONG_CASE,__NONEMPTY_BODY,__NOT_SPOOFED,__SANE_MSGID,__SUBJECT_EMPTY,__SUBJ_SHORT,__TO_NO_ARROWS_R,__UNUSABLE_MSGID (Total Subtest Hits: 340 / Deduplicated Total Hits: 22)
Jun 27 13:01:44.329 [35782] dbg: check: tagrun - tag SENDERDOMAIN is still blocking action 2
Jun 27 13:01:44.329 [35782] dbg: check: tagrun - tag DKIMDOMAIN is still blocking action 1
Jun 27 13:01:44.329 [35782] dbg: check: tagrun - tag LASTEXTERNALHELO is still blocking action 0
Jun 27 13:01:44.330 [35782] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x558a1782bcc0) implements 'learner_close', priority 0

Command

/usr/sbin/spampd -d --setsid --pid=/var/run/spampd/spampd.pid --tagall --port=10025 --host=127.0.0.1 --relayport=10026 --relayhost=127.0.0.1 --children=3 --logsock=unix --maxsize=2000 --user=spampd --group=spampd

I'm trying to contain miab in docker and spampd would keep restarting, so I dug into it and found the command.
The command exits with 1 when I echo $?, but I can't seem to identify the issue from the logs.

The closest I can pick out is pyzor seems to exit with 1.

Would be most grateful if someone can point it out to me. Thank you.

Fails durring startup "Global symbol "$user" requires explicit package name "

I have just upgraded my version of spampd from 2.53 to 2.61 and it fails during startup.
When i restored /usr/local/sbin/spampd from a 2.53 snapshoot it worked again.
It reports:
”Global symbol "$user" requires explicit package name (did you forget to declare "my $user"?)”

uname -a
FreeBSD mailserver 12.2-RELEASE-p9 FreeBSD 12.2-RELEASE-p9 2ee62d665f0(HEAD) TRUENAS amd64

root@mailserver:~/spampd # cat /etc/passwd | grep spam
spamd:*:58:58:SpamAssassin user:/var/spool/spamd:/usr/sbin/nologin

root@mailserver:~/spampd # pkg info | grep p5
p5-Archive-Zip-1.68 Create, manipulate, read, and write Zip archive files
p5-Authen-NTLM-1.09_1 Perl5 NTLM authentication module
p5-Authen-SASL-2.16_1 Perl5 module for SASL authentication
p5-BerkeleyDB-0.64 Perl5 interface to the Berkeley DB package
p5-CGI-4.53 Handle Common Gateway Interface requests and responses
p5-Clone-0.45 Recursively copy Perl datatypes
p5-Convert-BinHex-1.125 Perl module to extract data from Macintosh BinHex files
p5-Convert-TNEF-0.18_2 Perl module to read TNEF files
p5-Convert-UUlib-1.70,1 Perl5 interface to the uulib library (a.k.a. uudeview/uuenview)
p5-Crypt-OpenSSL-Bignum-0.09 OpenSSL's multiprecision integer arithmetic
p5-Crypt-OpenSSL-RSA-0.32_1 Perl5 module to RSA encode and decode strings using OpenSSL
p5-Crypt-OpenSSL-Random-0.15 Perl5 interface to the OpenSSL pseudo-random number generator
p5-Crypt-SSLeay-0.72_3 Perl5 interface to allow p5-libwww LWP to make https connections
p5-DBD-mysql-4.050_1 MySQL driver for the Perl5 Database Interface (DBI)
p5-DBI-1.643 Perl5 Database Interface, required for DBD::* modules
p5-Digest-HMAC-1.04 Perl5 interface to HMAC Message-Digest Algorithms
p5-Encode-Detect-1.01_1 Encode::Encoding subclass that detects the encoding of data
p5-Encode-Locale-1.05 Determine the locale encoding
p5-Error-0.17029 Error/exception handling in object-oriented programming style
p5-File-Listing-6.14 Parse directory listings
p5-Filter-1.60 Number of source filters for perl5 programs
p5-GSSAPI-0.28_1 Perl extension providing access to the GSSAPIv2 library
p5-HTML-Parser-3.76_1 Perl5 module for parsing HTML documents
p5-HTML-Tagset-3.20_1 Some useful data table in parsing HTML
p5-HTTP-Cookies-6.10 HTTP Cookie jars
p5-HTTP-Date-6.05 Conversion routines for the HTTP protocol date formats
p5-HTTP-Message-6.33 Representation of HTTP style messages
p5-HTTP-Negotiate-6.01_1 Implementation of the HTTP content negotiation algorithm
p5-IO-HTML-1.004 Open an HTML file with automatic charset detection
p5-IO-Multiplex-1.16 Perl module to manage I/O on many file handles
p5-IO-Socket-INET6-2.72_1 Perl module with object interface to AF_INET6 domain sockets
p5-IO-Socket-SSL-2.072 Perl5 interface to SSL sockets
p5-IO-Stringy-2.113 Use IO handles with non-file objects
p5-JSON-2.97.001 Perl extension to convert to JSON (JavaScript Object Notation)
p5-LWP-MediaTypes-6.04 Guess media type for a file or a URL
p5-LWP-Protocol-https-6.10 Provide https support for LWP::UserAgent
p5-MIME-Tools-5.509,2 Set of perl5 modules for MIME
p5-Mail-AuthenticationResults-2.20210915 Object Oriented Authentication-Results Headers
p5-Mail-DKIM-1.20200907 Perl5 module to process and/or create DKIM email
p5-Mail-SPF-2.9.0_5 Object-oriented implementation of Sender Policy Framework
p5-Mail-Tools-2.21 Perl5 modules for dealing with Internet e-mail messages
p5-Mozilla-CA-20211001 Perl extension for Mozilla CA cert bundle in PEM format
p5-Net-CIDR-Lite-0.22 Perl extension for merging IPv4 or IPv6 CIDR addresses
p5-Net-DNS-1.32,1 Perl5 interface to the DNS resolver, and dynamic updates
p5-Net-DNS-Resolver-Mock-1.20200215 Mock a DNS Resolver object for testing
p5-Net-DNS-Resolver-Programmable-0.009 Programmable DNS resolver for off-line testing
p5-Net-HTTP-6.21 Low-level HTTP client
p5-Net-IDN-Encode-2.500 Internationalizing Domain Names in Applications (RFC 3490)
p5-Net-LibIDN-0.12_5 This module provides access to the libidn library
p5-Net-SSLeay-1.90 Perl5 interface to SSL
p5-Net-Server-2.010 Configurable base class for writing internet servers in Perl
p5-NetAddr-IP-4.079 Work with IPv4 and IPv6 addresses and subnets
p5-Parse-Syslog-1.10_2 Perl5 routines that present a simple interface to parse syslog files
p5-Socket6-0.29 IPv6 related part of the C socket.h defines and structure manipulators
p5-Switch-2.17_1 Switch statement for Perl
p5-TimeDate-2.33,1 Perl5 module containing a better/faster date parser for absolute dates
p5-Try-Tiny-0.30 Minimal try/catch with proper localization of $@
p5-URI-5.09 Perl5 interface to Uniform Resource Identifier (URI) references
p5-Unix-Syslog-1.1_1 Perl5 interface to the UNIX syslog(3) calls
p5-WWW-RobotRules-6.02_1 Database of robots.txt-derived permissions
p5-common-sense-3.75 Perl common defaults with lower memory usage
p5-libwww-6.57 Perl5 library for WWW access

spampd_flags="--user=spamd --group=spamd --host 127.0.0.1:10025 --relayhost=127.0.0.1:10026 --dose --tagall --maxsize=100"

version 2.61 (Install via.FreeBSD pkt mgr)
root@mailserver:~/spampd # service spampd start
Starting spampd.
Global symbol "$user" requires explicit package name (did you forget to declare "my $user"?) at /usr/local/sbin/spampd line 473.
BEGIN not safe after errors--compilation aborted at /usr/local/sbin/spampd line 1574.

#version 2.60 (git clone --branch 2.60 https://github.com/mpaperno/spampd.git)
#changed #!/usr/bin/perl → #!/user/local/bin/perl
root@mailserver:~/spampd # service spampd start
Starting spampd.
Name "Data::Dumper::Quotekeys" used only once: possible typo at /usr/local/sbin/spampd line 1428.
Name "Data::Dumper::Bless" used only once: possible typo at /usr/local/sbin/spampd line 1428.
Name "Data::Dumper::Sparseseen" used only once: possible typo at /usr/local/sbin/spampd line 1429.

#version 2.53 (copy of old Install, installed via.FreeBSD pkt mgr)
root@mailserver:/spampd # service spampd start
Starting spampd.
root@mailserver:
/spampd #
works as expected..

Error in process_request eval block: Child server process timed out!

I'm having trouble with my mail server (built with https://mailinabox.email v0.4 and using spampd version 2.42) timing out when it gets a large volume of messages (not that much - hundreds per hour), the server has load of < 0.1, 99% idle, but is showing this in logs:

Jan 29 19:02:06 mail2 spampd[27504]: WARNING!! Error in process_request eval block: Child server process timed out!

It is sending delay messages like this:

This is the mail system at host mail.example.com.

####################################################################
# THIS IS A WARNING ONLY.  YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
####################################################################

Your message could not be delivered for more than 3 hour(s).
It will be retried until it is 2 day(s) old.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

<[email protected]>: conversation with 127.0.0.1[127.0.0.1] timed out
   while receiving the initial server greeting
Reporting-MTA: dns; mail.example.com
X-Postfix-Queue-ID: 54D7761235
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Tue, 29 Jan 2019 13:45:07 +0000 (UTC)

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: delayed
Status: 4.4.2
Diagnostic-Code: X-Postfix; conversation with 127.0.0.1[127.0.0.1] timed out
   while receiving the initial server greeting

It's notable that this is an internal message, being sent from one user to another within the same mail server, so no external traffic is involved. I found this report which appears to be the same problem from many years ago. I really don't know where to look for what might be causing this, but it appears to be inside spampd. Any ideas?

Support for UNIX sockets

Currently spampd seems to only support listening on and relaying to INET sockets.

It would be nice if spampd would support listening on and relaying to UNIX domain sockets. This would be useful in situations where an MTA listens for mail from the internet and forwards that mail to an LMTP daemon listening on a UNIX socket.

Of course this could also be solved by having the LMTP daemon listening on a loopback interface, but this comes with slight performance losses and less strict access control.

about ehlo command

my postfix server support TLS , when we send ehlo it will get
250-STARTTLS
and spampd same a smtp-proxy , then postfix client connect to spampd use TLS
but it not work , and massage still in queue waiting connect timeout

Enable --allow-tell functionality

Hi there -

I'm working on setting up spampd, it's running on a separate server from everything else.

Something I like about the spamd/spamc combo, is I can use spamc -L "spam" and spamc -L "ham" to train spamd.

As far as I can tell, spampd is meant to replace spamd, but I can't figure out how to get that functionality working.

AWL: spampd forces fileDB

Hello,

not a great issue but still one:

line 920 states:
require Mail::SpamAssassin::DBBasedAddrList;
line 933 states:
my $addrlistfactory = Mail::SpamAssassin::DBBasedAddrList->new();

this forces SA to use a file based AWL-DB.

Thats no big deal, if you know it. But it takes some time to figure out, why your bayes-db in the SQL-server runs with spampd while the AWL gets written to a file-db. I guess, I was checking 100x my SA-config and running tons of tests with mails, before I checked the spampd-Script.

There should be an option to change this or at least a hint in the manpage or readme to change DBBasedAddrList to SQLBasedAddrList in line 920 and 933, if one is using SQL to store the AWL.

Lico

Typo and question about signals

There is a small typo in current master:

--- spampd-master/spampd.pl.orig	2021-08-03 19:39:28.000000000 +0200
+++ spampd-master/spampd.pl	2021-08-04 10:21:15.797812535 +0200
@@ -782,7 +782,7 @@ sub validate_main_opts {
   }
   else {
     eval { require IO::Socket::IP; }
-    or push (@errs, "Error loading IO::IP::UNIX module, required for --relayhost option.\n\t$@");
+    or push (@errs, "Error loading IO::Socket::IP module, required for --relayhost option.\n\t$@");
   }
 
   return (@errs, @warns);

I've now also looked at the signal handling and I'm wondering what the proper way would be to terminate SpamPD, be in from init scripts or systemd units.

I've always used SIGTERM but what about using SIGQUIT to have graceful shutdowns?

Thanks,
Simon

Spampd does not work as spamassassin

Hi,

I’ve noticed that a lot of spam gets past spampd that spamassassin itself classifies as spam if run from the command line.

I’m trying to understand why, after all one is just a shell for the other.

Looking at the startup I see massive differences between the debug log of spamassassin when started through spampd and when running spamassassin directly.

On my Ubuntu 14.04 install, spampd is run as an old school sysv init, dated from 2005.

On starting (service spampd start) it calls spamassassin and spews a log.

If I run
Sudo -u vmail HOME=/var/cache/spampd spamassassin -D -t < some_message

Where vmail is permissively equivalent to user spampd, I am able to well classify some_message as spam. That same message when received through spampd is not classified as spam (scores of 3.5 vs 10+)

The first difference I see is that spampd is able to read and write /root/.spamassassin, even though the user spampd has no permissions to do so. I notice that spamassassin, if able to read and write here, behaves very differently, hence the HOME= in the command line invocation.

So spampd is somehow keeping permissions and running spamassassin before the call to setuid to change to spampd.

Even if I force spampd to run as user spampd by running it thus:
sudo -u spampd /usr/sbin/spampd --tagall --port=10025 --host=127.0.0.1 --relayport=10026 --relayhost=127.0.0.1 --pid=/var/run/spampd.pid --children=3 --user=spampd --group=spampd --logsock=unix --maxsize=10240 --log-rules-hit --debug

Then it still behaves differently. This time, according to the startup log, it reads exactly the same config files but now omits entire swathes of tests.

The conclusion is that spampd is very sensitive to the invocation method, keeping state from before it’s invocation including being able to read and write files that are not permitted to it’s non privileged user.

I notice that there are two different spampd v 2.30, one from 2005 and the other from 2012, the two files are very different, however the above behaviour is the same with both versions.

I know this is not your issue, but my config has the allow_user_rules=0 set, so spamassassin should not be reading config from /root/.spamassassin even if it is permitted, though this is a separate issue for the spamassassin dev.

So, any clues how to get spampd to classify the spam as spamassassin does?

Invalid POD

2.30 version does build with recent POD parser because the documentation contains bugs. Following patch fixes it:

From e6cb97994529af83f48d52e7464f449756ec8c00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Tue, 6 Aug 2013 14:36:59 +0200
Subject: [PATCH] Fix POD errors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Petr Písař <[email protected]>

---
 spampd | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/spampd b/spampd
index e2fe0c4..59a1cb1 100755
--- a/spampd
+++ b/spampd
@@ -1075,10 +1075,10 @@ L<http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm>.

 =head1 Requires

-=over 5
-
 Perl modules:

+=over 5
+
 =item B<Mail::SpamAssassin>

 =item B<Net::Server::PreForkSimple>
@@ -1390,11 +1390,11 @@ Prints usage information.

 =head2 Deprecated Options

-=over 5
-
 The following options are no longer used but still accepted for backwards
 compatibility with prevoius I<spampd> versions:

+=over 5
+
 =item  B<--dead-letters>

 =item  B<--heloname>
-- 
1.8.1.4

SpamPD doesn't restart with correct configuration flags on HUP Signal

Version: spampd-2.30p4
Operating System: OpenBSD 6.3 Generic amd64

If SpamPD received an HUP signal and was started with specific arguments (e.g. --relayhost or --port), it will respawn itself but not with those configuration flags.

This is a problem on OpenBSD because for some reason when the system boots, the rc system sends SpamPD and HUP, causing it to respawn with a different configuration than the one in /etc/rc.conf.local.

A workaround is to start SpamPD using @reboot via cron. I've documented this in more detail here:

https://penguindreams.org/blog/openbsd-spampd-and-the-startup-bug/

Fails to work with Perl 5.18

Forwarded from http://bugs.debian.org/722159

After the upgrade from Perl 5.14 to 5.18 spampd doesn't start:

Sep  8 17:53:05 trantor spampd[3693]: Process Backgrounded
Sep  8 17:53:05 trantor spampd[3693]: 2013/09/08-17:53:05 Insecure dependency in open while running with -T switch at /usr/share/perl5/Net/Server/Daemonize.pm line 75.#012#012  at line 180 in file /usr/share/perl5/Net/Server.pm
Sep  8 17:53:05 trantor spampd[3693]: 2013/09/08-17:53:05 Server closing!

Small suggestion for proc name

Hi Maxim,

I can confirm that #30 and #31 are fine now, thanks for that.

Now that we can dynamically reload using SIGHUP, I just had a small idea: why not show some useful runtime information in the proc name instead of only 'child'?

That way one should be able to see which versions are actually running by the child. At least that's how I understood it, when you SIGHUP the processes re-execute with new config and probably new modules so they should show it at runtime, right?

This patch is what I tried here: spampd-2.60-procname.patch.txt

Regards,
Simon

Spampd is doing only local tests, but -L not specified

I'm trying to work out why spam is getting though.
It seems spampd is not performing any network tests.
But -L is not supplied on the command line.
Passing a spam message through spamassin -t get scores of >15, but spampd only gives about 3.
I know I'm not running the latests (stock Ubuntu 80.04) is this a known issue?
Version debian/1.42-1
Or perhaps a config issue.
I've specified --debug and can see the startup in the log.
That does not indicate an issue, the network tests ARE on according to log.
But according to injected headers they are not tested.
Some sort of race condition perhaps?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.