]> git.proxmox.com Git - pmg-api.git/commit
add helper for parsing SA channel.d files
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 19 Jan 2021 10:38:12 +0000 (11:38 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Jan 2021 10:28:49 +0000 (11:28 +0100)
commitd362c98d48af8a88a7adf171a52a02faa88e8e4a
treeb38deb1cbd9c00b1a31ce138e8133e74d05a0cf6
parent788857eccbbf8446dedd6a5fa1a3b6405d36af49
add helper for parsing SA channel.d files

RHEL/CentOS based SpamAssassin implementations ship an update script,
which reads shell snippets from
/etc/mail/spamassassin/channel.d/*.conf and uses the information there
to update SA rules from the configured channels [0].

Noticed the existence of this directory/mechanism while reading the
announcement of the updatechannel for the KAM ruleset [1].

Parsing the file as text, instead of sourcing it in a shell, since I
hope that the channel files distributed don't rely on running commands
to get the ruleset url and gpg key.

The parser has some minimal tests added (inspired by the
convert_size_test.pl from pve-common)

[0] https://src.fedoraproject.org/rpms/spamassassin/blob/master/f/sa-update.cronscript
[1] https://mcgrail.com/template/kam.cf_channel

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/Utils.pm
src/tests/KAM_channel.conf [new file with mode: 0644]
src/tests/Makefile
src/tests/missing_gpg_key_channel.conf [new file with mode: 0644]
src/tests/missing_keyid.conf [new file with mode: 0644]
src/tests/test_sa_channel_parser.pl [new file with mode: 0755]