about summary refs log tree commit homepage
path: root/lib/PublicInbox/Spamcheck
DateCommit message (Collapse)
2023-12-08workaround --headers bug with spamc(1)
As of SpamAssassin 4.0.0, spamc(1) corrupts messages with NUL in the body when the `--headers' switch is used. This increases transport costs, but most spamc/spamd setups are via local sockets, so it's unlikely to be significant. Link: https://bugs.debian.org/1057749 Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
2023-10-28treewide: use run_qx where appropriate
This saves us some code, and is a small step towards getting ProcessIO working with stat, fcntl and other perlops that don't work with tied handles.
2023-10-08rename ProcessPipe to ProcessIO
Since we deal with pipes (of either direction) and bidirectional stream sockets for this class, it's better to remove the `Pipe' from the name and replace it with `IO' to communicate that it works for any form of IO::Handle-like object tied to a process.
2023-09-26spawn: add run_wait to simplify spawn+waitpid use
It's basically the `system' perlop with support for env overrides, redirects, chdir, rlimits, and setpgid support.
2023-09-26spamcheck/spamc: rely on ProcessPipe instead of waitpid
We lose error information on CORE::close call, but the underlying close(2) syscall won't EIO nor ENOSPC on a read-only side of a pipe. Perl is already shielding us from EINTR and EBADF would be a bug in Perl itself.
2023-03-14spamcheck: use v5.12 and golf
No problems with `unicode_strings' in these modules. We can also shave our LoC count in a few places.
2021-01-01update copyrights for 2021
Using "make update-copyrights" after setting GNULIB_PATH in my config.mak
2020-05-20spamcheck/spamc: use localized slurp to read from spamc
The <EXPR> perlop, `readline', and `read' functions will all retry on EINTR, so there's no need to retry and loop ourselves with `sysread'.
2020-02-06treewide: run update-copyrights from gnulib for 2019
I didn't wait until September to do it, this year!
2020-01-11spawn (and thus popen_rd) die on failure
Most spawn and popen_rd callers die on failure to spawn, anyways, and some are missing checks entirely. This saves us a bunch of verbose error-checking code in callers. This also makes popen_rd more consistent, since it already dies on pipe creation failures.
2020-01-01spamcheck/spamc: pass GLOB handles instead of FD numbers
The spawn() interface improvements[1] propagate to popen_rd, too, so we can avoid weird dances to keep the GLOB handle references live and just pass the handle around. [1] commit 267371b1273b518215939e817e53733584b68af7 ("spawn: allow passing GLOB handles for redirects")
2019-09-09run update-copyrights from gnulib for 2019
2019-01-09doc: various overview-level module comments
Hopefully this helps people familiarize themselves with the source code.
2018-02-07update copyrights for 2018
Using update-copyrights from gnulib While we're at it, use the SPDX identifier for AGPL-3.0+ to ease mechanical processing.
2017-06-26spamc: retry on EINTR
Signals can fire on us at any time if we're using blocking sysread.
2016-11-26avoid IO::File for anonymous temporary files
We do not need to import IO::File into the main programs since Perl 5.8+ supports literal "undef" for generating anonymous temporary file handles.
2016-06-26spamcheck/spamc: fix compatibility with Perl 5.14.2
This is necessary for Debian 7.x (wheezy), since GLOB objects do not seem responsive to the can("fileno") check (we do a similar check in GitHTTPBackend).
2016-06-24split out spamcheck/spamc to its own module.
This should hopefully make it easier to try other anti-spam systems (or none at all) in the future.