aboutsummaryrefslogtreecommitdiffstats
path: root/rspamc.pl.in
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 09:25:32 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 09:25:32 +0300
commitdb656e70f8d5a2e5522ef90d0b5127c8efe192ec (patch)
treec66288a7434cdb68f3a12b17a1ae671edbd67525 /rspamc.pl.in
parentc1e155820bb5f16eece4b9b6e93d1446f5466742 (diff)
downloadrspamd-db656e70f8d5a2e5522ef90d0b5127c8efe192ec.tar.gz
rspamd-db656e70f8d5a2e5522ef90d0b5127c8efe192ec.zip
* Fix LMTP and DELIVERY parsing in config file while trying to get control credits
Diffstat (limited to 'rspamc.pl.in')
-rwxr-xr-xrspamc.pl.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/rspamc.pl.in b/rspamc.pl.in
index 8caeb28a3..c8d7f07d0 100755
--- a/rspamc.pl.in
+++ b/rspamc.pl.in
@@ -31,15 +31,21 @@ sub parse_config {
open CONF, "< $cfg{'conf_file'}" or die "config file $cfg{'conf_file'} cannot be opened";
- my $ctrl = 0;
+ my $ctrl = 0, $skip = 0;
while (<CONF>) {
- if ($_ =~ /control\s*{/i || $_ =~ /lmtp\s*{/i || $_ =~ /delivery\s*{/i) {
+ if ($_ =~ /control\s*{/i) {
$ctrl = 1;
}
if ($ctrl && $_ =~ /}/) {
$ctrl = 0;
}
- if (((!$is_ctrl && !$ctrl) || ($ctrl && $is_ctrl))
+ if ($_ =~ /lmtp\s*{/i || $_ =~ /delivery\s*{/i) {
+ $skip = 1;
+ }
+ if ($skip && $_ =~ /}/) {
+ $skip = 0;
+ }
+ if (!$skip && ((!$is_ctrl && !$ctrl) || ($ctrl && $is_ctrl))
&& $_ =~ /^\s*bind_socket\s*=\s*((([^:]+):(\d+))|(\/\S*))/i) {
if ($3 && $4) {
$cfg{'host'} = $3;