diff --git a/App/.vs/SERV_EMAIL/v15/.suo b/App/.vs/SERV_EMAIL/v15/.suo index 0c180c0..c6f3da1 100644 Binary files a/App/.vs/SERV_EMAIL/v15/.suo and b/App/.vs/SERV_EMAIL/v15/.suo differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.dll b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.dll index 15977da..565073c 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.dll and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.dll differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.pdb b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.pdb index caabe1c..e3830f6 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.pdb and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.EMLProfiler.pdb differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.dll b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.dll index 147d72b..8d562b9 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.dll and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.dll differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.pdb b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.pdb index 34314de..4414fc4 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.pdb and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Database.pdb differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.dll b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.dll index 0e444a5..4592e24 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.dll and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.dll differ diff --git a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.pdb b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.pdb index 4cea7a0..c3a5b3b 100644 Binary files a/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.pdb and b/App/DigitalData.EMLProfiler/bin/Debug/DigitalData.Modules.Logging.pdb differ diff --git a/App/DigitalData.EMLProfiler/clsEmail.IMAP.vb b/App/DigitalData.EMLProfiler/clsEmail.IMAP.vb index e542355..5325db3 100644 --- a/App/DigitalData.EMLProfiler/clsEmail.IMAP.vb +++ b/App/DigitalData.EMLProfiler/clsEmail.IMAP.vb @@ -146,11 +146,12 @@ Public Class clsEmailIMAP For oCounterEnvelope As Integer = 0 To oEnvelopes.Length - 1 For oCounterUnseen As Integer = 0 To oUniqueID.Length - 1 If oEnvelopes(oCounterEnvelope).UniqueID = oUniqueID(oCounterUnseen) Then + Dim oMSG = $"Working on unseen email: UniqueID [{oEnvelopes(oCounterEnvelope).UniqueID}] - Subject[{oEnvelopes(oCounterEnvelope).Subject}] - Date [{oEnvelopes(oCounterEnvelope).Date.ToString}]" If IsTest = True Then - MsgBox($"Working on unseen email: UniqueID: {oEnvelopes(oCounterEnvelope).UniqueID} - Subject:{oEnvelopes(oCounterEnvelope).Subject} - Date {oEnvelopes(oCounterEnvelope).Date.ToString}") + MsgBox(oMSG) End If - Logger.Info($"Working on unseen email: UniqueID: {oEnvelopes(oCounterEnvelope).UniqueID} - Subject:{oEnvelopes(oCounterEnvelope).Subject} - Date {oEnvelopes(oCounterEnvelope).Date.ToString}") - Logger.Debug($"Working on unseen email: UniqueID: {oEnvelopes(oCounterEnvelope).UniqueID} - Subject:{oEnvelopes(oCounterEnvelope).Subject} - Date {oEnvelopes(oCounterEnvelope).Date.ToString}") + Logger.Info(oMSG) + Logger.Debug(oMSG) Dim oMessage As Mime.Message = oClient.GetMessage(oEnvelopes(oCounterEnvelope).UniqueID) If Not IsNothing(oMessage) Then oCount += 1 @@ -160,66 +161,6 @@ Public Class clsEmailIMAP End If Next Next - 'For i As Integer = 0 To oUniqueID.Length - 1 - ' oFoundMessages(i) = oClient.GetMessage(oUniqueID(i)) - ' 'If oFoundMessages(i).Subject.ToLower.Contains("seen") Then - - ' For i1 As Integer = 0 To oEnvelopes.Length - 1 - ' If oEnvelopes(i1).UniqueID = oUniqueID(i) Then - ' Logger.Info($"Working on unseen email: UniqueID: {oEnvelopes(i).UniqueID} - Subject:{oEnvelopes(i).Subject} - Date {oEnvelopes(i).Date.ToString}") - ' Logger.Debug($"Working on unseen 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) - ' oClient.Store(oEnvelopes(i1).UniqueID, "+FLAGS", "SEEN") - ' End If - ' End If - ' Next - ' 'End If - - 'Next - - - 'Dim oEnvelopes As Independentsoft.Email.Imap.Envelope() = oClient.ListMessages() - 'Dim oCount As Integer = 0 - 'For i As Integer = 0 To oEnvelopes.Length - 1 - ' 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) - ' End If - ' Try - ' If DeleteinTest = True Then - ' Logger.Debug($"Message shall be deleted...") - ' oClient.Delete(oEnvelopes(i).UniqueID) - ' Logger.Debug($"Message has been marked as deleted!") - ' Else - ' Logger.Debug("Message will be set to SEEN") - ' oClient.Store(oEnvelopes(i).UniqueID, "-FLAGS", "SEEN") - ' End If - ' Catch ex As Exception - ' Logger.Warn("Message could not be deleted: " & ex.Message) - ' End Try - ' Try - ' If MoveMailTo <> "" Then - ' Logger.Debug($"Moving to [{MoveMailTo}] is active...") - ' oClient.AddMessage(MoveMailTo, oMessage) - ' Logger.Debug($"Successfully moved!") - ' End If - - ' Catch ex As Exception - ' Logger.Warn("Message could not be moved: " & ex.Message) - ' End Try - 'Next oClient.Expunge() oClient.Disconnect() If oCount > 0 Then @@ -323,54 +264,6 @@ Public Class clsEmailIMAP End Try End Function - 'Public Function TEST_IMAP_COLLECT(INBOXNAME As String, MYMAIL_SERVER As String, MYMAIL_PORT As Integer, MYMAIL_USER As String, MYMAIL_USER_PW As String) - ' Try - ' Logger.Info(String.Format("Working on TEST_IMAP_COLLECT.....")) - ' Dim oLogPath = System.IO.Path.Combine(My.Application.Info.DirectoryPath, "Log\logindependentSoft.txt") - ' Logger.Debug($"IsoftLog: {oLogPath}...") - ' Dim oindependentLogger As New Independentsoft.Email.Logger(oLogPath) - - ' Dim oImapClient As New Independentsoft.Email.Imap.ImapClient(MYMAIL_SERVER, MYMAIL_PORT) - ' oImapClient.Logger = oindependentLogger - ' oImapClient.ValidateRemoteCertificate = False - ' oImapClient.Connect() - ' Logger.Debug($"oImapClient connected...") - ' Try - ' oImapClient.Login(MAIL_USER, MAIL_USER_PW, AuthenticationType.Login) - ' Catch ex As Exception - ' MsgBox($"Unexpected error in (oImapClient.Login): {ex.Message}") - ' Logger.Info($"Unexpected error in oImapClient.Login - User: [{MYMAIL_USER}] PW: [{MYMAIL_USER_PW}]") - ' Logger.Warn(ex.StackTrace.ToString) - ' Logger.Warn(ex.Message) - ' oImapClient.Logger.Close() - ' Logger.Error(ex) - ' Return False - ' End Try - - ' oImapClient.SelectFolder(INBOXNAME) - ' Dim oEnvelopes As Independentsoft.Email.Imap.Envelope() = oImapClient.ListMessages() - - ' 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 - ' MsgBox($"Working on email: UniqueID: {oEnvelopes(i).UniqueID} - Subject:{oEnvelopes(i).Subject} - Date {oEnvelopes(i).Date.ToString}") - ' Dim message As Mime.Message = oImapClient.GetMessage(oEnvelopes(i).UniqueID) - ' End If - ' Next - - ' oImapClient.Disconnect() - ' oImapClient.Logger.Close() - ' Logger.Info("TEST_IMAP_COLLECT finished!") - ' Return True - - ' Catch ex As Exception - ' Logger.Info($"Unexpected error in TEST_IMAP_COLLECT - User: [{MYMAIL_USER}] PW: [{MYMAIL_USER_PW}]") - ' MsgBox($"Unexpected error in TEST_IMAP_COLLECT: {ex.Message}") - ' Logger.Error(ex, "Unexpected Error in TEST_IMAP_COLLECT:") - - ' Return False - ' End Try - 'End Function End Class diff --git a/App/DigitalData.EMLProfiler/clsWorkEmail.vb b/App/DigitalData.EMLProfiler/clsWorkEmail.vb index 6c73a5d..b966279 100644 --- a/App/DigitalData.EMLProfiler/clsWorkEmail.vb +++ b/App/DigitalData.EMLProfiler/clsWorkEmail.vb @@ -461,6 +461,11 @@ Public Class clsWorkEmail End If oMSGID = oMSGID.Replace(">", "").Replace("<", "") For Each oAttachment As Attachment In oCurrentMail.GetAttachments + Dim oATTFilename = oAttachment.GetFileName.ToString.ToLower + If Not oATTFilename.EndsWith("pdf") Then + Continue For + End If + Dim oAttachmentFileString Logger.Debug(String.Format(" Working on Attachment [{0}]", oAttachment.GetFileName)) Try @@ -471,6 +476,7 @@ Public Class clsWorkEmail End If oAttachmentFileString = Path.Combine(PATH_TEMP, $"{oMSGID}~{oFilename}") + If System.IO.File.Exists(oAttachmentFileString) = False Then Logger.Debug(String.Format("Trying to save attachment [{0}]", oAttachmentFileString)) oAttachment.Save(oAttachmentFileString) diff --git a/App/DigitalData.EMLProfiler/clsWorker.vb b/App/DigitalData.EMLProfiler/clsWorker.vb index 193193f..f5ca0ff 100644 --- a/App/DigitalData.EMLProfiler/clsWorker.vb +++ b/App/DigitalData.EMLProfiler/clsWorker.vb @@ -134,10 +134,13 @@ Public Class clsWorker End If If pollresult = False Then - Logger.Warn(String.Format("Error while polling emails....")) - + Logger.Warn(String.Format("Error while polling emails...Trying S22....")) + pollresult = _emailIMAP.FetchIMAPMessages(MAIL_SERVER, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_INBOX_NAME) + If pollresult = False Then + Logger.Warn(String.Format("S22 also returned error!")) + End If End If - If MAIL_LIST.Count() > 0 Then + If MAIL_LIST.Count() > 0 Then Logger.Info(String.Format("Worked/Pulled: {0} E-Mails", MAIL_LIST.Count())) For Each pulled_msg As Message In MAIL_LIST If _workmail.WORK_MAIL(pulled_msg) = True Then diff --git a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.dll b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.dll index 15977da..565073c 100644 Binary files a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.dll and b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.dll differ diff --git a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.pdb b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.pdb index caabe1c..e3830f6 100644 Binary files a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.pdb and b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.pdb differ diff --git a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbproj.FileListAbsolute.txt b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbproj.FileListAbsolute.txt index cb75be7..566737d 100644 --- a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbproj.FileListAbsolute.txt +++ b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbproj.FileListAbsolute.txt @@ -28,3 +28,4 @@ E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.dll E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.xml E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.pdb +E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.vbprojAssemblyReference.cache diff --git a/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbprojAssemblyReference.cache b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbprojAssemblyReference.cache new file mode 100644 index 0000000..cd9791c Binary files /dev/null and b/App/DigitalData.EMLProfiler/obj/Debug/DigitalData.EMLProfiler.vbprojAssemblyReference.cache differ