From 72e66df02be769fd4f294ea67fffc2fe31f0d54c Mon Sep 17 00:00:00 2001 From: pitzm Date: Fri, 21 Jun 2024 13:10:08 +0200 Subject: [PATCH 1/4] Ablehnungscode nach EMLP_HISTORY usw. schreiben --- App/EmailProfiler.Common/clsWorkEmail.vb | 72 +++++++++++++++--------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/App/EmailProfiler.Common/clsWorkEmail.vb b/App/EmailProfiler.Common/clsWorkEmail.vb index 9f7ce18..8a29d7a 100644 --- a/App/EmailProfiler.Common/clsWorkEmail.vb +++ b/App/EmailProfiler.Common/clsWorkEmail.vb @@ -167,8 +167,11 @@ Public Class clsWorkEmail Dim oResult As String = ObjectEx.NotNull(_DB_MSSQL.GetScalarValue(pValidationSQLWithPlaceholders), "") If oResult <> "" Then + Dim oRejectionCodeString = GetRejectionCodeString(CurrentMail.MessageId, ErrorCode.SenderValidationFailed) + 'insert history und exit - InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", oResult) + InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", oRejectionCodeString) + AddTrackingStatusMSSQL(CurrentMail.MessageId, oRejectionCodeString, "Email-Adress validation failed", "", "EMailProfiler") 'AddEmailToQueueMSSQL(CurrentMail.MessageId, oResult, "Email validation failed", _EmailAccountID) AddToEmailQueueMSSQL(CurrentMail.MessageId, oResult, "Email validation failed", _EmailAccountID, @@ -195,7 +198,10 @@ Public Class clsWorkEmail If CURRENT_ATTMT_COUNT = 0 Then _Logger.Info("### Mail contained no Attachments!! ###") - InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", "No Attachments") + + Dim oRejectionCodeString = GetRejectionCodeString(CurrentMail.MessageId, ErrorCode.NoAttachments) + InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", oRejectionCodeString) + AddTrackingStatusMSSQL(CurrentMail.MessageId, oRejectionCodeString, "No Attachments", "", "EMailProfiler") Dim oBody = EmailStrings.EMAIL_NO_FERDS 'If AddEmailToQueueMSSQL(CurrentMail.MessageId, oBody, "No Attachments", _EmailAccountID) = True Then @@ -219,32 +225,7 @@ Public Class clsWorkEmail Return False End Try End Function - ''' - ''' Method to decide wether we use the old or the new - ''' Rejection E-mail method. - ''' - ''' TODO we have no information about the language of the receiver at the moment - ''' - ''' E-Mail Message ID - ''' Comment - ''' Name oder Reason - Public Function AddTrackingStatusMSSQL(pMessageId As String, pSTATE_TITLE As String, pSTATE_TITLE1 As String, pCOMMENT As String, pADDEDWHO As String) As Boolean - - Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_HISTORY_STATE] - ([MESSAGE_ID] - ,[STATE_TITLE] - ,[STATE_TITLE1] - ,[COMMENT] - ,ADDED_WHO) - VALUES - ('{pMessageId}' - ,'{pSTATE_TITLE}' - ,'{pSTATE_TITLE1}' - ,'{pCOMMENT}' - ,'{pADDEDWHO}')" - Return _DB_MSSQL.ExecuteNonQuery(oInsert) - End Function ''' ''' Method to decide wether we use the old or the new ''' Rejection E-mail method. @@ -1123,6 +1104,31 @@ Public Class clsWorkEmail End Try End Function + Public Function AddTrackingStatusMSSQL(pMessageId As String, pSTATE_TITLE As String, pSTATE_TITLE1 As String, pCOMMENT As String, pADDEDWHO As String) As Boolean + Try + + Dim oInsert = + $"INSERT INTO [dbo].[TBEMLP_HISTORY_STATE] + ([MESSAGE_ID] + ,[STATE_TITLE] + ,[STATE_TITLE1] + ,[COMMENT] + ,ADDED_WHO) + VALUES + ('{pMessageId}' + ,'{pSTATE_TITLE}' + ,'{pSTATE_TITLE1}' + ,'{pCOMMENT}' + ,'{pADDEDWHO}')" + Return _DB_MSSQL.ExecuteNonQuery(oInsert) + + Catch ex As Exception + _Logger.Error(ex) + Return False + End Try + + End Function + Private Function WORK_POLL_STEPS() As Boolean Try Dim oFoundSomething As Boolean = False @@ -1320,4 +1326,16 @@ Public Class clsWorkEmail Return Nothing End Try End Function + + Private Function GetRejectionCodeString(pMessageId As String, pRejectionCode As ErrorCode) As String + + Dim intCode As Integer = DirectCast(pRejectionCode, Integer) + Dim oRejectionCodeString = $"{EmailStrings.ErrorCodePraefix}{intCode}" + + ' Wir wollen im error-Log den Code und die MessageID haben, um die es geht + Dim oInfoMessage = $"Rejection {oRejectionCodeString} triggered for '{pMessageId}'" + _Logger.Error(oInfoMessage) + + Return oRejectionCodeString + End Function End Class From 8a1a0eff99fb2d73b605c7062352cdc4cabd5762 Mon Sep 17 00:00:00 2001 From: pitzm Date: Fri, 28 Jun 2024 08:37:21 +0200 Subject: [PATCH 2/4] EmailProfile.Common: Version 3.0.3.0 --- App/EmailProfiler.Common/My Project/AssemblyInfo.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/EmailProfiler.Common/My Project/AssemblyInfo.vb b/App/EmailProfiler.Common/My Project/AssemblyInfo.vb index cafc84b..b2a15a8 100644 --- a/App/EmailProfiler.Common/My Project/AssemblyInfo.vb +++ b/App/EmailProfiler.Common/My Project/AssemblyInfo.vb @@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices - + @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + From 1d2b49667e1095ec4ee1de12a59136d80d80d7c9 Mon Sep 17 00:00:00 2001 From: pitzm Date: Wed, 3 Jul 2024 08:45:33 +0200 Subject: [PATCH 3/4] =?UTF-8?q?PNG=20als=20verbotene=20Dateiendung=20erg?= =?UTF-8?q?=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/EmailProfiler.Common/clsWorkEmail.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/EmailProfiler.Common/clsWorkEmail.vb b/App/EmailProfiler.Common/clsWorkEmail.vb index 8a29d7a..9e8d04e 100644 --- a/App/EmailProfiler.Common/clsWorkEmail.vb +++ b/App/EmailProfiler.Common/clsWorkEmail.vb @@ -818,7 +818,7 @@ Public Class clsWorkEmail oATTFilename = oAttachment.SafeFileName.ToString.ToLower Dim oValidExtensions = New List(Of String) From {"pdf", "xls", "xlsx", "doc", "docx", "ppt", "pptx"} - Dim oGraphicExtensions = New List(Of String) From {"jpg", "bmp", "jpg", "gif", "xml"} + Dim oGraphicExtensions = New List(Of String) From {"jpg", "bmp", "jpeg", "gif", "png", "xml"} Dim oValidExt = oValidExtensions.Any(Function(ext) oATTFilename.EndsWith(ext)) If oValidExt = False Then From b18a6a304551242fd9bea768245c509843371cbe Mon Sep 17 00:00:00 2001 From: pitzm Date: Wed, 3 Jul 2024 08:46:22 +0200 Subject: [PATCH 4/4] EMailProfile.Common: Version 3.0.4.0 --- App/EmailProfiler.Common/My Project/AssemblyInfo.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/EmailProfiler.Common/My Project/AssemblyInfo.vb b/App/EmailProfiler.Common/My Project/AssemblyInfo.vb index b2a15a8..e925896 100644 --- a/App/EmailProfiler.Common/My Project/AssemblyInfo.vb +++ b/App/EmailProfiler.Common/My Project/AssemblyInfo.vb @@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices - + @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +