Compare commits

...

2 Commits

3 changed files with 12 additions and 11 deletions

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("DigitalData.EMLProfiler")>
<Assembly: AssemblyCopyright("Copyright © 2025")>
<Assembly: AssemblyTrademark("3.0.9.0")>
<Assembly: AssemblyTrademark("3.0.10.0")>
<Assembly: ComVisible(False)>
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.0.9.0")>
<Assembly: AssemblyFileVersion("3.0.9.0")>
<Assembly: AssemblyVersion("3.0.10.0")>
<Assembly: AssemblyFileVersion("3.0.10.0")>

View File

@ -653,6 +653,7 @@ Public Class clsWorkEmail
Dim oPathOriginal As String = oRow.ItemEx("PATH_ORIGINAL", "")
Dim oExtractMainPath As String = oRow.ItemEx("PATH_EMAIL_TEMP", "")
Try
Dim oSplit As String()
Dim oStorage As String
@ -692,8 +693,8 @@ Public Class clsWorkEmail
End Try
If Copy2HDD(pCurrentMail, oRow("COPY_2_HDD"), oRow("PATH_ORIGINAL"), oRow("PATH_EMAIL_ERRORS"), True) = True Then
If ExtractAttachments(pCurrentMail, oExtractMainPath) = True Then
Dim oAllowXMLReceipts As Boolean = oRow("ALLOW_XML_RECEIPTS")
If ExtractAttachments(pCurrentMail, oExtractMainPath, oAllowXMLReceipts) = True Then
Return True
Else
_Logger.Warn("!##Returning false from EXTRACT_ATTACHMENTS!##")
@ -917,7 +918,7 @@ Public Class clsWorkEmail
End Try
End Function
Private Function ExtractAttachments(pCurrentMail As MailContainer, pExtractPath As String) As Boolean
Private Function ExtractAttachments(pCurrentMail As MailContainer, pExtractPath As String, pAllowXMLReceipts As Boolean) As Boolean
_Logger.Debug("In ExtractAttachments - pExtractPath = [{0}]", pExtractPath)
CURRENT_ATTMT_COUNT = 0
@ -955,7 +956,7 @@ Public Class clsWorkEmail
}
EmailAttachments.Add(oEmailAttachment)
If ValidateFileExtension(oEmailAttachment) = False Then
If ValidateFileExtension(oEmailAttachment, pAllowXMLReceipts) = False Then
oEmailAttachment.ErrorCodeValue = ErrorCode.NormalFileAttachmentCorrupt
Continue For
End If
@ -1045,7 +1046,7 @@ Public Class clsWorkEmail
oEmbeddedFile.FileStatus = pGDPicturePDF.GetStat()
If oEmbeddedFile.FileStatus = GdPictureStatus.OK Then
If ValidateFileExtension(oEmbeddedFile) = False Then
If ValidateFileExtension(oEmbeddedFile, False) = False Then
oEmbeddedFile.ErrorCodeValue = ErrorCode.EmbeddedFileAttachmentCorrupt
Continue For
End If
@ -1133,14 +1134,14 @@ Public Class clsWorkEmail
End Try
End Function
Private Function ValidateFileExtension(pAttachmentData As EmailAttachment) As Boolean
Private Function ValidateFileExtension(pAttachmentData As EmailAttachment, pAllowXMLReceipts As Boolean) As Boolean
_Logger.Debug("Validate extension of [{0}]", pAttachmentData.OrgFileName)
Dim lowerFilename = pAttachmentData.OrgFileName.ToLower
Dim oIsValidExtension As Boolean = False
Dim oIsGraphicExtension = _GraphicExtensions.Any(Function(ext) lowerFilename.EndsWith(ext))
If pAttachmentData.AttachmentPosition = 1 Then
If pAllowXMLReceipts = True AndAlso pAttachmentData.AttachmentPosition = 1 Then
oIsValidExtension = _ValidFirstExtensions.Any(Function(ext) lowerFilename.EndsWith(ext))
Else
oIsValidExtension = _ValidExtensions.Any(Function(ext) lowerFilename.EndsWith(ext))

View File

@ -15,7 +15,7 @@ Public Class ExtractAttachmentsFromEMLFile
Public Sub CallWorkerProcess(pEMLFilename As String, pConfigData As ConfigData)
Dim oProfileIdForPolling = 0
Dim oProfileIdForPolling = 1
Dim oWorker As New clsWorker(_LogConfig,
pConfigData.ConnectionString,
"",