Hi All,
I have a device in which reviews email and tags spam by placing "Spam: " as the first part of the subject. I would like to have all email that arrive with Spam: in the subject to be sent to a spam catchall folder and not the the intended recipient. Below VB scritp I am using and the batch file to register it. If some coudl look at it an give me some thought or solutions that woudl be great.
Thank you
'<SCRIPT language="VBScript">
' File: Spam_filter.VBS
Const cdoRunNextSink = 0
Sub ISMTPOnArrival_OnArrival(B
yVal Msg, EventStatus)
If (InStr(1, Msg.Subject, "Spam: ", 1) > 0)then
Msg.EnvelopeFields("
http://schemas.microsoft.com/cdo/smtpenvelope/recipientlist").Valu
e = "SMTP:spamaccount@domain.l
ocal"
' save changes to the mail
Msg.EnvelopeFields.Update
EventStatus = cdoRunNextSink
else
EventStatus = cdoRunNextSink
end if
End Sub
'File: RegSpamfiler.cmd
cscript smtpreg.vbs /add 1 onarrival Filter_Spam CDO.SS_SMTPOnArrivalSink "Mail From=*"
cscript smtpreg.vbs /setprop 1 onarrival Filter_Spam Sink ScriptName "C:\scripts\Spam_filter.VB
S"
net stop smtpsvc & net start smtpsvc
Start Free Trial