mhouldridge
10-29-2004, 03:36 AM
Hi,
I would like to know what the Split(Command(),"") part of the below script does.... near the beginning. This script has been taken from a mail server program. It has the function to allow you to delete any emails that coontain executables.
Dim sMsgCommandFile as String
Dim sMsgFile as String
Dim hFile As Long
Dim args() As String
Dim sFileLine as String
args() = Split(Command(), " ")
sMsgCommandFile = GetRegistryString("SOFTWARE\Mail Enable\Mail Enable", "Data Directory") & _
"\QUEUES\" & args(1) & "\Inbound\" & args(0)
sMsgFile = GetRegistryString("SOFTWARE\Mail Enable\Mail Enable", "Data Directory") & _
"\QUEUES\" & args(1) & "\Inbound\Messages\" & args(0)
hFile = FreeFile
bPerformAction = False
On Error goto Err Handler
Open sMsgFile For Input as #hFile
While Not EOF(hFile)
Line Input #hFile, sFileLine
if Instr(1,lCase(sFileLine),".exe") Then
bPerformAction = True
Exit While
end if
Wend
Close (hFile)
if PerformAction = True Then
Kill(MsgCommandFile)
Kill(MsgFile)
Exit Sub
ErrHandler:
App.LogEvent "Could not process pickup event for Connector: " & ConnectorCode & _
" Message ID: " & MessageID
End Sub
I would like to know what the Split(Command(),"") part of the below script does.... near the beginning. This script has been taken from a mail server program. It has the function to allow you to delete any emails that coontain executables.
Dim sMsgCommandFile as String
Dim sMsgFile as String
Dim hFile As Long
Dim args() As String
Dim sFileLine as String
args() = Split(Command(), " ")
sMsgCommandFile = GetRegistryString("SOFTWARE\Mail Enable\Mail Enable", "Data Directory") & _
"\QUEUES\" & args(1) & "\Inbound\" & args(0)
sMsgFile = GetRegistryString("SOFTWARE\Mail Enable\Mail Enable", "Data Directory") & _
"\QUEUES\" & args(1) & "\Inbound\Messages\" & args(0)
hFile = FreeFile
bPerformAction = False
On Error goto Err Handler
Open sMsgFile For Input as #hFile
While Not EOF(hFile)
Line Input #hFile, sFileLine
if Instr(1,lCase(sFileLine),".exe") Then
bPerformAction = True
Exit While
end if
Wend
Close (hFile)
if PerformAction = True Then
Kill(MsgCommandFile)
Kill(MsgFile)
Exit Sub
ErrHandler:
App.LogEvent "Could not process pickup event for Connector: " & ConnectorCode & _
" Message ID: " & MessageID
End Sub