| 1 | ##---------------------------------------------------------------------------## | ||
| 2 | ## File: | ||
| 3 | ## $Id: mhscan.pl,v 1.3 2001/09/17 16:10:37 ehood Exp $ | ||
| 4 | ## Author: | ||
| 5 | ## Earl Hood mhonarc@mhonarc.org | ||
| 6 | ## Description: | ||
| 7 | ## Scan routine for MHonArc | ||
| 8 | ##---------------------------------------------------------------------------## | ||
| 9 | ## MHonArc -- Internet mail-to-HTML converter | ||
| 10 | ## Copyright (C) 1995-1999 Earl Hood, mhonarc@mhonarc.org | ||
| 11 | ## | ||
| 12 | ## This program is free software; you can redistribute it and/or modify | ||
| 13 | ## it under the terms of the GNU General Public License as published by | ||
| 14 | ## the Free Software Foundation; either version 2 of the License, or | ||
| 15 | ## (at your option) any later version. | ||
| 16 | ## | ||
| 17 | ## This program is distributed in the hope that it will be useful, | ||
| 18 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | ## GNU General Public License for more details. | ||
| 21 | ## | ||
| 22 | ## You should have received a copy of the GNU General Public License | ||
| 23 | ## along with this program; if not, write to the Free Software | ||
| 24 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
| 25 | ## 02111-1307, USA | ||
| 26 | ##---------------------------------------------------------------------------## | ||
| 27 | |||
| 28 | package mhonarc; | ||
| 29 | |||
| 30 | ##--------------------------------------------------------------------------- | ||
| 31 | ## Function to do scan feature. | ||
| 32 | ## | ||
| 33 | sub scan { | ||
| 34 | local ( | ||
| 35 | $key, $num, $index, $day, $mon, $year, | ||
| 36 | $from, $date, $subject, $time, @array | ||
| 37 | ); | ||
| 38 | |||
| 39 | print STDOUT "$NumOfMsgs messages in $OUTDIR:\n\n"; | ||
| 40 | print STDOUT sprintf("%5s %s %-15s %-43s\n", | ||
| 41 | "Msg #", "YYYY/MM/DD", "From", "Subject"); | ||
| 42 | print STDOUT sprintf("%5s %s %-15s %-43s\n", | ||
| 43 | "-" x 5, "----------", "-" x 15, "-" x 43); | ||
| 44 | |||
| 45 | @array = &sort_messages(); | ||
| 46 | foreach $index (@array) { | ||
| 47 | $date = &time2mmddyy((split(/$X/o, $index))[0], 'yyyymmdd'); | ||
| 48 | $num = $IndexNum{$index}; | ||
| 49 | $from = substr(&extract_email_name($From{$index}), 0, 15); | ||
| 50 | $subject = substr($Subject{$index}, 0, 43); | ||
| 51 | print STDOUT | ||
| 52 | sprintf("%5d %s %-15s %-43s\n", $num, $date, $from, $subject); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | ##--------------------------------------------------------------------------- | ||
| 57 | 1; |