EmailProfiler.Common: Auswertung der neuen DB Spalte ALLOW_XML_RECEIPTS
This commit is contained in:
parent
5fd352dd1a
commit
acdbf643fb
@ -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))
|
||||
|
||||
@ -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,
|
||||
"",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user