want to add text into mail body using script
want to add text into mail body using script
Hi all,
I am not programming expert, but need to add some disclaimer into incoming mails from other domains, wondering why the script i used could not work.
Below is my script:
' Sub OnClientConnect(oClient)
' End Sub
' Sub OnSMTPData(oClient, oMessage)
' End Sub
Sub OnAcceptMessage(oClient, oMessage)
oMessage.Body = oMessage.Body & "CAUTION: This email was sent from a third party outside of OMGWHYCANNOTWORK. Please DO NOT click links or open attachments unless you recognize the sender and know the content is safe. If you believe this email is not safe, please forward the email to phishing@OMG"
oMessage.Save
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)
' End Sub
I use this hmail server to act as internal mail server after mails from external mail server imported into this server using pop3. But I could not get the text append to work.
Any expert here can help out?
btw, I am using version 5.6.6
Thanks a bunch!
I am not programming expert, but need to add some disclaimer into incoming mails from other domains, wondering why the script i used could not work.
Below is my script:
' Sub OnClientConnect(oClient)
' End Sub
' Sub OnSMTPData(oClient, oMessage)
' End Sub
Sub OnAcceptMessage(oClient, oMessage)
oMessage.Body = oMessage.Body & "CAUTION: This email was sent from a third party outside of OMGWHYCANNOTWORK. Please DO NOT click links or open attachments unless you recognize the sender and know the content is safe. If you believe this email is not safe, please forward the email to phishing@OMG"
oMessage.Save
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)
' End Sub
I use this hmail server to act as internal mail server after mails from external mail server imported into this server using pop3. But I could not get the text append to work.
Any expert here can help out?
btw, I am using version 5.6.6
Thanks a bunch!
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: want to add text into mail body using script
As you are importing via pop3 you will need to add using the onexternaldownload section. (Onacceptmessage is fgor smtp messages).
[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: want to add text into mail body using script
OK noted.
Only add the codes in that section, right? The 3 elements no need to change?
Only add the codes in that section, right? The 3 elements no need to change?
Re: want to add text into mail body using script
ok checked into the log
"ERROR" 3004 "2020-04-21 15:45:27.712" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:07.540" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:11.188" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:27.740" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
oh no, argument error
"ERROR" 3004 "2020-04-21 15:45:27.712" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:07.540" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:11.188" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3136 "2020-04-21 15:47:27.273" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01A8 - Description: Object required: 'oMessage' - Line: 29 Column: 1 - Code: (null)"
"ERROR" 3004 "2020-04-21 15:47:27.740" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
oh no, argument error
Re: want to add text into mail body using script
I only have 31 lines here, where did the line 33 error came from
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: want to add text into mail body using script
Post the entire contents of your handlers script please.
[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: want to add text into mail body using script
' 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(oMessage)
oMessage.Body = oMessage.Body & "CAUTION: This email was sent from a third party outside of OMGGG. Please DO NOT click links or open attachments unless you recognize the sender and know the content is safe. If you believe this email is not safe, please forward the email to spammm"
oMessage.Save
End Sub
for the rules, i set the condition as mail from : not contain @domain.com, will run function OnExternalAccountDownload
Pop3 mails coming in no problem
' 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(oMessage)
oMessage.Body = oMessage.Body & "CAUTION: This email was sent from a third party outside of OMGGG. Please DO NOT click links or open attachments unless you recognize the sender and know the content is safe. If you believe this email is not safe, please forward the email to spammm"
oMessage.Save
End Sub
for the rules, i set the condition as mail from : not contain @domain.com, will run function OnExternalAccountDownload
Pop3 mails coming in no problem
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: want to add text into mail body using script
You have changed the OnExternalAccountDownload parameters. Change it back to
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
Also the sub section is run automatically against every message downloaded automatically - you do not need to call it by rules. So for conditioning you should put your condition in the script itself (instead of using a rule).
[Entered by mobile. Excuse my spelling.]
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
Also the sub section is run automatically against every message downloaded automatically - you do not need to call it by rules. So for conditioning you should put your condition in the script itself (instead of using a rule).
[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: want to add text into mail body using script
this is the log:
"ERROR" 3120 "2020-04-21 16:21:27.659" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.661" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.661" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.664" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.664" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.666" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.666" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.671" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.671" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.659" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.661" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.661" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.664" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.664" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.666" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.666" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.669" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.671" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
"ERROR" 3120 "2020-04-21 16:21:27.671" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01C2 - Description: Wrong number of arguments or invalid property assignment: 'OnExternalAccountDownload' - Line: 33 Column: 0 - Code: (null)"
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: want to add text into mail body using script
Have you removed the rule?
Post the entire contents of your handlers script please.
[Entered by mobile. Excuse my spelling.]
Post the entire contents of your handlers script please.
[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: want to add text into mail body using script
Need to remove the rule?
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: want to add text into mail body using script
jimimaseye wrote: ↑2020-04-21 10:17You have changed the OnExternalAccountDownload parameters. Change it back to
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
Also the sub section is run automatically against every message downloaded automatically - you do not need to call it by rules. So for conditioning you should put your condition in the script itself (instead of using a rule).
[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: want to add text into mail body using script
hi thanks for reply. but unfortunately it is still not working.
Re: want to add text into mail body using script
It only works if i use "server sendout" which, any outside email from gmail does not work