I run an Email Server using MailEnable (on a W2008r2 Web Box).
To reduce the amount of Spam, I am using Spam Assassin.
Spam Assassin needs various switches to be set, and will only seem to run properly if I submit the command thus:
c:\SpamA\spamassassin.exe -e c:\DATA\MAILEN~1\QUEUES\QUEUENAME\INBOUND\MESSAGES\FILENAME.MAI > c:\DATA\MAILEN~1\QUEUES\QUEUENAME\INBOUND\MESSAGES\FILENAME.MAIL
MailEnable can only run the "Pickup Event" as:
C:\SpamA\spamassassin.exe FILENAME QUEUENAME
So, I introduced a Batch File to do the processing. MailEnable's Pickup event is now Filter.CMD, which builds and runs the Spam Assassin Command.
The above works, but I now need to do more processing of the email.
Spam Assassin is marking legitimate email as SPAM when one of my users connects from a Mobile or Coffee Shop WiFi connection, as SpamAssassin sees these connections as Spammy.
My Work around:
To do the extra processing, I wanted to use VBS rather than CMD (as I can do VBS, and it should have the power to do what I need).
The problem I face is that CMD will run and wait for SpamAssassin to finish, whereas (even with the WAIT option) VBS will not. Running:
WshShell.Run SpamAssassinCommand, 1, True
WScript.Echo("This is too early")
... brings up the output box "This is too early" before the SpamAssassin Command has finished.
Any pointers as to what I am doing wrong, or how I can make VBS wait for Spam Assassin to finish before moving on would be appreciated.