Commit | Line | Data |
---|---|---|
86530b38 AT |
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($key, $num, $index, $day, $mon, $year, $from, $date, | |
35 | $subject, $time, @array); | |
36 | ||
37 | print STDOUT "$NumOfMsgs messages in $OUTDIR:\n\n"; | |
38 | print STDOUT sprintf("%5s %s %-15s %-43s\n", | |
39 | "Msg #", "YYYY/MM/DD", "From", "Subject"); | |
40 | print STDOUT sprintf("%5s %s %-15s %-43s\n", | |
41 | "-" x 5, "----------", "-" x 15, "-" x 43); | |
42 | ||
43 | @array = &sort_messages(); | |
44 | foreach $index (@array) { | |
45 | $date = &time2mmddyy((split(/$X/o, $index))[0], 'yyyymmdd'); | |
46 | $num = $IndexNum{$index}; | |
47 | $from = substr(&extract_email_name($From{$index}), 0, 15); | |
48 | $subject = substr($Subject{$index}, 0, 43); | |
49 | print STDOUT sprintf("%5d %s %-15s %-43s\n", | |
50 | $num, $date, $from, $subject); | |
51 | } | |
52 | } | |
53 | ||
54 | ##--------------------------------------------------------------------------- | |
55 | 1; |