Änderungen an BetreffSubject Independentsoft

This commit is contained in:
Digital Data - Marlon Schreiber
2019-09-23 15:52:03 +02:00
parent 6e8c2fb825
commit e743baf415
18 changed files with 121 additions and 17 deletions

View File

@@ -127,10 +127,14 @@ Public Class clsEmailIMAP
Dim oEnvelopes As Independentsoft.Email.Imap.Envelope() = oClient.ListMessages()
Dim oCount As Integer = 0
For i As Integer = 0 To oEnvelopes.Length - 1
If Not IsNothing(oEnvelopes(i).Subject) Then
'If envelopes(i).Subject.ToString.ToUpper.Contains("[PROCESSMANAGER]") Or envelopes(i).Subject.ToString.ToUpper.Contains("[ADDI]") Then
Logger.Info($"Working on email: UniqueID: {oEnvelopes(i).UniqueID} - Subject:{oEnvelopes(i).Subject} - Date {oEnvelopes(i).Date.ToString}")
Dim oMessage As Mime.Message = oClient.GetMessage(oEnvelopes(i).UniqueID)
If IsNothing(oEnvelopes(i).Subject) Then
Logger.Debug("Attention...Subject is nothing!!")
End If
'If envelopes(i).Subject.ToString.ToUpper.Contains("[PROCESSMANAGER]") Or envelopes(i).Subject.ToString.ToUpper.Contains("[ADDI]") Then
Logger.Info($"Working on email: UniqueID: {oEnvelopes(i).UniqueID} - Subject:{oEnvelopes(i).Subject} - Date {oEnvelopes(i).Date.ToString}")
Logger.Debug($"Working on email: UniqueID: {oEnvelopes(i).UniqueID} - Subject:{oEnvelopes(i).Subject} - Date {oEnvelopes(i).Date.ToString}")
Dim oMessage As Mime.Message = oClient.GetMessage(oEnvelopes(i).UniqueID)
If Not IsNothing(oMessage) Then
oCount += 1
MAIL_LIST.Add(oMessage)
@@ -154,13 +158,16 @@ Public Class clsEmailIMAP
Catch ex As Exception
Logger.Warn("Message could not be moved: " & ex.Message)
End Try
End If
Next
oClient.Expunge()
oClient.Disconnect()
If oCount > 0 Then
Logger.Debug($"Found [{oCount.ToString}] Messages...")
End If
' Logger.Debug($"{oCount.ToString} messages will be worked..")
' Logger.Debug("IMAP_COLLECT finished!")
Logger.Debug("IMAP COLLECT Independentsoft finished!")
Return True
Catch ex As Exception
Logger.Error(ex, "Unexpected Error in IMAP COLLECT Independentsoft:")