aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-18 20:01:19 -0200
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-18 20:01:19 -0200
commit901c4c7a85e3056c5e86a0b19cfdccc1003f00ca (patch)
treec2d9ed6769e412ffa4a45f928c17ce06c40a2dc0
parent7d3b4c2e206709152ae53142b955a2a7cdfa5d25 (diff)
downloadpfsense-packages-901c4c7a85e3056c5e86a0b19cfdccc1003f00ca.tar.gz
pfsense-packages-901c4c7a85e3056c5e86a0b19cfdccc1003f00ca.tar.bz2
pfsense-packages-901c4c7a85e3056c5e86a0b19cfdccc1003f00ca.zip
mailscanner - fix/disable pyzor check and change mailscanner bin from perl version to a perl_mailscanner alias.
-rw-r--r--config/mailscanner/mailscanner.inc46
-rw-r--r--config/mailscanner/mailscanner.xml2
-rw-r--r--config/mailscanner/mailscanner_antispam.xml2
3 files changed, 28 insertions, 22 deletions
diff --git a/config/mailscanner/mailscanner.inc b/config/mailscanner/mailscanner.inc
index f15f7c61..9f5fd11d 100644
--- a/config/mailscanner/mailscanner.inc
+++ b/config/mailscanner/mailscanner.inc
@@ -442,15 +442,21 @@ Country Sub-Domains List = %etc-dir%/country.domains.conf
}
if (preg_match('/use_pyzor/',$antispam['safeatures'])){
$pattern[]='/#pyzor_path/';
+ $pattern[]="/\S+yzor_disabled/";
$pattern[]='/usr.bin.pyzor/';
- $pattern[]='/\nuse_pyzor\s+0/';
+ $pattern[]='/use_pyzor/';
+ $pattern[]="/\S+o_not_use_pyzor/";
+ $replacement[]="pyzor_path";
$replacement[]="pyzor_path";
$replacement[]="usr/local/bin/pyzor";
- $replacement[]="\n".'# use_pyzor 0';
+ $replacement[]="use_pyzor";
+ $replacement[]="use_pyzor";
}
else{
- $pattern[]='/\n#\s+use_pyzor\s+0/';
- $replacement[]="\n".'# use_pyzor 0';
+ $pattern[]='/use_pyzor/';
+ $pattern[]='/pyzor_path/';
+ $replacement[]="#do_not_use_pyzor";
+ $replacement[]="#pyzor_disabled";
}
if (preg_match('/use_auto_learn_bayes/',$antispam['safeatures'])){
$pattern[]='/\nbayes_auto_learn\s+0/';
@@ -677,23 +683,23 @@ Country Sub-Domains List = %etc-dir%/country.domains.conf
#fix MIME::ToolUtils deprecated function and usecure dependency calls in /usr/local/sbin/mailscanner
$cconf=MAILSCANNER_LOCALBASE. "/sbin/mailscanner";
if (file_exists($cconf)){
- #check perl's version
- $perl_bin="perl";
- $perl_version_file=MAILSCANNER_LOCALBASE . '/etc/perl5_version';
- if (file_exists($perl_version_file)) {
- $perl_version = trim(`/usr/bin/grep 'PERL_VERSION=' $perl_version_file | /usr/bin/cut -f2 -d'='`);
- $perl_bin .= $perl_version;
+
+ $perl_bin="perl_mailscanner";
+ if(file_exists(MAILSCANNER_LOCALBASE . '/bin/perl') && !file_exists(MAILSCANNER_LOCALBASE . "/bin/{$perl_bin}")){
+ link(MAILSCANNER_LOCALBASE . '/bin/perl',MAILSCANNER_LOCALBASE . '/bin/perl_mailscanner');
}
-
- $cconf_file=file_get_contents($cconf);
- $pattern2[0]='@#!/usr\S+bin/perl.*I@';
- $pattern2[1]='/\smy .current = config MIME::ToolUtils/';
- $replacement2[0]='#!'.MAILSCANNER_LOCALBASE. "/bin/{$perl_bin} -U -I";
- $replacement2[1]=' #my $current = config MIME::ToolUtils';
- if (preg_match('@#!/usr\S+bin/perl.*I@',$cconf_file)){
- $cconf_file=preg_replace($pattern2,$replacement2,$cconf_file);
- file_put_contents($cconf, $cconf_file, LOCK_EX);
- }
+ if (file_exists(MAILSCANNER_LOCALBASE . "/bin/{$perl_bin}")){
+ $cconf_file=file_get_contents($cconf);
+ $pattern2[0]='@#!/usr\S+bin/perl.*I@';
+ //$pattern2[1]='/\smy .current = config MIME::ToolUtils/';
+ $replacement2[0]='#!'.MAILSCANNER_LOCALBASE. "/bin/{$perl_bin} -U -I";
+ //$replacement2[1]=' #my $current = config MIME::ToolUtils';
+ if (preg_match('@#!/usr\S+bin/perl.*I@',$cconf_file)){
+ $cconf_file=preg_replace($pattern2,$replacement2,$cconf_file);
+ file_put_contents($cconf, $cconf_file, LOCK_EX);
+ }
+ }
+
}
#check spam assassin rules
diff --git a/config/mailscanner/mailscanner.xml b/config/mailscanner/mailscanner.xml
index 87be2421..2f97fcec 100644
--- a/config/mailscanner/mailscanner.xml
+++ b/config/mailscanner/mailscanner.xml
@@ -54,7 +54,7 @@
<service>
<name>mailscanner</name>
<rcfile>mailscanner</rcfile>
- <executable>perl5.16.3</executable>
+ <executable>perl_mailscanner</executable>
<description>MailScanner</description>
</service>
<additional_files_needed>
diff --git a/config/mailscanner/mailscanner_antispam.xml b/config/mailscanner/mailscanner_antispam.xml
index 7f989765..26295059 100644
--- a/config/mailscanner/mailscanner_antispam.xml
+++ b/config/mailscanner/mailscanner_antispam.xml
@@ -169,7 +169,7 @@
<option><name>Spam Score (yes)</name><value>spam_score</value></option>
<option><name>Cache SpamAssassin Results (yes)</name><value>cache_spamassassin_results</value></option>
<option><name>Wait During Bayes Rebuild (no)</name><value>wait_during_bayes_rebuild</value></option>
- <option><name>Use Pyzor plugin (yes)</name><value>use_pyzor</value></option>
+ <option><name>Use Pyzor plugin (no)</name><value>use_pyzor</value></option>
<option><name>Use Razor plugin (yes)</name><value>use_razor</value></option>
<option><name>Use DCC plugin (yes)</name><value>use_dcc</value></option>
<option><name>Use Bayes (yes)</name><value>use_bayes</value></option>