From 809533aff4a3628b278ccade39565ad0b6de00b7 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 23 Mar 2013 11:02:10 -0700 Subject: [PATCH] Use alt config file, if primary is missing --- inetd/config-freebsd-9-* | 12 ++++++++++++ spam/config-freebsd | 1 + spam/spam-lib.pl | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 inetd/config-freebsd-9-* diff --git a/inetd/config-freebsd-9-* b/inetd/config-freebsd-9-* new file mode 100644 index 000000000..1b203384e --- /dev/null +++ b/inetd/config-freebsd-9-* @@ -0,0 +1,12 @@ +show_empty=0 +rpc_inetd=0 +inetd_conf_file=/etc/inetd.conf +rpc_protocols=tcp udp +restart_command=/etc/rc.d/inetd forcerestart +services_file=/etc/services +protocols_file=/etc/protocols +rpc_file=/etc/rpc +extended_inetd=2 +sort_mode=0 +ipv6=0 +qm_mode=0 diff --git a/spam/config-freebsd b/spam/config-freebsd index 242898299..d208bde49 100644 --- a/spam/config-freebsd +++ b/spam/config-freebsd @@ -1,4 +1,5 @@ local_cf=/usr/local/etc/mail/spamassassin/local.cf +alt_local_cf=/usr/local/etc/mail/spamassassin/local.cf.sample spamassassin=spamassassin sa_learn=sa-learn procmailrc=/usr/local/etc/procmailrc diff --git a/spam/spam-lib.pl b/spam/spam-lib.pl index abc9e3cba..8c9e44796 100755 --- a/spam/spam-lib.pl +++ b/spam/spam-lib.pl @@ -33,6 +33,11 @@ else { &set_config_file($access{'file'}); } else { + if (!-r $config{'local_cf'} && -r $config{'alt_local_cf'}) { + # Copy in default config file + ©_source_dest($config{'alt_local_cf'}, + $config{'local_cf'}); + } &set_config_file($config{'local_cf'}); } if ($access{'nocheck'}) {