1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| <% Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim SCL
Dim xsender
dim xreceiver
dim MsgSubject
dim MsgCount
Sub ListDirectory(objFolder)
Dim objFile
Dim objSubFolder
For Each objFile in objFolder.Files
MsgCount = MsgCount + 1
Response.Write "<TR>"
' Open the file
Dim TextStream
Set TextStream = objfile.OpenAsTextStream(ForReading,TristateUseDefault)
Dim Line
' Read the X-Sender from the first line
Line = TextStream.readline
XSender = "-"
If Left(Line,10) = "x-sender: " then XSender=Right(Line,len(Line)-10)
If XSender = "" then XSender = "-"
Response.write "<TD><font size=2>" & xsender & "</TD>"
' Read the x-receiver from the second line
Line = TextStream.readline
If Left(Line,12) = "x-receiver: " then xreceiver=Right(Line,len(Line)-12)
If Xreceiver = "" then Xreceiver = "-"
Response.write "<TD><font size=2>" & xreceiver & "</TD>"
' Read the x-SCL from the third line
Line = TextStream.readline
If Left(Line,7) = "X-SCL: " then scl=Right(Line,len(Line)-7)
SCL = Left(SCL,1)
If SCL = "" then SCL = "-"
Response.write "<TD><font size=2>" & scl & "</TD>"
Dim SubjectFound
SubjectFound = false
Do While Not TextStream.AtEndOfStream and not SubjectFound
Line = TextStream.readline
If Left(Line,9) = "Subject: " then
SubjectFound = True
MsgSubject = Right(Line,len(Line)-9)
End if
Loop
If MsgSubject = "" then MsgSubject="-"
Response.Write "<TD><font size=2>" & MsgSubject & "</TD>"
Set TextStream = nothing
Response.Write "<TD><font size=2><A HREF='View.asp?Filename=" & ObjFile.Name & "'>View</A></TD>"
Response.Write "<TD><font size=2><A HREF='Resubmit.asp?Filename=" & ObjFile.Name & "'>Resubmit</A></TD>"
Response.Write "<TD><font size=2><A HREF='DeleteMail.asp?Filename=" & ObjFile.Name & "'>Delete</A></TD>"
Response.Write "</TR>"
Next
End Sub
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
%>
<H2 align="center"><font face="Arial" color="#FF0000">Exchange IMF Archive Manager</font></H2>
<BR>
<font face="Arial" size="2">
<A HREF=DeleteAll.asp>Delete all Archived mail</A>
<BR>
<BR>
<TABLE BORDER=2 CELLSPACING=0 CELLPADDING=2 bordercolorlight="#000000" bgcolor="#FFFF99" width="100%" bordercolor="#008000" style="border-collapse: collapse">
<TR>
<TD><font face="Arial" size="2"><B>From</B></TD>
<TD><font face="Arial" size="2"><B>To</B></TD>
<TD><font face="Arial" size="2"><B>SCL</B></TD>
<TD><font face="Arial" size="2"><B>Subject</B></TD>
</TR>
<%
dim ShowRecipient
Dim objFolder
Set objFolder = objFSO.GetFolder(Application("ArchiveDir"))
MsgCount = 0
ListDirectory objFolder
Response.Write ("</TABLE>")
Response.Write ("<P><P>")
Response.Write ("<B>" & MsgCount & " archived messages found</B>")
Response.Write ("<P><P>")
Response.Write ("<A HREF=DeleteAll.asp>Delete all Archived mail</A>")
%>
</font> |
Partager