From d7c2c86a00f9d3d492f27de24eb280547690f193 Mon Sep 17 00:00:00 2001 From: pitzm Date: Wed, 1 Oct 2025 09:43:01 +0200 Subject: [PATCH] =?UTF-8?q?Ein=20leeres=20Subject=20f=C3=BChrt=20offensich?= =?UTF-8?q?tlich=20zu=20unverarbeiteten=20E-Mails.=20Variable=20und=20dere?= =?UTF-8?q?n=20Logging=20gepr=C3=BCft=20und=20abgesichert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/EmailProfiler.Common/clsWorkEmail.vb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/App/EmailProfiler.Common/clsWorkEmail.vb b/App/EmailProfiler.Common/clsWorkEmail.vb index 908680a..355a6a8 100644 --- a/App/EmailProfiler.Common/clsWorkEmail.vb +++ b/App/EmailProfiler.Common/clsWorkEmail.vb @@ -101,11 +101,11 @@ Public Class clsWorkEmail 'TODO: Move all of these CURRENT_MAIL vars into a business object of type mail container _CurrentMail = New MailContainer(pMailMessage, poUID) - _Logger.Debug($"Working on email from: {CURRENT_MAIL_FROM}...Subject: {pMailMessage.Subject}") - CURRENT_MAIL_BODY_ALL = "" - CURRENT_MAIL_BODY_ANSWER1 = "" - CURRENT_MAIL_BODY_Substr2 = "" - CURRENT_MAIL_SUBJECT = pMailMessage.Subject.ToUpper.EscapeForSQL() + _Logger.Info($"Working on email from: {_CurrentMail.SenderAddress} - Subject: {_CurrentMail.Subject} - MessageID: {_CurrentMail.MessageId}") + CURRENT_MAIL_BODY_ALL = String.Empty + CURRENT_MAIL_BODY_ANSWER1 = String.Empty + CURRENT_MAIL_BODY_Substr2 = String.Empty + CURRENT_MAIL_SUBJECT = String.Empty CURRENT_MAIL_UID = poUID @@ -134,19 +134,19 @@ Public Class clsWorkEmail ' 'End If - If IsNothing(CURRENT_MAIL_SUBJECT) Then - CURRENT_MAIL_SUBJECT = "" + If IsNothing(_CurrentMail.Subject) Then + CURRENT_MAIL_SUBJECT = String.Empty + _Logger.Warn("Subject was nothing!") 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 - _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 oHistoryID = _DB_MSSQL.GetScalarValue(oSql) 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 End If @@ -538,7 +538,7 @@ Public Class clsWorkEmail Try _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'" 'Filter the rows using Select() method of DataTable Dim TEMP_PROCESS_PROFILE_DT As DataTable = DT_POLL_PROCESS