about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/mail/spamassassin/sa-update_add--siteconfigpath.patch
blob: bac048892fe834970ba228f351244eaf67c2565d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 60abf3ee8864980a95b32e2d6cf60e26b49654c0 Mon Sep 17 00:00:00 2001
From: joachim schiele <js@lastlog.de>
Date: Wed, 7 Jun 2017 22:15:39 +0200
Subject: [PATCH 2/2] Adding --siteconfigpath to not be forced to use global /etc/spamasassin configuration directory but to provide an alternative location.

---
 sa-update.raw | 5 +++++
 lib/Mail/SpamAssassin/PerMsgStatus.pm | 2 +
 2 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sa-update.raw b/sa-update.raw
index bb7396d..39f681f 100755
--- a/sa-update.raw
+++ b/sa-update.raw
@@ -196,6 +196,7 @@ GetOptions(
   'gpgkeyfile=s'			=> \$opt{'gpgkeyfile'},
   'channelfile=s'			=> \$opt{'channelfile'},
   'updatedir=s'				=> \$opt{'updatedir'},
+  'siteconfigpath=s'                           => \$opt{'siteconfigpath'},
   'gpg!'				=> \$GPG_ENABLED,
 
   '4'                                   => sub { $opt{'force_pf'} = 'inet' },
@@ -267,6 +268,9 @@ else {
   $opt{'updatedir'} = $SA->sed_path('__local_state_dir__/__version__');
 }
 
+if (defined $opt{'siteconfigpath'}) {
+  $LOCAL_RULES_DIR = untaint_file_path($opt{'siteconfigpath'});
+}
 
 # check only disabled gpg
 # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5854
@@ -1808,7 +1812,7 @@ Options:
   --updatedir path        Directory to place updates, defaults to the
                           SpamAssassin site rules directory
                           (default: @@LOCAL_STATE_DIR@@/@@VERSION@@)
+  --siteconfigpath=path   Path for site configs
   --refreshmirrors        Force the MIRRORED.BY file to be updated
   -D, --debug [area=n,...]  Print debugging messages
   -v, --verbose           Be verbose, like print updated channel names;
-- 

2.12.2