Browse Source

* Fix LMTP and DELIVERY parsing in config file while trying to get control credits

tags/0.2.7
Vsevolod Stakhov 15 years ago
parent
commit
db656e70f8
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      rspamc.pl.in

+ 9
- 3
rspamc.pl.in View File



open CONF, "< $cfg{'conf_file'}" or die "config file $cfg{'conf_file'} cannot be opened"; 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>) { while (<CONF>) {
if ($_ =~ /control\s*{/i || $_ =~ /lmtp\s*{/i || $_ =~ /delivery\s*{/i) {
if ($_ =~ /control\s*{/i) {
$ctrl = 1; $ctrl = 1;
} }
if ($ctrl && $_ =~ /}/) { if ($ctrl && $_ =~ /}/) {
$ctrl = 0; $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) { && $_ =~ /^\s*bind_socket\s*=\s*((([^:]+):(\d+))|(\/\S*))/i) {
if ($3 && $4) { if ($3 && $4) {
$cfg{'host'} = $3; $cfg{'host'} = $3;

Loading…
Cancel
Save