View | Details | Raw Unified | Return to bug 5442
Collapse All | Expand All

(-)lib/Mail/SpamAssassin/Conf.pm (-6 / +7 lines)
Lines 54-66 Link Here
54
B<NOTE:> if the C<#> character is to be used as part of a rule or
54
B<NOTE:> if the C<#> character is to be used as part of a rule or
55
configuration option, it must be escaped with a backslash.  i.e.: C<\#>
55
configuration option, it must be escaped with a backslash.  i.e.: C<\#>
56
56
57
Whitespace in the files is not significant, but please note that starting a
57
Whitespace in the files is not significant.  Multi-line settings are
58
line with whitespace is deprecated, as we reserve its use for multi-line rule
58
supported via putting a C<\> at the very end of a line; the next
59
definitions, at some point in the future.
59
non-empty line (a line containing something other than whitespace)
60
will be added to the end of the continued line, with the continuing
61
line's leading whitespace stripped.  The continuing line can also end
62
in a C<\>, in which case it too will be continued by the next
63
non-empty line.
60
64
61
Currently, each rule or configuration setting must fit on one-line; multi-line
62
settings are not supported yet.
63
64
File and directory paths can use C<~> to refer to the user's home
65
File and directory paths can use C<~> to refer to the user's home
65
directory, but no other shell-style path extensions such as globing or
66
directory, but no other shell-style path extensions such as globing or
66
C<~user/> are supported.
67
C<~user/> are supported.
(-)lib/Mail/SpamAssassin/Conf/Parser.pm (+30 lines)
Lines 249-254 Link Here
249
  while (defined ($line = shift @conf_lines)) {
249
  while (defined ($line = shift @conf_lines)) {
250
    local ($1);         # bug 3838: prevent random taint flagging of $1
250
    local ($1);         # bug 3838: prevent random taint flagging of $1
251
251
252
    # Line continuation via having a '\' at the end of a line; leading
253
    # whitespace of continuing line is ignored.  Empty lines are
254
    # discarded, with the first non-empty line following the continued
255
    # line being used to continue it, but comments are not discarded.
256
    while ($line =~ /\\$/) {
257
      my $cont;
258
      unless (defined ($cont = shift @conf_lines)) {
259
        die "config: line '$line' in file $self->{currentfile} ends in \\, " .
260
          "but is last element in \@conf_lines";
261
      }
262
263
      next if ($cont =~ /^\s*$/);
264
      $line =~ s/\\$//;
265
266
      if ($cont =~ /^file start /) {
267
        $cont =~ s/^file start //;
268
        die "config: line '$line' in file $self->{currentfile} ends in \\ " .
269
          "and continues into the start of file $cont; impossible.";
270
      }
271
      elsif ($cont =~ /^file end /) {
272
        warn "config: line '$line' in file $self->{currentfile} ends in \\, " .
273
          "but is last line in the file";
274
        unshift(@conf_lines, $cont);
275
        unshift(@conf_lines, "");
276
        last;
277
      }
278
      $cont =~ s/^\s*//g;
279
      $line .= $cont;
280
    }
281
252
    # bug 5545: used to support testing rules in the ruleqa system
282
    # bug 5545: used to support testing rules in the ruleqa system
253
    if ($keepmetadata && $line =~ /^\#testrules/) {
283
    if ($keepmetadata && $line =~ /^\#testrules/) {
254
      $self->{file_scoped_attrs}->{testrules}++;
284
      $self->{file_scoped_attrs}->{testrules}++;

Return to bug 5442