'#################################################### 'THIS FILE CAN BE USED FOR MOVING HIJACKED FILES 'BACK INTO THE SPOOL FOLDER FROM THE HOLD FOLDER 'JUST EDIT THE NEXT LINES TO POINT TO THE LOCATION 'OF YOUR SPOOL FOLDER AND HOLD FOLDER 'DATE: 31ST DECEMBER 2006 ' 'UPDATES '25/10/2007 - added ability for ip address to be added to the hijack.cfg file '7/12/2007 - added the ability for a note and timestamp to be added to the hijack.cfg file '#################################################### 'the location of your spool folder strSpoolFolder= "C:\IMail\Spool\" 'the location of your hold folder strHoldFolder="C:\IMail\Spool\spam\hold2\" 'hijack file location strHijackFile="C:\IMail\declude\hijack.cfg" '#################################################### 'NO NEED TO EDIT ANYTHING BELOW THIS LINE '#################################################### Dim objFSO, objFolder Dim strArgument, strIP, strSpoolFolder Dim arrFiles, strFile, arrFilePieces, strFileIP, strFileTemp 'Populate the argument strings if they are specified For Each strArgument In WScript.Arguments strArgument = LCase(strArgument) If Instr(1, strArgument, "ip=", 1) = 1 Then strIP = Replace(strArgument, "ip=", "") ElseIf Instr(1, strArgument, "sf=", 1) = 1 Then strSpoolFolder = Replace(strArgument, "sf=", "") End If Next 'Inputbox for ip address to check While (Len(strIP) <= 0) strMbox = MsgBox("Would You like to Enter an IP Address to release hijacked files?",4,"IMAIL HIJACK RELEASE PROCESS") If strMbox = 6 Then strIP = InputBox("Please Insert an IP Address in the field below","IMAIL HIJACK RELEASE PROCESS","Enter Your IP Address Here") strNOTE = InputBox("Please Enter a Note or Comment in the field below","IMAIL HIJACK RELEASE PROCESS","Enter Your Note Here") Else WScript.Quit End If Wend 'Set the default location of the spool If (Len(strSpoolFolder) <= 0) Then strSpoolFolder = strSpoolFolder End If 'Get an array with the files contained in the Hold2 directory under the spool Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strHoldFolder) Set arrFiles = objFolder.Files Set objFolder = Nothing 'Loop through the files and move any that match the IP naming pattern to the spool For Each strFile in arrFiles strFileTemp = objFSO.GetBaseName(strFile) & "." & objFSO.GetExtensionName(strFile) strFileTemp = LCase(strFileTemp) strFileTemp = Replace(strFileTemp, "ip", "") arrFilePieces = Split(strFileTemp, ".", -1, 1) If UBound(arrFilePieces) = 6 And arrFilePieces(UBound(arrFilePieces)) = "smd" Then If arrFilePieces(0) & "." & arrFilePieces(1) & "." & arrFilePieces(2) & "." & arrFilePieces(3) = strIP Then objFSO.MoveFile strFile, strSpoolFolder & UCase(arrFilePieces(5)) & ".SMD" End If End If Next Set objFSO = nothing 'now lets add this ip to the hijack file Set objFSO = CreateObject("Scripting.FileSystemObject") Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set f = objFSO.OpenTextFile(strHijackFile, 8, True) f.write "ALLOWIP " & strIP & " #" & strNOTE & " - date: " & now() & vbCRLF Set objFSO = nothing