Ein leeres Subject führt offensichtlich zu unverarbeiteten E-Mails. Variable und deren Logging geprüft und abgesichert
This commit is contained in:
parent
db06af6a37
commit
d7c2c86a00
@ -101,11 +101,11 @@ Public Class clsWorkEmail
|
|||||||
'TODO: Move all of these CURRENT_MAIL vars into a business object of type mail container
|
'TODO: Move all of these CURRENT_MAIL vars into a business object of type mail container
|
||||||
_CurrentMail = New MailContainer(pMailMessage, poUID)
|
_CurrentMail = New MailContainer(pMailMessage, poUID)
|
||||||
|
|
||||||
_Logger.Debug($"Working on email from: {CURRENT_MAIL_FROM}...Subject: {pMailMessage.Subject}")
|
_Logger.Info($"Working on email from: {_CurrentMail.SenderAddress} - Subject: {_CurrentMail.Subject} - MessageID: {_CurrentMail.MessageId}")
|
||||||
CURRENT_MAIL_BODY_ALL = ""
|
CURRENT_MAIL_BODY_ALL = String.Empty
|
||||||
CURRENT_MAIL_BODY_ANSWER1 = ""
|
CURRENT_MAIL_BODY_ANSWER1 = String.Empty
|
||||||
CURRENT_MAIL_BODY_Substr2 = ""
|
CURRENT_MAIL_BODY_Substr2 = String.Empty
|
||||||
CURRENT_MAIL_SUBJECT = pMailMessage.Subject.ToUpper.EscapeForSQL()
|
CURRENT_MAIL_SUBJECT = String.Empty
|
||||||
|
|
||||||
CURRENT_MAIL_UID = poUID
|
CURRENT_MAIL_UID = poUID
|
||||||
|
|
||||||
@ -134,19 +134,19 @@ Public Class clsWorkEmail
|
|||||||
'
|
'
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
If IsNothing(CURRENT_MAIL_SUBJECT) Then
|
If IsNothing(_CurrentMail.Subject) Then
|
||||||
CURRENT_MAIL_SUBJECT = ""
|
CURRENT_MAIL_SUBJECT = String.Empty
|
||||||
|
_Logger.Warn("Subject was nothing!")
|
||||||
Else
|
Else
|
||||||
_Logger.Debug("Subject: [{0}]", CURRENT_MAIL_SUBJECT)
|
CURRENT_MAIL_SUBJECT = _CurrentMail.Subject.ToUpper.EscapeForSQL()
|
||||||
|
_Logger.Debug("Fixed Subject: [{0}]", CURRENT_MAIL_SUBJECT)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Logger.Info($"Working on email from : {CURRENT_MAIL_FROM}...")
|
|
||||||
|
|
||||||
Dim oSql = $"Select COALESCE(MAX(GUID),0) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{_CurrentMail.MessageId}'"
|
Dim oSql = $"Select COALESCE(MAX(GUID),0) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{_CurrentMail.MessageId}'"
|
||||||
Dim oHistoryID = _DB_MSSQL.GetScalarValue(oSql)
|
Dim oHistoryID = _DB_MSSQL.GetScalarValue(oSql)
|
||||||
|
|
||||||
If oHistoryID > 0 And IS_LOCAL_TEST = False Then
|
If oHistoryID > 0 And IS_LOCAL_TEST = False Then
|
||||||
_Logger.Info($"Message with subject [{CURRENT_MAIL_SUBJECT}] from [{CURRENT_MAIL_FROM}] has already been worked!")
|
_Logger.Info($"Message with subject [{_CurrentMail.SubjectOriginal}] from [{_CurrentMail.SenderAddress}] has already been worked!")
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ Public Class clsWorkEmail
|
|||||||
Try
|
Try
|
||||||
|
|
||||||
_Logger.Info(String.Format("PM-related message found....[{0}]", pCurrentMail.Mail.Subject))
|
_Logger.Info(String.Format("PM-related message found....[{0}]", pCurrentMail.Mail.Subject))
|
||||||
_Logger.Debug(String.Format("PM-related message found....[{0}]", pCurrentMail.Mail.Subject))
|
|
||||||
Dim oExpression = "PROCESS_NAME = 'ProcessManager'"
|
Dim oExpression = "PROCESS_NAME = 'ProcessManager'"
|
||||||
'Filter the rows using Select() method of DataTable
|
'Filter the rows using Select() method of DataTable
|
||||||
Dim TEMP_PROCESS_PROFILE_DT As DataTable = DT_POLL_PROCESS
|
Dim TEMP_PROCESS_PROFILE_DT As DataTable = DT_POLL_PROCESS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user