Can anyone think of any cases where he leading/trailing whitespace in config-file might be significant? Otherwise this looks quite applicable.
-R Henry Baragar wrote: > > Index: config.sample/relayclients > =================================================================== > --- config.sample/relayclients (revision 961) > +++ config.sample/relayclients (working copy) > @@ -1,4 +1,4 @@ > # Format is IP, or IP part with trailing dot > # e.g. "127.0.0.1", or "192.168." > -127.0.0.1 > -192.168. > +127.0.0.1 > + 192.168. > Index: t/config.t > =================================================================== > --- t/config.t (revision 961) > +++ t/config.t (working copy) > @@ -17,6 +17,9 @@ > > is($smtpd->config('me'), 'some.host.example.org', 'config("me")'); > > +my $relayclients = join ",", sort $smtpd->config('relayclients'); > +is($relayclients, '127.0.0.1,192.168.', 'config("relayclients") are > trimmed'); > + > unlink "./config.sample/me"; > > > Index: lib/Qpsmtpd.pm > =================================================================== > --- lib/Qpsmtpd.pm (revision 961) > +++ lib/Qpsmtpd.pm (working copy) > @@ -239,7 +239,7 @@ > open CF, "<$configfile" or warn "$$ could not open configfile $configfile: > $!" and return; > my @config = <CF>; > chomp @config; > - @config = grep { length($_) and $_ !~ m/^\s*#/ and $_ =~ m/\S/} @config; > + @config = grep { length($_) and $_ !~ m/^\s*#/ and $_ =~ m/\S/} map > {s/^\s+//; s/\s+$//; $_} @config; > close CF; > > my $pos = 0;