aboutsummaryrefslogtreecommitdiff
path: root/tpnotify
diff options
context:
space:
mode:
Diffstat (limited to 'tpnotify')
-rwxr-xr-xtpnotify47
1 files changed, 16 insertions, 31 deletions
diff --git a/tpnotify b/tpnotify
index 63f379a..67b0436 100755
--- a/tpnotify
+++ b/tpnotify
@@ -252,19 +252,24 @@ sub expand_template {
}
sub read_mh_path {
- if (open(my $fd, '<', "$ENV{HOME}/.mh_profile")) {
- my $prev;
- while (<$fd>) {
- chomp;
- if (s/^\s+//) {
- $prev .= ' ' . $_;
- } else {
- last if $prev =~ /^Path:/;
- $prev = $_;
+ my $file = File::Spec->catfile($ENV{HOME}, '.mh_profile');
+ if (-f $file) {
+ if (open(my $fd, '<', $file)) {
+ my $prev;
+ while (<$fd>) {
+ chomp;
+ if (s/^\s+//) {
+ $prev .= ' ' . $_;
+ } else {
+ last if $prev =~ /^Path:/;
+ $prev = $_;
+ }
}
+ close $fd;
+ return $prev if $prev =~ s/^Path:\s+//;
+ } else {
+ err("can't open $file: $!", prefix => 'warning');
}
- close $fd;
- return $prev if $prev =~ s/^Path:\s+//;
}
return "$ENV{HOME}/Mail";
}
@@ -338,26 +343,6 @@ sub mail_box_manager_refile {
$folder->close;
}
-sub read_mh_path {
- my $file = File::Spec->catfile($ENV{HOME}, '.mh_profile');
- my $path;
- if (-f $file) {
- if (open(my $fd, '<', $file)) {
- while (<$fd>) {
- chomp;
- if (s/Path:\s*(.+)/$1/) {
- $path = $1;
- last;
- }
- }
- close $path;
- }
- } else {
- err("can't open $file: $!", prefix => 'warning');
- }
- return $path;
-}
-
sub movemail_supported {
if (open(my $fd, '-|', 'movemail --version')) {
chomp($_ = <$fd>);

Return to:

Send suggestions and report system problems to the System administrator.