fix history entry when no attachments are found

This commit is contained in:
Jonathan Jenne 2023-11-10 14:23:21 +01:00
parent d3249e91ac
commit 3ab200b5b2

View File

@ -174,21 +174,28 @@ Public Class clsWorkEmail
Return PROCESS_MANAGER_IN(CurrentMail) Return PROCESS_MANAGER_IN(CurrentMail)
Else Else
_Logger.Debug("CommonEmail-Process-Sniffer") _Logger.Debug("CommonEmail-Process-Sniffer")
If COMMON_EMAIL_IN(CurrentMail) = True Then
InsertHistoryEntry(CurrentMail) Dim oCommonEmailResult = COMMON_EMAIL_IN(CurrentMail)
If oCommonEmailResult = False Then
Return False
End If
If CURRENT_ATTMT_COUNT = 0 Then If CURRENT_ATTMT_COUNT = 0 Then
_Logger.Info("### Mail contained no Attachments!! ###") _Logger.Info("### Mail contained no Attachments!! ###")
Dim oBody = EmailStrings.EMAIL_NO_FERDS Dim oBody = EmailStrings.EMAIL_NO_FERDS
If AddToEmailQueueMSSQL(CurrentMail.MessageId, oBody, "No Attachments", _EmailAccountID) = True Then If AddToEmailQueueMSSQL(CurrentMail.MessageId, oBody, "No Attachments", _EmailAccountID) = True Then
CURRENT_ImapObject.DeleteMessageByUID(poUID) CURRENT_ImapObject.DeleteMessageByUID(poUID)
End If End If
End If InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", "No Attachments")
Return True
Else Else
Return False InsertHistoryEntry(CurrentMail)
End If End If
Return True
End If End If
Catch ex As Exception Catch ex As Exception