head 1.1; branch 1.1.1; access; symbols ISELECT_1_4_0:1.1.1.2 ISELECT_1_3_1:1.1.1.2 ISELECT_1_3_0:1.1.1.2 ISELECT_1_2_0:1.1.1.2 ISELECT_1_1_0:1.1.1.2 ISELECT_1_0_4:1.1.1.1 vendor:1.1.1; locks; strict; comment @# @; 1.1 date 97.12.29.08.21.26; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 97.12.29.08.21.26; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 98.04.05.16.37.49; author rse; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @#!/sw/bin/perl ## ## MetaELM -- ELM frontend ## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved. ## require 5.003; use Date::Parse; use Date::Format; # # configuration # $melmrc = "$ENV{'HOME'}/.melmrc"; # # read rc-file # if (not -f $melmrc) { print STDERR "** mElm:Error: no ``$melmrc'' found. Please create one first.\n"; exit(1); } @@MAILFOLDER = (); open(RC, "<$melmrc") || die; while () { next if (m|^\s*$|); next if (m|^\s*#.*$|); if (m|^\s*(/\S+)\s+(.+?)\s*$|) { push(@@MAILFOLDER, { FOLDER => $1, NAME => $2 }); } else { print STDERR "** mElm:Error: bad RC-file entry:\n"; print STDERR "** mElm:Error: $_"; exit(1); } } close(RC); # # determine informations # foreach $entry (@@MAILFOLDER) { ($name, $folder) = ($entry->{NAME}, $entry->{FOLDER}); @@F = `from -f $folder`; $time = $F[$#F]; $time =~ s|^From\s+\S+\s+(.+)\s*|$1|; $time = str2time($time); $entry->{TIME} = $time; $entry->{MAILS} = $#F+1; } # # processing loop # $pos = 4; while (1) { $L = '"" ' . '"Available Folders: '. sprintf("%d", $#MAILFOLDER + 1) .'" ' . '"" '; $n = 1; foreach $entry (@@MAILFOLDER) { ($name, $folder, $time, $mails) = ($entry->{NAME}, $entry->{FOLDER}, $entry->{TIME}, $entry->{MAILS}); $L .= sprintf("\"%2d %-20s (%3d) %s %2d %%%%S:elm -f $folder%%%%\" ", $n++, $name, $mails, time2str("%a", $time), time2str("%d", $time)); } $L .= "'' "; $L .= "'_____________________________________________________' "; $L .= "'' "; $L .= "'Help: , .......... browse folder list' "; $L .= "' , ..... select folder (run ELM)' "; $L .= "' q, ............. quit' "; $rc=`iselect -n "MetaELM 1.0.0" -t "Electronic Mail Folders" -p$pos -P $L`; if ($rc eq '') { print "**Exit\n"; last; } $rc =~ m|^(\d+):(.*)|; ($pos, $cmd) = ($1, $2); system($cmd); # update entry $entry = $MAILFOLDER[$pos-4]; $folder = $entry->{FOLDER}; @@F = `from -f $folder`; $time = $F[$#F]; $time =~ s|^From\s+\S+\s+(.+)\s*|$1|; $time = str2time($time); $entry->{TIME} = $time; $entry->{MAILS} = $#F+1; } # die gracefully exit(0); ##EOF## @ 1.1.1.1 log @Import iSelect 1.0.4 @ text @@ 1.1.1.2 log @Import iSelect 1.1.0 @ text @d65 1 a65 1 $L .= sprintf("\"%2d %-20s (%3d) %s %2d \" ", $n++, $name, $mails, time2str("%a", $time), time2str("%d", $time)); @