Is there a logfile for antispam results :?:
Is there a logfile for antispam results :?:
I have configured antispam on my hmailserver (5.6.7-B2425)
I defined a rule, that spam-emails are sent to a different email if the ranking is too high.
As the rule did some mails, I know, that it is basicly working.
But can I see somewhere a protocol of the work of antispam? I searched the logfiles, but without success.
BTW: Using hMailserver Administrator, i see in the menu-tree a red circle with a crossed line at the folder of Antispam. Is this ok?
Looks like the program wants to tell me, that antispam is not active...
regards/brutzler
I defined a rule, that spam-emails are sent to a different email if the ranking is too high.
As the rule did some mails, I know, that it is basicly working.
But can I see somewhere a protocol of the work of antispam? I searched the logfiles, but without success.
BTW: Using hMailserver Administrator, i see in the menu-tree a red circle with a crossed line at the folder of Antispam. Is this ok?
Looks like the program wants to tell me, that antispam is not active...
regards/brutzler
Re: Is there a logfile for antispam results :?:
What exactly would you like to see?
Re: Is there a logfile for antispam results :?:
I would like to see infos from the spam-scanned mails:
- what spam ranking did they get
- what action did hMailserver with the Mails.
Because it looks like, that hmailserver (I use it for POP all my email-accounts from my provider to my local (h)mail-server with IMAP-accounts) does not pop any more all emails since I activated antispam.
- what spam ranking did they get
- what action did hMailserver with the Mails.
Because it looks like, that hmailserver (I use it for POP all my email-accounts from my provider to my local (h)mail-server with IMAP-accounts) does not pop any more all emails since I activated antispam.
Re: Is there a logfile for antispam results :?:
You could log stuff to the event log. Put this code in OnAcceptMessage in EventHandlers.vbs:
Or you could set up a custom log.
Code: Select all
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
Or you could set up a custom log.
Re: Is there a logfile for antispam results :?:
OK
thanks for sharing the code.
I tried my best:
Searching for the file:
-> C:\Program Files (x86)\hMailServer\Events\EventHandlers.vbs
Its the right one, or?
Open it with notepad++ in admin mode, copy the lines from you:
Then going to scripts, activate them and reload the scripts.
After this I get an error-log:
Oh, i see, there is a bracket missing at the end. I add the bracket and repeat the script loading:
Next error message:
for this I have no solution
thanks for sharing the code.
I tried my best:
Searching for the file:
-> C:\Program Files (x86)\hMailServer\Events\EventHandlers.vbs
Its the right one, or?
Open it with notepad++ in admin mode, copy the lines from you:
Code: Select all
' Sub OnAcceptMessage(oClient, oMessage)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
' End Sub
After this I get an error-log:
Code: Select all
"ERROR" 10172 "2020-05-17 22:48:33.043" "Script Error: Source: Kompilierungsfehler in Microsoft VBScript - Error: 800A03EE - Description: ')' erwartet - Line: 14 Column: 64 - Code: EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress"
"ERROR" 10172 "2020-05-17 22:48:33.046" "Severity: 2 (High), Code: HM5016, Source: ScriptServer::LoadScripts, Description: File: C:\Program Files (x86)\hMailServer\Events\EventHandlers.vbs[nl]Script Error: Source: Kompilierungsfehler in Microsoft VBScript - Error: 800A03EE - Description: ')' erwartet - Line: 14 Column: 64 - Code: EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress"
Next error message:
Code: Select all
"ERROR" 5756 "2020-05-17 22:53:09.637" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 10 Column: 1 - Code: (null)"
"ERROR" 5756 "2020-05-17 22:53:09.637" "Severity: 2 (High), Code: HM5016, Source: ScriptServer::LoadScripts, Description: File: C:\Program Files (x86)\hMailServer\Events\EventHandlers.vbs[nl]Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 10 Column: 1 - Code: (null)"
Re: Is there a logfile for antispam results :?:
oh, me fool..
should remove the comment marks in front of the sub...
Now there is no error log on reloading the scripts.
But which sort of protocol has to be activated for the events?
- Application
- SMTP
- POP3
- IMAP
- TCP/IP
- Debug
- AWstats
should remove the comment marks in front of the sub...
Now there is no error log on reloading the scripts.
But which sort of protocol has to be activated for the events?
- Application
- SMTP
- POP3
- IMAP
- TCP/IP
- Debug
- AWstats
Re: Is there a logfile for antispam results :?:
Yes.
None. OnAcceptMessage is a scripting trigger so it will do whatever you tell it to do.Now there is no error log on reloading the scripts.
But which sort of protocol has to be activated for the events?
- Application
- SMTP
- POP3
- IMAP
- TCP/IP
- Debug
- AWstats
Re: Is there a logfile for antispam results :?:
Hmmm..
I thought your script should write into a logfile, right?
But I do not find any
Where (Which folder) should it be, and what should be the filename?
I thought your script should write into a logfile, right?
But I do not find any
Where (Which folder) should it be, and what should be the filename?
Re: Is there a logfile for antispam results :?:
That script writes to the hMailserver eventlog
typically
C:\Program Files (x86)\hMailServer\logs\hmailserver_events.log
But you can change that
typically
C:\Program Files (x86)\hMailServer\logs\hmailserver_events.log
But you can change that
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Is there a logfile for antispam results :?:
Hi,
I did not change anything regarding path/filename.
But there is no hmailserver_events.log
Scripts are activated and syntaxcheck is ok.
Is "reload scripts" enough, or do I have to restart the whole hmailserver-service?
I did not change anything regarding path/filename.
But there is no hmailserver_events.log
Scripts are activated and syntaxcheck is ok.
Is "reload scripts" enough, or do I have to restart the whole hmailserver-service?
Re: Is there a logfile for antispam results :?:
Reload is enough.
Hmailserver won't create the log until it has a need to. If hmailserver_events.log doesn't exist yet, that means you haven't received any spam since you enabled the script. Or, more precisely, hmailserver has not scored any messages as spam yet.
No spam. That's a nice lifestyle. I like that. It makes me think of sipping an exotic drink from a coconut shell on a tropical beach.
Hmailserver won't create the log until it has a need to. If hmailserver_events.log doesn't exist yet, that means you haven't received any spam since you enabled the script. Or, more precisely, hmailserver has not scored any messages as spam yet.
No spam. That's a nice lifestyle. I like that. It makes me think of sipping an exotic drink from a coconut shell on a tropical beach.
Re: Is there a logfile for antispam results :?:
When will this script be activated?
The script is called "Sub OnAcceptMessage(oClient, oMessage)"
In my opinion it is executed on every received email. Or not?
Because I thought the same and added a line at the beginning of the sub, where hmailserver should write a dummytext into the logfile.
And there is still no logfile.
The script is called "Sub OnAcceptMessage(oClient, oMessage)"
In my opinion it is executed on every received email. Or not?
Because I thought the same and added a line at the beginning of the sub, where hmailserver should write a dummytext into the logfile.
Code: Select all
Sub OnAcceptMessage(oClient, oMessage)
EventLog.Write ("######## Mail RECEIVED ########") <===================================== added by brutzler
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
.
.
.
.
Re: Is there a logfile for antispam results :?:
Correct. Actually, all messages.
That should write to the event log on every message.Because I thought the same and added a line at the beginning of the sub, where hmailserver should write a dummytext into the logfile.
And there is still no logfile.Code: Select all
Sub OnAcceptMessage(oClient, oMessage) EventLog.Write ("######## Mail RECEIVED ########") <===================================== added by brutzler REM - Log spam reasons Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7 If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then EventLog.Write ("######## SPAM RECEIVED ########") . . . .
If you go to the settings for scripts, do you have VBScript selected?
Are you receiving mail? Try sending yourself a message.
Also, I'm not sure if this affects the event log or not, but do you have logging enabled?
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
No it won't work because if this:
You should try moving it to the 'onexternaldownload' section.
[Entered by mobile. Excuse my spelling.]
That sub section is only for direct smtp delivered messages.
You should try moving it to the 'onexternaldownload' section.
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
OK, transferring the code from "OnAcceptMessage" to "OnExternalAccount" I get my added line for every mail in the expected file.
(After this i removed this testline.)
But the code from palinka is not working.
I get an error message:
And line 31 is the following:
BTW jimimaseye:
onexternaldownload == OnExternalAccountDownload???
(After this i removed this testline.)
But the code from palinka is not working.
I get an error message:
Code: Select all
"ERROR" 9332 "2020-05-18 11:55:12.702" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 1 - Code: (null)"
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
>>line31>> If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
End Sub
BTW jimimaseye:
onexternaldownload == OnExternalAccountDownload???
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
Yes.
Do a test. Remove the IF condition clause just to see if you get logging. Post the entire contents of your script file please.
More reference to subs: https://www.hmailserver.com/documentati ... ce_scripts
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
Hi,
the script is logging in deed:
out of the hmailserver_event.log
That is what I expected.
But sometimes I have some entries in the "ERROR_hmailserver_2020-05-18.log"
Thats what I showed you in the last posts.
Until now, I could not figure out, when and why.
Runtime Error means for me, that something is wrong in the code. But when I look at the hmailserver_event.log, the code looks working.
Here the entire script:
the script is logging in deed:
out of the hmailserver_event.log
Code: Select all
9280 "2020-05-18 12:04:22.508" "######## SPAM RECEIVED ########"
9280 "2020-05-18 12:04:22.510" "Total Spam Score : 10"
9280 "2020-05-18 12:04:22.511" "Spam From : Hermenegild <hermenegildnphnxjp@papernom.com>"
9280 "2020-05-18 12:04:22.512" "Spam Envelope From : hermenegildnphnxjp@papernom.com"
9280 "2020-05-18 12:04:22.513" "Spam To : xxxx@yyyyyyyyyy.de"
9280 "2020-05-18 12:04:22.517" "Spam Reason : Sender domain does not have any MX records. - (Score: 2)"
9280 "2020-05-18 12:04:22.518" "Spam Reason : Rejected by SURBL. - (Score: 3)"
9280 "2020-05-18 12:04:22.519" "Spam Reason : Rejected by DKIM. - (Score: 5)"
But sometimes I have some entries in the "ERROR_hmailserver_2020-05-18.log"
Code: Select all
"ERROR" 9332 "2020-05-18 12:01:18.717" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 1 - Code: (null)"
Until now, I could not figure out, when and why.
Runtime Error means for me, that something is wrong in the code. But when I look at the hmailserver_event.log, the code looks working.
Here the entire script:
Code: Select all
' Sub OnClientConnect(oClient)
' End Sub
' Sub OnSMTPData(oClient, oMessage)
' End Sub
' Sub OnAcceptMessage(oClient, oMessage)
' End Sub
' Sub OnDeliveryStart(oMessage)
' End Sub
' Sub OnDeliverMessage(oMessage)
' End Sub
' Sub OnBackupFailed(sReason)
' End Sub
' Sub OnBackupCompleted()
' End Sub
' Sub OnError(iSeverity, iCode, sSource, sDescription)
' End Sub
' Sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
' End Sub
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
End Sub
Re: Is there a logfile for antispam results :?:
If you add a line
On Error Resume Next
just after the line "REM - Log spam reasons" the error will magically go away - it will not solve the issue, but the error will go away.
There is something fundamentally wrong somewhere and I'm wondering if the problem is oMessage not being initialised by hMailServer so it becomes an empty object.
On Error Resume Next
just after the line "REM - Log spam reasons" the error will magically go away - it will not solve the issue, but the error will go away.
There is something fundamentally wrong somewhere and I'm wondering if the problem is oMessage not being initialised by hMailServer so it becomes an empty object.
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
+1
And if true it's likely that the testing of the headers (as initially required) will not be possible in this section.
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
What could cause this? I don't think any configuration error could be the cause.jimimaseye wrote: ↑2020-05-18 14:40+1
And if true it's likely that the testing of the headers (as initially required) will not be possible in this section.
[Entered by mobile. Excuse my spelling.]
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
I think an error in hmailserver itself although I'm pretty sure a similar solution was proposed and adapted a couple of weeks ago for someone else. Maybe someone has an account that uses external downloads to do a test of the omessage object. Also perhaps test against 5.7.
[Entered by mobile. Excuse my spelling.]
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
I would not be surprised if oMessage only get populated when there are mails waiting...
Looking at events.cpp I came across this...
so ... maybe ... "If oMessage Is Nothing Then Exit Sub" ??
https://developer.rhino3d.com/guides/rh ... mpty-null/
Looking at events.cpp I came across this...
Code: Select all
if (pMessage)
sEventCaller.Format(_T("OnExternalAccountDownload(HMAILSERVER_FETCHACCOUNT, HMAILSERVER_MESSAGE, \"%s\")"), sRemoteUIDCopy.c_str());
else
sEventCaller.Format(_T("OnExternalAccountDownload(HMAILSERVER_FETCHACCOUNT, Nothing, \"%s\")"), sRemoteUIDCopy.c_str());
https://developer.rhino3d.com/guides/rh ... mpty-null/
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
Should work.
I use this method in the diag script and, funnily enough, I have just had to change it for another occurence of this method (line 1138).
so
EDIT: Come to think of it I have encountered this very issue before with 'OnExternalAccountDownload' and catered for it with this method in my production scripts. But forgot.
I use this method in the diag script and, funnily enough, I have just had to change it for another occurence of this method (line 1138).
so
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If not oMessage is Nothing and oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
End Sub
EDIT: Come to think of it I have encountered this very issue before with 'OnExternalAccountDownload' and catered for it with this method in my production scripts. But forgot.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
Can delete this line too.
Its a remnant from where I copied it.
Code: Select all
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
Re: Is there a logfile for antispam results :?:
hmailserver with the "on error resume next" -line did now run for 8h.
Thats the result of the hmailserver_events.log
Very often I have only the "SPAM RECEIVED" -line:
To say: the log-file has atm ~ 12000 lines. And there are 50 detailed spam messages. The rest is only the "SPAM RECEIVED" -line
You think, I should modify this line too?
Thats the result of the hmailserver_events.log
Very often I have only the "SPAM RECEIVED" -line:
To say: the log-file has atm ~ 12000 lines. And there are 50 detailed spam messages. The rest is only the "SPAM RECEIVED" -line
Code: Select all
2856 "2020-05-18 15:41:56.016" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.016" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.016" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.016" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.016" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.031" "######## SPAM RECEIVED ########"
2856 "2020-05-18 15:41:56.047" "######## SPAM RECEIVED ########"
9280 "2020-05-18 15:41:56.250" "######## SPAM RECEIVED ########"
9280 "2020-05-18 15:41:56.250" "Total Spam Score : 10"
9280 "2020-05-18 15:41:56.250" "Spam From : Gisbert <gisbertetthffk@lawapass.com>"
9280 "2020-05-18 15:41:56.250" "Spam Envelope From : gisbertetthffk@lawapass.com"
9280 "2020-05-18 15:41:56.250" "Spam To : xxxxx@yyyyyyyy.de"
9280 "2020-05-18 15:41:56.250" "Spam Reason : Rejected by SURBL. - (Score: 3)"
9280 "2020-05-18 15:41:56.250" "Spam Reason : Rejected by DKIM. - (Score: 5)"
9280 "2020-05-18 15:41:56.250" "Spam Reason : Sender domain does not have any MX records. - (Score: 2)"
4328 "2020-05-18 15:43:57.665" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.680" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.680" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.696" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.696" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.696" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.712" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.712" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.712" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.727" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.727" "######## SPAM RECEIVED ########"
4328 "2020-05-18 15:43:57.727" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.692" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.692" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.708" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.708" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.723" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.723" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.739" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.739" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.739" "######## SPAM RECEIVED ########"
9332 "2020-05-18 15:44:58.739" "######## SPAM RECEIVED ########"
Code: Select all
If not oMessage is Nothing and oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
I tried and again the error messages with the runtime error:jimimaseye wrote: ↑2020-05-18 19:38I posted the code you should use in my last post.
[Entered by mobile. Excuse my spelling.]
Code: Select all
"ERROR" 2060 "2020-05-18 20:42:51.670" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
Show the script please.
Also did you 'reload' the script after changing it?
[Entered by mobile. Excuse my spelling.]
Also did you 'reload' the script after changing it?
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
I copied it directly from your post.
And YES, I reloaded the script.
And YES, I reloaded the script.
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If not oMessage is Nothing and oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then
'If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
End Sub
Re: Is there a logfile for antispam results :?:
Hey,
just one idea:
As I told you, I make POP3 from my external provider.
Just right now on testing the Anti-Spam and not to lose any important email, I configured the external account that the emails are not deleted at once, but stay for one day.
I see, in the "normal" log, that the external account tells me, there are 12 "old" emails, and after this I get 12 of the error messages.
Maybe that is the reason?
just one idea:
As I told you, I make POP3 from my external provider.
Just right now on testing the Anti-Spam and not to lose any important email, I configured the external account that the emails are not deleted at once, but stay for one day.
I see, in the "normal" log, that the external account tells me, there are 12 "old" emails, and after this I get 12 of the error messages.
Maybe that is the reason?
Code: Select all
"DEBUG" 8840 "2020-05-18 21:37:45.300" "Adding task ExternalFetchTask to work queue External fetch queue"
"DEBUG" 3396 "2020-05-18 21:37:45.300" "Executing task ExternalFetchTask in work queue External fetch queue"
"DEBUG" 3396 "2020-05-18 21:37:45.300" "Retrieving messages from external account xxx@yyy.de"
"DEBUG" 3396 "2020-05-18 21:37:45.300" "Creating session 1189"
"DEBUG" 9632 "2020-05-18 21:37:45.316" "TCP connection started for session 1189"
"DEBUG" 9632 "2020-05-18 21:37:45.316" "Performing SSL/TLS handshake for session 1189. Verify certificate: True, Expected remote host name: pop.provider.de"
"DEBUG" 9632 "2020-05-18 21:37:45.347" "Certificate verification succeeded for session 1189."
"POP3C" 9632 1189 "2020-05-18 21:37:45.597" "222.222.222.111" "RECEIVED: +OK POP server ready H mieue153 1M41Sw-1jalZ40zrs-045kD7"
"POP3C" 9632 1189 "2020-05-18 21:37:45.597" "222.222.222.111" "SENT: USER xxx@yyy.de"
"POP3C" 9276 1189 "2020-05-18 21:37:45.612" "222.222.222.111" "RECEIVED: +OK password required for user "xxx@yyy.de""
"POP3C" 9276 1189 "2020-05-18 21:37:45.612" "222.222.222.111" "SENT: ***"
"POP3C" 9276 1189 "2020-05-18 21:37:45.644" "222.222.222.111" "RECEIVED: +OK mailbox "xxx@yyy.de" has 12 messages (1310985 octets) H mieue153"
"POP3C" 9276 1189 "2020-05-18 21:37:45.644" "222.222.222.111" "SENT: UIDL"
"POP3C" 2060 1189 "2020-05-18 21:37:45.659" "222.222.222.111" "RECEIVED: +OK[nl]1 1M2vjm-1jdtb1jDw-003KDanl]2 1MWil6-1jYQX0cSO-00X7Ei[nl]3 1Mog5B-1jHG373VYP-00p3OK[nl]4 1MJmvv-1jLP5J09sH-00KAwN[nl]5 1MMFRG-1jJU7Q3aaM-00JKtM[nl]6 1Mhks2-1j5xhW00dU-0dk0i[nl]7 1MfIAH-1j7sW0zNL-00gm1M[nl]8 1MEn2D-1jpm0W0Tz1-00GtB[nl]9 1M8A4J1jekRK0Zv-005Ij[nl]10 1MKawm-1jME6c3YWS00KvTn[nl]11 1N3smG-1isF63Upc-00zrSa[nl]12 1MP0nc-1jQt9F0ypI-00PJAi[nl]."
"DEBUG" 2060 "2020-05-18 21:37:45.659" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.659" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.675" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.675" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.675" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.675" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.675" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.675" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.690" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.690" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.690" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.690" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.690" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.690" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.706" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.706" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.706" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.722" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.722" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.722" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.722" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.722" "Executing event OnExternalAccountDownload"
"ERROR" 2060 "2020-05-18 21:37:45.722" "Script Error: Source: Laufzeitfehler in Microsoft VBScript - Error: 800A01A8 - Description: Objekt erforderlich: 'oMessage' - Line: 31 Column: 3 - Code: (null)"
"DEBUG" 2060 "2020-05-18 21:37:45.737" "Event completed"
"DEBUG" 2060 "2020-05-18 21:37:45.737" "POP3 External Account: Normal QUIT."
"POP3C" 2060 1189 "2020-05-18 21:37:45.737" "222.222.222.111" "SENT: QUIT"
"POP3C" 9384 1189 "2020-05-18 21:37:45.753" "222.222.222.111" "RECEIVED: +OK POP server signing off"
"DEBUG" 9384 "2020-05-18 21:37:45.753" "Ending session 1189"
"DEBUG" 3396 "2020-05-18 21:37:45.753" "Completed retrieval of messages from external account."
Re: Is there a logfile for antispam results :?:
SorenR wrote: ↑2020-05-18 15:45I would not be surprised if oMessage only get populated when there are mails waiting...
Looking at events.cpp I came across this...
so ... maybe ... "If oMessage Is Nothing Then Exit Sub" ??Code: Select all
if (pMessage) sEventCaller.Format(_T("OnExternalAccountDownload(HMAILSERVER_FETCHACCOUNT, HMAILSERVER_MESSAGE, \"%s\")"), sRemoteUIDCopy.c_str()); else sEventCaller.Format(_T("OnExternalAccountDownload(HMAILSERVER_FETCHACCOUNT, Nothing, \"%s\")"), sRemoteUIDCopy.c_str());
https://developer.rhino3d.com/guides/rh ... mpty-null/
Sounds about right. Try "If oMessage Is Nothing Then Exit Sub".brutzler wrote: ↑2020-05-18 21:49Hey,
just one idea:
As I told you, I make POP3 from my external provider.
Just right now on testing the Anti-Spam and not to lose any important email, I configured the external account that the emails are not deleted at once, but stay for one day.
I see, in the "normal" log, that the external account tells me, there are 12 "old" emails, and after this I get 12 of the error messages.
Maybe that is the reason?
Try this
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
If oMessage Is Nothing Then
Exit Sub
Else If oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
End Sub
Re: Is there a logfile for antispam results :?:
Already added..
But imho, this is then enough, or? No need for the marked line.
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If oMessage Is Nothing Then Exit Sub
'If not oMessage is Nothing and oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then <-------------------------------------
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
Last edited by brutzler on 2020-05-18 22:04, edited 1 time in total.
Re: Is there a logfile for antispam results :?:
I edited my post while you were posting - see my last post.brutzler wrote: ↑2020-05-18 22:01Already added..
But imho, this is then enough, or? No need for the marked line.
waiting for results...Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
Dim Reason1, Reason2, Reason3, Reason4, Reason5, Reason6, Reason7
If oMessage Is Nothing Then Exit Sub
'If not oMessage is Nothing and oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then <-------------------------------------
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
Re: Is there a logfile for antispam results :?:
I see....
OK, you have an additional "else"
OK, you have an additional "else"
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
Try this:
[Entered by mobile. Excuse my spelling.]
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
REM - Log spam reasons
If not oMessage is Nothing then
If oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam From : " & oMessage.From)
EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress)
EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address)
If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0"))
If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1"))
If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2"))
If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3"))
If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4"))
If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5"))
If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6"))
If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7"))
End If
END IF
End Sub
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
Compiling error.palinka wrote: ↑2020-05-18 21:55
Try this
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID) REM - Log spam reasons If oMessage Is Nothing Then Exit Sub Else If oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then EventLog.Write ("######## SPAM RECEIVED ########") EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score")) EventLog.Write ("Spam From : " & oMessage.From) EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress) EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address) If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0")) If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1")) If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2")) If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3")) If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4")) If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5")) If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6")) If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7")) End If End Sub
I suggest a second "End If"
Re: Is there a logfile for antispam results :?:
No, it's ElseIf. I always get ElseIf and Else If confused.brutzler wrote: ↑2020-05-18 22:21Compiling error.palinka wrote: ↑2020-05-18 21:55
Try this
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID) REM - Log spam reasons If oMessage Is Nothing Then Exit Sub Else If oMessage.HeaderValue("X-hMailServer-Spam") = "YES" Then EventLog.Write ("######## SPAM RECEIVED ########") EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score")) EventLog.Write ("Spam From : " & oMessage.From) EventLog.Write ("Spam Envelope From : " & oMessage.FromAddress) EventLog.Write ("Spam To : " & oMessage.Recipients(0).Address) If (oMessage.HeaderValue("X-hMailServer-Reason-0") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-0")) If (oMessage.HeaderValue("X-hMailServer-Reason-1") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-1")) If (oMessage.HeaderValue("X-hMailServer-Reason-2") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-2")) If (oMessage.HeaderValue("X-hMailServer-Reason-3") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-3")) If (oMessage.HeaderValue("X-hMailServer-Reason-4") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-4")) If (oMessage.HeaderValue("X-hMailServer-Reason-5") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-5")) If (oMessage.HeaderValue("X-hMailServer-Reason-6") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-6")) If (oMessage.HeaderValue("X-hMailServer-Reason-7") <> "") Then EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-7")) End If End Sub
I suggest a second "End If"
Re: Is there a logfile for antispam results :?:
imho a lot of possibilities.
But looks good now.
Log working as expected. and no error messages.
Finaly question for my interest:
Is there any documentation for all possible sub-classes of 'oMessage'
I have seen the following:
- oMessage.HeaderValue
- oMessage.From
- oMessage.FromAddress
- oMessage.Recipients(0).Address
Think there is more....
BTW:
Big Thanks for your help
But looks good now.
Log working as expected. and no error messages.
Finaly question for my interest:
Is there any documentation for all possible sub-classes of 'oMessage'
I have seen the following:
- oMessage.HeaderValue
- oMessage.From
- oMessage.FromAddress
- oMessage.Recipients(0).Address
Think there is more....
BTW:
Big Thanks for your help
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
You can probably start with the link at the top that says "documentation".
Re: Is there a logfile for antispam results :?:
Yes correct
And also once for EACH message waiting
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Is there a logfile for antispam results :?:
Yes. As previously determined.
[quoteoMessage - The message which has been downloaded. If the message has already been downloaded before, this parameter will be Nothing / Null][/quote]
https://www.hmailserver.com/documentati ... ntdownload
[Entered by mobile. Excuse my spelling.]
[quoteoMessage - The message which has been downloaded. If the message has already been downloaded before, this parameter will be Nothing / Null][/quote]
https://www.hmailserver.com/documentati ... ntdownload
[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Is there a logfile for antispam results :?:
Just had a weird experience...
In the beginning of my EventHandlers.vbs I set several constants, one is named "PASSWORD" and is the password of my Amin user for when doing "Call m_oApp.Authenticate(ADMIN, PASSWORD)"...
I changed my GMail account today from automatic forward to allowing POP access and created an "External account" on my account.
When there is new mail in my GMail I get this:
So I did a Search/Replace All in my script changing PASSWORD to PASSWD ...
The error is now gone ... (o)(O) ... WTF ??? hMailServer (RvdH+) 5.6.8-B2505.27
In the beginning of my EventHandlers.vbs I set several constants, one is named "PASSWORD" and is the password of my Amin user for when doing "Call m_oApp.Authenticate(ADMIN, PASSWORD)"...
I changed my GMail account today from automatic forward to allowing POP access and created an "External account" on my account.
When there is new mail in my GMail I get this:
Code: Select all
"ERROR" 1432 "2020-05-19 10:25:54.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A0411 - Description: Name redefined: 'PASSWORD' - Line: 11 Column: 0 - Code: (null)"
The error is now gone ... (o)(O) ... WTF ??? hMailServer (RvdH+) 5.6.8-B2505.27
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
Re: Is there a logfile for antispam results :?:
Ok, the PASSWORD problem is now verified by this code snippet
There is NO "Dim password" anywhere in my script!
Output is the email address and the password (!!) so the variable "password" is equal to "oFetchAccount.Password" ... Hmm ... Am I missing something?
There is NO "Dim password" anywhere in my script!
Code: Select all
'
' Any messages?
'
If oMessage Is Nothing Then
Exit Sub
Else
If Not IsEmpty(password) Then EventLog.Write("FetchAccount=" & oFetchAccount.Username & " Password=" & password)
End If
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
Re: Is there a logfile for antispam results :?:
Anyways - my script.
Code: Select all
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
Dim i, Done, strTo, strOriginalTo
'
' Safeguard ON ;-)
'
Rem On Error Resume Next
'
' Any messages?
'
If oMessage Is Nothing Then Exit Sub
'
' Got SPAM?
'
If (oMessage.HeaderValue("X-hMailServer-Spam") = "YES") Then
EventLog.Write ("######## SPAM RECEIVED ########")
EventLog.Write ("Total Spam Score : " & oMessage.HeaderValue("X-hMailServer-Reason-Score"))
EventLog.Write ("Spam (Header) From : " & oMessage.From)
EventLog.Write ("Spam (Header) To : " & oMessage.To)
EventLog.Write ("Spam (Header) Cc : " & oMessage.Cc)
'
' Extract Envelope addressing = SMTP conversation, non-spoofable.
'
For i = 0 To oMessage.Recipients.Count-1
If (i = 0) Then
strTo = oMessage.Recipients(i).Address
strOriginalTo = oMessage.Recipients(i).OriginalAddress
Else
strTo = strTo & ", " & oMessage.Recipients(i).Address
strOriginalTo = strOriginalTo & ", " & oMessage.Recipients(i).OriginalAddress
End If
Next
EventLog.Write ("Spam (Envelope) From : " & oMessage.FromAddress)
EventLog.Write ("Spam (Envelope) To : " & strTo)
EventLog.Write ("Spam (Envelope) To (Original) : " & strOriginalTo)
'
' List all results of hMailServer SPAM detections, 0 to howevermanydefined
'
i = 1 : Done = False
Do Until Done
If (oMessage.HeaderValue("X-hMailServer-Reason-" & i) = "") Then Exit Do
EventLog.Write ("Spam Reason : " & oMessage.HeaderValue("X-hMailServer-Reason-" & i))
i = i + 1
'
' Failsafe ;-)
'
If i = 20 Then Done = True
Loop
End If
'
' Safeguard OFF ;-)
'
Rem On Error GoTo 0
End Sub
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.