MS_Divers

This commit is contained in:
Digital Data - Marlon Schreiber
2019-04-16 12:35:42 +02:00
parent 1947a6b128
commit 5f5eff7231
33 changed files with 10995 additions and 86 deletions

View File

@@ -71,11 +71,13 @@ Public Class clsEmailIMAP
Dim oMessage = oClient.GetMessage(oMessageId, False, Inbox)
Dim oTempPath = Path.GetTempFileName()
Dim oResult = WriteMessageToFile(oMessage, oTempPath)
Dim oCount As Integer = 0
Dim oMsg As New Message(oTempPath)
oCount &= 1
If IsTest = False Then
MAIL_LIST.Add(oMsg)
Else
Logger.Info($"IMAP-Test Message#: {oCount} - Msgsubject is: {oMsg.Subject}")
Logger.Debug($"message correctly fetched. Mail has been downloaded to {oTempPath}")
End If

View File

@@ -58,6 +58,7 @@ Public Class clsWorkEmail
Logger.Warn($"Could not read the Temp-Mail. Insufficient rights? Message: {ex.Message}")
End Try
If oTempMailAccessible = True Then
MessageError = False
If CURRENT_MAIL_SUBJECT.Contains("[PROCESSMANAGER]") Then
PROCESS_MANAGER_IN()
ElseIf msg.Subject.Contains("[ADDI]") Then
@@ -111,7 +112,6 @@ Public Class clsWorkEmail
Logger.Info(String.Format("Keyword contained a : at end...removing it..."))
CURRENT_MAIL_BODY_ANSWER1 = CURRENT_MAIL_BODY_ANSWER1.Replace(":", "")
End If
MessageError = False
If GET_WMDOC_INFO() = True Then
If DT_STEPS.Rows.Count > 0 Then
WORK_POLL_STEPS()
@@ -329,7 +329,7 @@ Public Class clsWorkEmail
oClearedBodyText = oClearedBodyText.Replace(oMatch.Value, "")
oMatch = oMatch.NextMatch()
Loop
Logger.Info($"Cleared bodytext after Regex1 is: {oClearedBodyText}")
Logger.Debug($"Cleared bodytext after Regex1 is: {oClearedBodyText}")
Dim oReg2 As Regex = New Regex(oPattern2, RegexOptions.IgnoreCase)
Dim oMatch2 As Match = oReg2.Match(oClearedBodyText)
@@ -342,7 +342,7 @@ Public Class clsWorkEmail
oMatch2 = oMatch2.NextMatch()
Loop
Logger.Info($"Cleared bodytext after Regex2 is: {oClearedBodyText}")
Logger.Debug($"Cleared bodytext after Regex2 is: {oClearedBodyText}")
CURRENT_MAIL_BODY_ALL = oClearedBodyText
Else
Logger.Info($"Mailbody still is nothing after bodyExtraction!!")
@@ -416,87 +416,9 @@ Public Class clsWorkEmail
Next
'Dim oFirstindex = CURRENT_MAIL_BODY_ALL.IndexOf(Chr(13))
'If IsNothing(oFirstindex) Then
' oFirstindex = CURRENT_MAIL_BODY_ALL.IndexOf(Chr(10))
'End If
'Logger.Debug(String.Format("firstindex....[{0}]", oFirstindex))
'If oFirstindex = -1 Then
' Logger.Warn("Could not find the first carriage-return in Mail-Body. Email can not be processed!")
' MessageError = True
' Return False
'End If
'If CURRENT_MAIL_BODY_ALL.StartsWith("<html") Then
' If TEMP_HTML_RESULTS.Count > 0 Then
Logger.Debug(String.Format("MailBody-ANSWER1:...[{0}]", CURRENT_MAIL_BODY_ANSWER1))
Logger.Debug(String.Format("MailBody-ANSWER2:...[{0}]", CURRENT_MAIL_BODY_Substr2))
' End If
'Else
' Try
' CURRENT_MAIL_BODY_ANSWER1 = CURRENT_MAIL_BODY_ALL.Substring(0, oFirstindex)
' CURRENT_MAIL_BODY_ANSWER1 = RTrim(LTrim(CURRENT_MAIL_BODY_ANSWER1))
' Catch ex As Exception
' Logger.Warn("Error in Substring 144: " & ex.Message)
' Logger.Warn("CURRENT_MAIL_BODY: " & CURRENT_MAIL_BODY_ALL)
' Logger.Warn("oFirstindex: " & oFirstindex)
' CURRENT_MAIL_BODY_ANSWER1 = ""
' End Try
'End If
Logger.Info(String.Format("MailBody-ANSWER1:...[{0}]", CURRENT_MAIL_BODY_ANSWER1))
Logger.Info(String.Format("MailBody-ANSWER2:...[{0}]", CURRENT_MAIL_BODY_Substr2))
'now trying to get the text before Masterline
'If WM_IDX_BODY_TEXT <> String.Empty And WM_IDX_BODY_SUBSTR_LENGTH <> 0 And oDTFunctionRegex.Rows.Count >= 1 Then
' If CURRENT_MAIL_BODY_ALL.StartsWith("<html") Then
' Dim oTempBodyString As String = ""
' oCount = 0
' For Each _oAnswer1 In TEMP_HTML_RESULTS
' If oCount = 0 Then
' oTempBodyString = _oAnswer1
' Else
' oTempBodyString &= vbNewLine & _oAnswer1
' End If
' oCount += 1
' Next
' CURRENT_MAIL_BODY_Substr2 = oTempBodyString
' Else
' Dim pattern As String = oDTFunctionRegex.Rows(0).Item("REGEX")
' ' Instantiate the regular expression object.
' Dim r As Regex = New Regex(pattern, RegexOptions.Multiline)
' ' Match the regular expression pattern against a text string.
' Dim m As Match = r.Match(CURRENT_MAIL_BODY_ALL)
' If m.Success Then
' If Not IsNothing(m.Value) Then
' If m.Value.Length > WM_IDX_BODY_SUBSTR_LENGTH Then
' Try
' Logger.Debug($"Getting the Substring of body - Length: {WM_IDX_BODY_SUBSTR_LENGTH}...")
' CURRENT_MAIL_BODY_Substr2 = m.Value.Substring(0, WM_IDX_BODY_SUBSTR_LENGTH)
' Catch ex As Exception
' Logger.Warn("Error in Substring 168: " & ex.Message)
' Logger.Warn("m.Value: " & m.Value)
' Logger.Warn("WM_IDX_BODY_SUBSTR_LENGTH: " & WM_IDX_BODY_SUBSTR_LENGTH.ToString)
' CURRENT_MAIL_BODY_Substr2 = ""
' End Try
' Else
' Logger.Info($"m.Value.Length [{m.Value.Length}] < WM_IDX_BODY_SUBSTR_LENGTH [{WM_IDX_BODY_SUBSTR_LENGTH}], so simply m.Value [{m.Value}] will be taken...")
' CURRENT_MAIL_BODY_Substr2 = m.Value
' End If
' End If
' End If
' Logger.Debug(String.Format("MailBody-Substring After RecognizeString:...[{0}]", CURRENT_MAIL_BODY_Substr2))
' End If
'End If
If CURRENT_MAIL_BODY_ANSWER1 = String.Empty Then
Logger.Warn("CURRENT_MAIL_BODY_ANSWER1 is String.Empty: So the answer will interpreted as empty!")
End If
@@ -628,7 +550,7 @@ Public Class clsWorkEmail
_email.DELETE_EMAIL(CURRENT_MAIL_MESSAGE.MessageID)
Else
If MessageError = True Then
Logger.Warn($"Could not delete Message {CURRENT_MAIL_MESSAGE.MessageID} as there was an MessageError!")
Logger.Warn($"Did not delete Message [{CURRENT_MAIL_MESSAGE.MessageID}] as there was an MessageError!")
End If
End If
End Function

View File

@@ -21,6 +21,7 @@ E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\NLog.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\S22.Imap.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\FirebirdSql.Data.FirebirdClient.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.vbprojAssemblyReference.cache
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.Resources.resources
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.vbproj.GenerateResource.cache
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.vbproj.CoreCompileInputs.cache