mirror of
https://github.com/rspamd/rspamd.git
synced 2024-07-24 22:24:53 +02:00
* Fix LMTP and DELIVERY parsing in config file while trying to get control credits
This commit is contained in:
parent
c1e155820b
commit
db656e70f8
12
rspamc.pl.in
12
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;
|
||||
|
Loading…
Reference in New Issue
Block a user