How to debug scripts?

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

How to debug scripts?

Post by fatman45 » 2019-06-10 23:39

How can I debug a script? I have enabled debug in the logging options, but all I see is

Code: Select all

"DEBUG"	2548	"2019-06-10 11:13:11.580"	"Executing event OnMessageDeliver"
"DEBUG"	2548	"2019-06-10 11:13:11.580"	"Event completed"
I am trying to write to a database when a message arrives from a cell phone number with STOP in the message. I had this working at one time, but recently noticed it had stopped working. If that's not the message, I set Result.Value = 1 so that the message is not even delivered. If it is, I set Result.Value = 0. The messages are actually being delivered, so I know they are going through the code where I am attempting to add/update the database. But nothing happens in the DB, and no other errors are generated in hMailServer. I even added a sub to print out messages; it also does nothing when called inside of that block and no errors show in the hMailServer logs.

Code: Select all

Sub PrintDebug(Variable, Value)

	Dim fso 
	Dim f
	
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set f = fso.OpenTextFile("D:\hMailServer\Logs\") & "\Log" & Year(Date) & Month(Date) & Day(Date) & ".log", ForAppending, True)

	f.Write Now() & vbTab & Variable & "=" & Value & vbCrLf
	f.Close
	
	Set f = Nothing
	Set fso = Nothing
	
End Sub
Any suggestions?

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-11 01:47

I usually plaster new code all over with "EventLog.Write( "bla bla = " & value )" so I can follow progress in the EventLog.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 01:59

Thanks for the reply. After reading several other posts here, I tried that also. I still see nothing. So I decided to put EventLog.Write directly after the start of the sub and right at the end.

Code: Select all

	Sub OnDeliverMessage(oMessage)
EventLog.Write("Begin - " & oMessage.To)
'... other code here ...
EventLog.Write("End - " & oMessage.From)
	End Sub
Neither of those messages shows up in the Event log!

Code: Select all

"DEBUG"	5336	"2019-06-10 16:52:49.804"	"Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Delivering message..."
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Applying rules"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Executing event OnMessageDeliver"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Event completed"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Performing local delivery"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Applying rules"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Saving message: {12F8EB54-C6BF-4949-8DED-6AF2B855CD82}.eml"
"DEBUG"	4584	"2019-06-10 16:52:49.835"	"Local delivery completed"

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-11 02:15

Every time you update the script you either have to "reboot" hMailServer or ...

hMailAdmin -> Settings -> Advanced -> Scripts [check syntax] and if OK then [Reload scripts]

hMailServer has it's own in-built script engine and when you Reload Scripts, hMail "interprets" the script and store it in binary form in memory.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-11 02:20

Your debug log says "OnMessageDeliver" and your script says "OnDeliverMessage" ... ???
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
jimimaseye
Moderator
Moderator
Posts: 7923
Joined: 2011-09-08 17:48

Re: How to debug scripts?

Post by jimimaseye » 2019-06-11 08:49

SorenR wrote:
2019-06-11 02:20
Your debug log says "OnMessageDeliver" and your script says "OnDeliverMessage" ... ???
Software discrepancy. I logged it with Martin last year and is fixing in 5.7 (I think RvdH has already included the fix in his build).
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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

palinka
Senior user
Senior user
Posts: 732
Joined: 2017-09-12 17:57

Re: How to debug scripts?

Post by palinka » 2019-06-11 12:08

fatman45 wrote:
2019-06-11 01:59

Neither of those messages shows up in the Event log!

Code: Select all

"DEBUG"	5336	"2019-06-10 16:52:49.804"	"Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Delivering message..."
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Applying rules"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Executing event OnMessageDeliver"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Event completed"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Performing local delivery"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Applying rules"
"DEBUG"	4584	"2019-06-10 16:52:49.820"	"Saving message: {12F8EB54-C6BF-4949-8DED-6AF2B855CD82}.eml"
"DEBUG"	4584	"2019-06-10 16:52:49.835"	"Local delivery completed"
That does not look like the "hmailserver_events.log" where you would find the output of "EventLog.Write( "bla bla = " & value )". It appears to be the hmailserver log.

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 18:23

SorenR wrote:
2019-06-11 02:15
Every time you update the script you either have to "reboot" hMailServer or ...

hMailAdmin -> Settings -> Advanced -> Scripts [check syntax] and if OK then [Reload scripts]

hMailServer has it's own in-built script engine and when you Reload Scripts, hMail "interprets" the script and store it in binary form in memory.
Thanks, I have done that.

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 18:24

palinka wrote:
2019-06-11 12:08
That does not look like the "hmailserver_events.log" where you would find the output of "EventLog.Write( "bla bla = " & value )". It appears to be the hmailserver log.
Aha! Where would I find said events log?

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 18:32

I found it. But this is all I get for output!

Code: Select all

4584	"2019-06-10 16:38:04.327"	"Begin - "
?4584	"2019-06-10 16:38:04.327"	"End - "
?4584	"2019-06-10 16:40:29.735"	"Begin - "
?4584	"2019-06-10 16:40:29.735"	"End - "
?4584	"2019-06-10 16:52:49.820"	"Begin - "
?4584	"2019-06-10 16:52:49.820"	"End - "
For reference, What I am trying to output:

Code: Select all

	Sub OnDeliverMessage(oMessage)
EventLog.Write("Begin - " & oMessage.To)
'*** other code here ***
EventLog.Write("End - " & oMessage.From)
	End Sub
oMessage appears to be NULL? But how can that be, especially since the message gets delivered?

palinka
Senior user
Senior user
Posts: 732
Joined: 2017-09-12 17:57

Re: How to debug scripts?

Post by palinka » 2019-06-11 18:36

There is also an error log (separate from the others). Anything in it?

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 19:03

Not now. Yesterday when I was monkeying with the script I got a couple of errors when checking syntax that showed in the error log. But nothing other than that. And so far today no error log has been created. BTW my hMailServer version is 5.6.7-B2425, MSSQL-CE version 5601, running on Windows Server 2008 R2, all latest patches applied. Server address and Name on the status page are both blank - not sure why.

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-11 19:07

Could you post your "eventhandlers.vbs" script?

Optionally by PM if you like.

PS... dinner time :mrgreen:
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-11 19:36

SorenR wrote:
2019-06-11 19:07
Could you post your "eventhandlers.vbs" script?

Optionally by PM if you like.

PS... dinner time :mrgreen:
PMed you. Thanks for your help.

Enjoy your dinner! :wink:

palinka
Senior user
Senior user
Posts: 732
Joined: 2017-09-12 17:57

Re: How to debug scripts?

Post by palinka » 2019-06-12 10:54

fatman45 wrote:
2019-06-11 19:03
Server address and Name on the status page are both blank - not sure why.
Interesting. I just looked at mine.
Server address: localhost
Name: hmailserver

I don't know how those are derived.

User avatar
mattg
Moderator
Moderator
Posts: 19753
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: How to debug scripts?

Post by mattg » 2019-06-12 13:15

That's under the sub-heading of Database information

This detail comes from your hMailserver.ini, and I suspect only applies where an external database is used
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-12 18:01

Here is my whole EventHandler.vbs (obfuscated) in case anyone has any ideas. BTW I have tested the code inside OnDeliverMessage in a test web page with hardcoded values and it works flawlessly. But in this script, apparently oMessage is NULL.

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)
EventLog.Write("Begin - " & oMessage.To)
		If oMessage.To = "text@mydomain.com" Then
			Dim regEx

			Set regEx = New RegExp

			regEx.IgnoreCase = True
			regEx.Pattern = "^\d{10}@.+\..{2,}$"
			regEx.Global = True

			If regEx.Test(oMessage.From) Then
				'It's from a cell phone - assume STOP message
EventLog.Write("From cell phone - " & oMessage.From)
				Dim oConn, oRS
				Dim strSQL
				Dim strFrom

				regEx.Pattern = "\D"
				strFrom = regEx.Replace(oMessage.From, "")
				
				Set oConn = CreateObject("ADODB.Connection")
				Set oRS = CreateObject("ADODB.Recordset")
				
				oConn.Open "Provider=SQLNCLI10;server=192.168.191.253,1433;Network=DBMSSOCN;" & _
					"uid=xxxxx;pwd=yyyyy;database=Main"
EventLog.Write("ConnectionState = " & oConn.State)
				strSQL = "SELECT * FROM NoSpam WHERE eMail='" & strFrom & "'"
				oRS.Open strSQL, oConn, 2, 3
EventLog.Write("RecordsetState = " & oRS.State)		
EventLog.Write("EOF = " & oRS.EOF)
				If oRS.EOF Then
					oRS.AddNew
					
					oRS("Email") = strFrom
				End If
				
				oRS("NoSpam") = True
				
				oRS.Update
				
				oRS.Close
EventLog.Write("RecordsetState = " & oRS.State)
				oConn.Close
EventLog.Write("ConnectionState = " & oConn.State)
				
				Set oRS = Nothing
				Set oConn = Nothing
				
				'Deliver message so we have an audit trail
				Result.Value = 0
			Else
				'Assume SPAM - don't deliver
				Result.Value = 1
			End If

			Set regEx = Nothing
		End If
EventLog.Write("End - " & oMessage.From)
	End Sub

'   Sub OnBackupFailed(sReason)
'   End Sub

'   Sub OnBackupCompleted()
'   End Sub

'   Sub OnError(iSeverity, iCode, sSource, sDescription)
'   End Sub

    Sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
    	EventLog.Write("Failed - " & oMessage.From & " - " & sRecipient & " - " & sErrorMessage)
    End Sub

'   Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
'   End Sub


fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts? [Solved]

Post by fatman45 » 2019-06-12 19:18

With the help of Søren (thank you!) I was able to get this working again. Basically the problem was the oMessage.To and oMessage.From were not necessarily picking up the correct headers from the email. Søren also suggested I use OnAcceptMessage instead of OnDeliverMessage. Here is the corrected script if anyone else is interested, with a couple of regex tweaks too.

Code: Select all

Option Explicit

'******************************************************************************************************************************
'********** Configuration                                                                                            **********
'******************************************************************************************************************************

Dim b_Debug : b_Debug = True

'******************************************************************************************************************************
'********** Functions and Subroutines                                                                                **********
'******************************************************************************************************************************

Sub XEnvelope(oMessage)
	'
	'	Envelope-To is the RECEIVED: RCPT TO:<recipient@my-domain.tld> and
	'	Envelope-From is the RECEIVED: MAIL From:<sender@your-domain.tld> that can be found in the SMTP logfile when SMTP logging
	'	is enabled.
	'
	'	Since hMailServer operate with aliases there is also Envelope OriginalTo, this is to cater for translation of the
	'	recipient in the event of an Alias OR a Catch-All account. In such event the Envelope-To will be the Alias and the
	'	Envelope-OriginalTo will be the original recipient before translation.
	'
	Dim i, strTo, strOriginalTo
	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
	oMessage.HeaderValue("X-Envelope-To") = strTo
	oMessage.HeaderValue("X-Envelope-OriginalTo") = strOriginalTo
	oMessage.HeaderValue("X-Envelope-From") = oMessage.FromAddress
	oMessage.Save
End Sub

'******************************************************************************************************************************
'********** hMailServer Triggers                                                                                     **********
'******************************************************************************************************************************

'	Sub OnClientConnect(oClient)
'	End Sub

'	Sub OnSMTPData(oClient, oMessage)
'	End Sub

Sub OnAcceptMessage(oClient, oMessage)
	'
	'	Add Envelope To/From headers to incoming email.
	'
	Call XEnvelope(oMessage)
	'
	'	Process message from cell phones
	'

	'	IF DEBUG
	If b_Debug Then EventLog.Write( "Sub OnAcceptMessage(oClient, oMessage) ..." )
	If b_Debug Then EventLog.Write( vbTab & "oMessage.To           :" & vbTab & oMessage.To )
	If b_Debug Then EventLog.Write( vbTab & "X-Envelope-To         :" & vbTab & oMessage.HeaderValue("X-Envelope-To") )
	If b_Debug Then EventLog.Write( vbTab & "X-Envelope-OriginalTo :" & vbTab & oMessage.HeaderValue("X-Envelope-OriginalTo") )

	'
	'	Care should be taken to rely only on the "To" and "From" headers as they can be faked, the Envelope-To and From cannot!
	'
	Dim regEx

	Set regEx = New RegExp

	regEx.IgnoreCase = True
	regEx.Global = True

	regEx.Pattern = "text@mydomain\.com"

	If regEx.Test(oMessage.HeaderValue("X-Envelope-OriginalTo")) Then
		regEx.Pattern = "\d{10}@.+\..{2,}"
		'
		'	At this point oMessage.FromAddress and Envelope-From contain identical values.
		'
		If regEx.Test(oMessage.FromAddress) Then
			'
			'	It's from a cell phone - assume STOP message
			'

			'	IF DEBUG
			If b_Debug Then EventLog.Write( vbTab & "From cell phone       :" & vbTab & oMessage.From)
			If b_Debug Then EventLog.Write( vbTab & "X-Envelope-From       :" & vbTab & oMessage.HeaderValue("X-Envelope-From") )

			Dim oConn, oRS
			Dim strSQL
			Dim strFrom

			regEx.Pattern = "\D"
			strFrom = regEx.Replace(oMessage.FromAddress, "")

			Set oConn = CreateObject("ADODB.Connection")
			Set oRS = CreateObject("ADODB.Recordset")

			oConn.Open "Provider=SQLNCLI10;server=192.168.191.253,58504;Network=DBMSSOCN;" & _
				"uid=xxxxxx;pwd=yyyyyyy;database=Main"

			'	IF DEBUG
			If b_Debug Then EventLog.Write( vbTab & "ConnectionState       :" & vbTab & oConn.State )

			strSQL = "SELECT * FROM NoSpam WHERE eMail='" & strFrom & "'"
			oRS.Open strSQL, oConn, 2, 3

			'	IF DEBUG
			If b_Debug Then EventLog.Write( vbTab & "RecordsetState        :" & vbTab & oRS.State )
			If b_Debug Then EventLog.Write( vbTab & "EOF                   :" & vbTab & oRS.EOF )

			If oRS.EOF Then
				oRS.AddNew
				oRS("Email") = strFrom
			End If

			oRS("NoSpam") = True

			oRS.Update
			oRS.Close

			'	IF DEBUG
			If b_Debug Then EventLog.Write( vbTab & "RecordsetState        :" & vbTab & oRS.State )

			oConn.Close

			'	IF DEBUG
			If b_Debug Then EventLog.Write( vbTab & "ConnectionState       :" & vbTab & oConn.State )

			Set oRS = Nothing
			Set oConn = Nothing
			'
			'	Deliver message so we have an audit trail
			'
			Result.Value = 0
		Else
			'
			'	Assume SPAM - don't deliver
			'
			Result.Value = 1
		End If
	End If

	Set regEx = Nothing

	'	IF DEBUG
	If b_Debug Then EventLog.Write( vbTab & "END                   :" & vbTab & oMessage.FromAddress )
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)
	EventLog.Write( "" )
	EventLog.Write( "iSeverity: " & iSeverity )
	EventLog.Write( "iCode: " & iCode )
	EventLog.Write( "sSource: " & sSource )
	EventLog.Write( "sDescription: " & sDescription )
End Sub

Sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
	EventLog.Write("Failed - " & oMessage.From & " - " & sRecipient & " - " & sErrorMessage)
End Sub

'	Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
'	End Sub

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-13 00:48

Glad it worked for you :-)

I've been off-line all day due to a ligntening storm this morning. My DSL box got fried and aparently also the port it was connected to in my Cisco switch. Went to the ISP to get a new but they were fresh out so had to accept a later model second-hand box. Turns out problem is either fried cable in the ground or fried port in the telephone exchange. So... They will send a "tech-guy" to fix it tomorrow. Already done diagnostics of visible cable and connectors (I actually repaired the installation a few years ago - yes I used to do this stuff for a living) so it's going to be fun ... :mrgreen:

Anyways, I have 4 pairs of phone lines coming into the house so I'm pretty sure we can find an undamaged pair to use. :wink:
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

palinka
Senior user
Senior user
Posts: 732
Joined: 2017-09-12 17:57

Re: How to debug scripts?

Post by palinka » 2019-06-13 01:05

SorenR wrote:
2019-06-13 00:48
Glad it worked for you :-)

I've been off-line all day due to a ligntening storm this morning. My DSL box got fried and aparently also the port it was connected to in my Cisco switch. Went to the ISP to get a new but they were fresh out so had to accept a later model second-hand box. Turns out problem is either fried cable in the ground or fried port in the telephone exchange. So... They will send a "tech-guy" to fix it tomorrow. Already done diagnostics of visible cable and connectors (I actually repaired the installation a few years ago - yes I used to do this stuff for a living) so it's going to be fun ... :mrgreen:

Anyways, I have 4 pairs of phone lines coming into the house so I'm pretty sure we can find an undamaged pair to use. :wink:
WOW. Old skool. The telephone companies here abandoned copper 10 years ago. Even in rural farmland areas like where my parents live. After no/inadequate repairs for a few years the phone company gave my parents a cellular modem into which you can plug a regular phone. Where I live (supposedly "civilization" although we could debate whether its civilized. :roll: ), its 100% fibre for at least 5 years.

fatman45
New user
New user
Posts: 19
Joined: 2015-06-02 17:22
Location: Nevada Test Site, USA

Re: How to debug scripts?

Post by fatman45 » 2019-06-13 22:13

SorenR wrote:
2019-06-13 00:48
Glad it worked for you :-)

I've been off-line all day due to a ligntening storm this morning. My DSL box got fried and aparently also the port it was connected to in my Cisco switch. Went to the ISP to get a new but they were fresh out so had to accept a later model second-hand box. Turns out problem is either fried cable in the ground or fried port in the telephone exchange. So... They will send a "tech-guy" to fix it tomorrow. Already done diagnostics of visible cable and connectors (I actually repaired the installation a few years ago - yes I used to do this stuff for a living) so it's going to be fun ... :mrgreen:

Anyways, I have 4 pairs of phone lines coming into the house so I'm pretty sure we can find an undamaged pair to use. :wink:
I did have to tweak my regex again, due to the way different cell carriers format the phone number portion of FromAddress, like adding 1 or +1 or worse(!) in front of the 10 digit number. Here's the changes in case anyone is interested. I had to modify the pattern to look for anything before the 10 digits (VBScript Regex weirdness), then place the 10 digits in a capture group to extract them. I use that same pattern for the extract.

Code: Select all

		regEx.Pattern = ".*(\d{10})@.+\..{2,}"
		'
		'	At this point oMessage.FromAddress and Envelope-From contain identical values.
		'
		If regEx.Test(oMessage.FromAddress) Then
		'*** other code here snipped for brevity ***
			Dim strFrom

			strFrom = regEx.Replace(oMessage.FromAddress, "$1")		
Wow, sorry to hear about your internet! I've got fiber here at work, but at home it is coax. I fought with problems for months - every time a storm came through my internet would go wonky. The cable company would come out (after the storm, naturally) and not find anything wrong. So they would blame my equipment. finally I spoke to a supervisor and told him if he could explain how my cable modem sitting on my desk knew when the weather outside was bad, I would replace it. They ended up replacing the cable drop to my house and the coax back to the next pole where a signal booster was located plus the booster and everything has been fine since.

User avatar
SorenR
Senior user
Senior user
Posts: 3063
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to debug scripts?

Post by SorenR » 2019-06-14 01:17

It's getting even weirder.. Tech guy was here and he had all the right gear to trace ground wires etc. We had a long talk about old school PSTN 😀... Anyways tools say no signal and latest data says i'm on position 37 in the local switchboard Report says I should be on positions 33 and 34... We connected a signal generator to one pair and he's off to the nearest switchboard. 15 minutes later he's back apollogizing for a collegue. Aparently when I went to get the new DSL box in the shop a collegue of his was doing corrections for another customer and by mistake moved my position 33 to 37, ergo no signal for me...
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

Post Reply