summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fml/lib/FML/MTAControl.pm12
-rw-r--r--fml/lib/FML/MTAControl/Postfix.pm13
-rw-r--r--fml/lib/FML/MTAControl/Procmail.pm29
3 files changed, 34 insertions, 20 deletions
diff --git a/fml/lib/FML/MTAControl.pm b/fml/lib/FML/MTAControl.pm
index 9ca528ab..dc0cee23 100644
--- a/fml/lib/FML/MTAControl.pm
+++ b/fml/lib/FML/MTAControl.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: MTAControl.pm,v 1.17 2003/01/11 16:05:13 fukachan Exp $
+# $FML: MTAControl.pm,v 1.18 2003/01/29 09:00:54 fukachan Exp $
#
package FML::MTAControl;
@@ -307,14 +307,18 @@ sub _remove_postfix_style_virtual
my $rh = new FileHandle $virtual;
my $wh = new FileHandle "> $virtual_new";
if (defined $rh && defined $wh) {
+ my $buf;
+
LINE:
- while (<$rh>) {
- if (/\<VIRTUAL\s+$key\@/ .. /\<\/VIRTUAL\s+$key\@/) {
+ while ($buf = <$rh>) {
+ if ($buf =~ /\<VIRTUAL\s+$key\@/
+ ..
+ $buf =~ /\<\/VIRTUAL\s+$key\@/) {
$removed++;
next LINE;
}
- print $wh $_;
+ print $wh $buf;
}
$wh->close;
$rh->close;
diff --git a/fml/lib/FML/MTAControl/Postfix.pm b/fml/lib/FML/MTAControl/Postfix.pm
index 855bd31b..9e55afe0 100644
--- a/fml/lib/FML/MTAControl/Postfix.pm
+++ b/fml/lib/FML/MTAControl/Postfix.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Postfix.pm,v 1.17 2003/01/07 08:38:33 fukachan Exp $
+# $FML: Postfix.pm,v 1.18 2003/01/27 03:23:17 fukachan Exp $
#
package FML::MTAControl::Postfix;
@@ -89,14 +89,18 @@ sub postfix_remove_alias
my $rh = new FileHandle $alias;
my $wh = new FileHandle "> $alias_new";
if (defined $rh && defined $wh) {
+ my $buf;
+
LINE:
- while (<$rh>) {
- if (/\<ALIASES\s+$key\@/ .. /\<\/ALIASES\s+$key\@/) {
+ while ($buf = <$rh>) {
+ if ($buf =~ /\<ALIASES\s+$key\@/
+ ..
+ $buf =~ /\<\/ALIASES\s+$key\@/) {
$removed++;
next LINE;
}
- print $wh $_;
+ print $wh $buf;
}
$wh->close;
$rh->close;
@@ -190,6 +194,7 @@ sub _find_key_in_file
if (defined $fh) {
my $buf;
+
LINE:
while ($buf = <$fh>) {
if ($buf =~ /^$key:/) {
diff --git a/fml/lib/FML/MTAControl/Procmail.pm b/fml/lib/FML/MTAControl/Procmail.pm
index a4d4968b..61dcdfaf 100644
--- a/fml/lib/FML/MTAControl/Procmail.pm
+++ b/fml/lib/FML/MTAControl/Procmail.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Procmail.pm,v 1.4 2002/09/22 14:56:51 fukachan Exp $
+# $FML: Procmail.pm,v 1.5 2002/12/18 04:03:16 fukachan Exp $
#
package FML::MTAControl::Procmail;
@@ -79,14 +79,18 @@ sub procmail_remove_alias
my $rh = new FileHandle $alias;
my $wh = new FileHandle "> $alias_new";
if (defined $rh && defined $wh) {
+ my $buf;
+
LINE:
- while (<$rh>) {
- if (/\<ALIASES\s+$key\@/ .. /\<\/ALIASES\s+$key\@/) {
+ while ($buf = <$rh>) {
+ if ($buf =~ /\<ALIASES\s+$key\@/
+ ..
+ $buf =~ /\<\/ALIASES\s+$key\@/) {
$removed++;
next LINE;
}
- print $wh $_;
+ print $wh $buf;
}
$wh->close;
$rh->close;
@@ -136,8 +140,9 @@ sub procmail_find_key_in_alias_maps
use FileHandle;
my $fh = new FileHandle $map;
if (defined $fh) {
- while (<$fh>) {
- return 1 if /^$key:/;
+ my $buf;
+ while ($buf = <$fh>) {
+ return 1 if $buf =~ /^$key:/;
}
$fh->close;
}
@@ -176,15 +181,15 @@ sub procmail_get_aliases_as_hash_ref
use FileHandle;
my $fh = new FileHandle $map;
if (defined $fh) {
- my ($key, $value);
+ my ($buf, $key, $value);
LINE:
- while (<$fh>) {
- next LINE if /^#/;
- next LINE if /^\s*$/;
+ while ($buf = <$fh>) {
+ next LINE if $buf =~ /^#/;
+ next LINE if $buf =~ /^\s*$/;
- chomp;
- ($key, $value) = split(/:/, $_, 2);
+ chomp $buf;
+ ($key, $value) = split(/:/, $buf, 2);
$value =~ s/^\s*//;
$value =~ s/s*$//;
$aliases->{ $key } = $value;