Compare commits
15 Commits
d7fca23ebc
...
ab2a0134f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2a0134f7 | ||
|
|
3fa9e8b75e | ||
|
|
cff6c289bb | ||
|
|
7a60728a27 | ||
|
|
f23a5a3ec1 | ||
|
|
133d461395 | ||
|
|
77ece6ca83 | ||
|
|
8c5927530d | ||
|
|
0c850a11fc | ||
|
|
b4c9b4f0b8 | ||
|
|
7f3a73afd3 | ||
|
|
90eb5d18ec | ||
|
|
a732db2171 | ||
|
|
0704b07de7 | ||
|
|
3da7e37c91 |
@@ -1,112 +1,105 @@
|
|||||||
Imports Independentsoft
|
Imports Limilabs.Mail
|
||||||
|
Imports Limilabs.Mail.MSG
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
|
|
||||||
Public Class ClassEmailHeaderExtractor
|
Public Class ClassEmailHeaderExtractor
|
||||||
''' <summary>
|
'''' <summary>
|
||||||
''' Extrahiert die Headerinformationen aus einer .msg Datei mithilfe der MSG.NET Klasse
|
'''' Extrahiert die Headerinformationen aus einem msg Objekt mithilfe der MSG.NET Klasse
|
||||||
''' </summary>
|
'''' </summary>
|
||||||
''' <param name="path">Der Pfad einer .msg Datei</param>
|
'''' <param name="msg">Eine Email vom Typ Msg.Message</param>
|
||||||
''' <returns>Headerinformationen als String oder Nothing wenn ein Fehler aufgetreten ist.</returns>
|
'''' <returns>Headerinformationen als String oder Nothing wenn ein Fehler aufgetreten ist.</returns>
|
||||||
Public Shared Function getMessageHeaders(path As String)
|
'Public Shared Function getMessageHeaders(msg As Msg.Message)
|
||||||
Try
|
' Try
|
||||||
Dim msg As New Msg.Message(path)
|
' Dim headers = msg.TransportMessageHeaders.Replace(vbCrLf, " ")
|
||||||
Dim headers = msg.TransportMessageHeaders.Replace(vbCrLf, " ")
|
' Return headers
|
||||||
Return headers
|
' Catch ex As Exception
|
||||||
Catch ex As Exception
|
' Return Nothing
|
||||||
Return Nothing
|
' End Try
|
||||||
End Try
|
'End Function
|
||||||
End Function
|
|
||||||
|
|
||||||
''' <summary>
|
'''' <summary>
|
||||||
''' Extrahiert die Headerinformationen aus einem msg Objekt mithilfe der MSG.NET Klasse
|
'''' Extrahiert aus den Headerinformationen anhand einer Liste von Regular Expressions eine Absenderadresse.
|
||||||
''' </summary>
|
'''' </summary>
|
||||||
''' <param name="msg">Eine Email vom Typ Msg.Message</param>
|
'''' <param name="messageHeaders">Headerinformationen die von getMessageHeaders erzeugt wurden.</param>
|
||||||
''' <returns>Headerinformationen als String oder Nothing wenn ein Fehler aufgetreten ist.</returns>
|
'''' <param name="RegexList">Eine Liste von Regular Expressions</param>
|
||||||
Public Shared Function getMessageHeaders(msg As Msg.Message)
|
'''' <param name="RegexGroup">Die Ergebnisgruppe, die die Adresse enthält</param>
|
||||||
Try
|
'''' <returns>Eine Emailadresse oder Nothing, wenn keine der Regular Expressions ein Ergebnis lieferte.</returns>
|
||||||
Dim headers = msg.TransportMessageHeaders.Replace(vbCrLf, " ")
|
'Public Shared Function extractFromAddress(messageHeaders As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
|
||||||
Return headers
|
' If IsNothing(messageHeaders) Then
|
||||||
Catch ex As Exception
|
' Return Nothing
|
||||||
Return Nothing
|
' End If
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
''' <summary>
|
' For Each rx In RegexList
|
||||||
''' Extrahiert aus den Headerinformationen anhand einer Liste von Regular Expressions eine Absenderadresse.
|
' Dim match As Match = rx.Match(messageHeaders)
|
||||||
''' </summary>
|
' Dim email As String = match.Groups(RegexGroup).Value
|
||||||
''' <param name="messageHeaders">Headerinformationen die von getMessageHeaders erzeugt wurden.</param>
|
|
||||||
''' <param name="RegexList">Eine Liste von Regular Expressions</param>
|
|
||||||
''' <param name="RegexGroup">Die Ergebnisgruppe, die die Adresse enthält</param>
|
|
||||||
''' <returns>Eine Emailadresse oder Nothing, wenn keine der Regular Expressions ein Ergebnis lieferte.</returns>
|
|
||||||
Public Shared Function extractFromAddress(messageHeaders As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
|
|
||||||
If IsNothing(messageHeaders) Then
|
|
||||||
Return Nothing
|
|
||||||
End If
|
|
||||||
|
|
||||||
For Each rx In RegexList
|
' If Not String.IsNullOrWhiteSpace(email) Then
|
||||||
Dim match As Match = rx.Match(messageHeaders)
|
' Return email
|
||||||
Dim email As String = match.Groups(RegexGroup).Value
|
' End If
|
||||||
|
' Next
|
||||||
|
|
||||||
If Not String.IsNullOrWhiteSpace(email) Then
|
' Return Nothing
|
||||||
Return email
|
'End Function
|
||||||
End If
|
'Public Shared Function extractFromHeader(messageHeaders As String, Regex As String)
|
||||||
Next
|
' Try
|
||||||
|
' Dim result = Nothing
|
||||||
|
' Dim i As Integer = 0
|
||||||
|
' If IsNothing(messageHeaders) Then
|
||||||
|
' Return Nothing
|
||||||
|
' End If
|
||||||
|
' ' einen Regulären Ausdruck laden
|
||||||
|
' Dim strRegex As String = Regex
|
||||||
|
' Dim myRegex As New Regex(strRegex, RegexOptions.IgnorePatternWhitespace Or RegexOptions.IgnoreCase)
|
||||||
|
' Dim strTargetString As String = messageHeaders.Trim
|
||||||
|
' ' die Vorkommen im String auslesen
|
||||||
|
' For Each myMatch As Match In myRegex.Matches(strTargetString)
|
||||||
|
' If myMatch.Success Then
|
||||||
|
' LOGGER.Debug("Match success. Matched Value: [{0}]", myMatch.Value)
|
||||||
|
|
||||||
Return Nothing
|
' If myMatch.Value <> "" Then
|
||||||
End Function
|
' If i = 0 Then
|
||||||
Public Shared Function extractFromHeader(messageHeaders As String, Regex As String)
|
' result = myMatch.Value.ToString
|
||||||
Try
|
' Else
|
||||||
Dim result
|
' result = result & ";" & myMatch.Value.ToString
|
||||||
Dim i As Integer = 0
|
' End If
|
||||||
If IsNothing(messageHeaders) Then
|
' i += 1
|
||||||
Return Nothing
|
' End If
|
||||||
End If
|
' Else
|
||||||
' einen Regulären Ausdruck laden
|
' LOGGER.Debug("Match failed!")
|
||||||
Dim strRegex As String = Regex
|
' End If
|
||||||
Dim myRegex As New Regex(strRegex, RegexOptions.IgnorePatternWhitespace Or RegexOptions.IgnoreCase)
|
' Next
|
||||||
Dim strTargetString As String = messageHeaders.Trim
|
|
||||||
' die Vorkommen im String auslesen
|
|
||||||
For Each myMatch As Match In myRegex.Matches(strTargetString)
|
|
||||||
If myMatch.Success Then
|
|
||||||
If myMatch.Value <> "" Then
|
|
||||||
If i = 0 Then
|
|
||||||
result = myMatch.Value.ToString
|
|
||||||
Else
|
|
||||||
result = result & ";" & myMatch.Value.ToString
|
|
||||||
End If
|
|
||||||
i += 1
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
Return result
|
|
||||||
Catch ex As Exception
|
|
||||||
MsgBox("Unexpected Error in extractFromHeader: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
End Function
|
' LOGGER.Debug("Extracted value: [{0}]", result)
|
||||||
|
|
||||||
''' <summary>
|
' Return result
|
||||||
''' Extrahiert aus den Headerinformationen anhand einer Liste von Regular Expressions eine Empfängeradresse.
|
' Catch ex As Exception
|
||||||
''' </summary>
|
' LOGGER.Error(ex)
|
||||||
''' <param name="messageHeaders">Headerinformationen die von getMessageHeaders erzeugt wurden.</param>
|
' MsgBox("Unexpected Error in extractFromHeader: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
''' <param name="RegexList">Eine Liste von Regular Expressions</param>
|
' Return Nothing
|
||||||
''' <param name="RegexGroup">Die Ergebnisgruppe, die die Adresse enthält</param>
|
' End Try
|
||||||
''' <returns>Eine Emailadresse oder Nothing, wenn keine der Regular Expressions ein Ergebnis lieferte.</returns>
|
'End Function
|
||||||
Public Shared Function extractToAddress(messageHeaders As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
|
|
||||||
If IsNothing(messageHeaders) Then
|
|
||||||
Return Nothing
|
|
||||||
End If
|
|
||||||
|
|
||||||
For Each rx In RegexList
|
'''' <summary>
|
||||||
Dim match As Match = rx.Match(messageHeaders)
|
'''' Extrahiert aus den Headerinformationen anhand einer Liste von Regular Expressions eine Empfängeradresse.
|
||||||
Dim email As String = match.Groups(RegexGroup).Value
|
'''' </summary>
|
||||||
|
'''' <param name="messageHeaders">Headerinformationen die von getMessageHeaders erzeugt wurden.</param>
|
||||||
|
'''' <param name="RegexList">Eine Liste von Regular Expressions</param>
|
||||||
|
'''' <param name="RegexGroup">Die Ergebnisgruppe, die die Adresse enthält</param>
|
||||||
|
'''' <returns>Eine Emailadresse oder Nothing, wenn keine der Regular Expressions ein Ergebnis lieferte.</returns>
|
||||||
|
'Public Shared Function extractToAddress(messageHeaders As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
|
||||||
|
' If IsNothing(messageHeaders) Then
|
||||||
|
' Return Nothing
|
||||||
|
' End If
|
||||||
|
|
||||||
If Not String.IsNullOrWhiteSpace(email) Then
|
' For Each rx In RegexList
|
||||||
Return email
|
' Dim match As Match = rx.Match(messageHeaders)
|
||||||
End If
|
' Dim email As String = match.Groups(RegexGroup).Value
|
||||||
Next
|
|
||||||
|
|
||||||
Return Nothing
|
' If Not String.IsNullOrWhiteSpace(email) Then
|
||||||
End Function
|
' Return email
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' Return Nothing
|
||||||
|
'End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports System.Guid
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
Imports DevExpress.XtraEditors
|
Imports DevExpress.XtraEditors
|
||||||
Imports Independentsoft
|
|
||||||
Imports DigitalData.Modules.Language
|
Imports DigitalData.Modules.Language
|
||||||
|
Imports Limilabs.Mail
|
||||||
|
|
||||||
Public Class ClassFilehandle
|
Public Class ClassFilehandle
|
||||||
Public Shared Function Decide_FileHandle(pFilename As String, pHandletype As String)
|
Public Shared Function Decide_FileHandle(pFilename As String, pHandletype As String)
|
||||||
Try
|
Try
|
||||||
If pFilename.EndsWith(".msg") Then
|
If pFilename.ToUpper.EndsWith(".MSG") Or pFilename.ToUpper.EndsWith(".EML") Then
|
||||||
CURRENT_MESSAGEID = ""
|
CURRENT_MESSAGEID = ""
|
||||||
Dim oMsg As New Msg.Message(pFilename)
|
Dim oMail As IMail = EMAIL.Load_Email(pFilename)
|
||||||
If oMsg.Attachments.Count > 0 Then
|
If oMail.Attachments.Count > 0 Then
|
||||||
|
|
||||||
Dim oTitle As String
|
Dim oTitle As String
|
||||||
Dim oMessage As String
|
Dim oMessage As String
|
||||||
|
|
||||||
@@ -29,11 +29,8 @@ Public Class ClassFilehandle
|
|||||||
oResult = MessageBox.Show(oMessage, oTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
|
oResult = MessageBox.Show(oMessage, oTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
|
||||||
|
|
||||||
If oResult = MsgBoxResult.Yes Then
|
If oResult = MsgBoxResult.Yes Then
|
||||||
If pHandletype.StartsWith("|FW") Then
|
Dim oIsFolderWatch = pHandletype.StartsWith("|FW")
|
||||||
Return Email_Decay(pFilename, True)
|
Return Save_EmailAndAttachmentsToDisk(pFilename, oIsFolderWatch)
|
||||||
Else
|
|
||||||
Return Email_Decay(pFilename)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -53,91 +50,144 @@ Public Class ClassFilehandle
|
|||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Private Shared Function Email_Decay(msgname As String, Optional FW As Boolean = False)
|
|
||||||
|
Private Shared Function Save_EmailAndAttachmentsToDisk(pEmailFilePath As String, Optional pFolderWatch As Boolean = False) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim msgonly As String = "|MSGONLY|"
|
Dim oMessageOnlyMarker As String = "|MSGONLY|"
|
||||||
Dim ATT_EXTR As String = "|ATTMNTEXTRACTED|"
|
Dim oExtractedAttachmentMarker As String = "|ATTMNTEXTRACTED|"
|
||||||
If FW = True Then
|
If pFolderWatch = True Then
|
||||||
msgonly = "|FW_MSGONLY|"
|
oMessageOnlyMarker = "|FW_MSGONLY|"
|
||||||
ATT_EXTR = "|FW_ATTMNTEXTRACTED|"
|
oExtractedAttachmentMarker = "|FW_ATTMNTEXTRACTED|"
|
||||||
End If
|
End If
|
||||||
Dim erfolgreich As Boolean = False
|
Dim oSuccess As Boolean = False
|
||||||
Dim msg As New Msg.Message(msgname)
|
|
||||||
|
|
||||||
If Not msg.InternetMessageId Is Nothing Then
|
LOGGER.Info("Converting file to Eml if needed: [{0}]", pEmailFilePath)
|
||||||
CURRENT_MESSAGEID = msg.InternetMessageId
|
Dim oEmail As IMail = EMAIL.Load_Email(pEmailFilePath)
|
||||||
|
|
||||||
|
If oEmail.MessageID IsNot Nothing Then
|
||||||
|
CURRENT_MESSAGEID = oEmail.MessageID
|
||||||
Else
|
Else
|
||||||
LOGGER.Info(">> Email_Decay: Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!")
|
LOGGER.Info("Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!")
|
||||||
Dim sGUID As String
|
CURRENT_MESSAGEID = NewGuid.ToString()
|
||||||
sGUID = System.Guid.NewGuid.ToString()
|
|
||||||
CURRENT_MESSAGEID = sGUID
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Nur die MSGDatei ablegen
|
Dim oEmailFilePathWithoutAttachments = EMAIL.Remove_AttachmentsFromEmail(pEmailFilePath, "_excl_attachments")
|
||||||
Dim tempfile As String = Path.Combine(Path.GetTempPath, Path.GetFileNameWithoutExtension(msgname) & "_excl_att.msg")
|
TEMP_FILES.Add(oEmailFilePathWithoutAttachments)
|
||||||
|
|
||||||
If File.Exists(tempfile) Then
|
If Insert_GI_File(oEmailFilePathWithoutAttachments, oMessageOnlyMarker) = True Then
|
||||||
File.Delete(tempfile)
|
oSuccess = True
|
||||||
End If
|
|
||||||
Dim _msgEXAtt As New Msg.Message(msgname)
|
|
||||||
_msgEXAtt.Attachments.Clear()
|
|
||||||
_msgEXAtt.Save(tempfile)
|
|
||||||
'Datei in Array zum Templöschen speichern
|
|
||||||
TEMP_FILES.Add(tempfile)
|
|
||||||
|
|
||||||
If Insert_GI_File(tempfile, msgonly) = True Then
|
Dim oAttachments As List(Of String) = EMAIL.Save_AttachmentsToDisk(pEmailFilePath)
|
||||||
erfolgreich = True
|
|
||||||
'Hier nun die Anhänge herauslösen
|
|
||||||
Dim _msg As New Msg.Message(msgname)
|
|
||||||
Dim i1 As Integer = 1
|
|
||||||
|
|
||||||
LOGGER.Info(">> Anzahl der Attachments: " & _msg.Attachments.Count)
|
LOGGER.Debug("Saved [{0}] attachments to disk.", oAttachments.Count)
|
||||||
For Each attachment As Independentsoft.Msg.Attachment In _msg.Attachments
|
|
||||||
If erfolgreich = False Then
|
For Each oAttachment In oAttachments
|
||||||
|
TEMP_FILES.Add(oAttachment)
|
||||||
|
LOGGER.Debug("Saved attachment [{0}].", oAttachment)
|
||||||
|
oSuccess = Insert_GI_File(oAttachment, oExtractedAttachmentMarker)
|
||||||
|
|
||||||
|
If oSuccess = False Then
|
||||||
|
LOGGER.Warn("Saving attachment to disk failed: [{0}]", oAttachment)
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Dim attachment_name As String
|
|
||||||
If attachment.LongFileName Is Nothing Then
|
|
||||||
attachment_name = attachment.DisplayName
|
|
||||||
Else
|
|
||||||
attachment_name = attachment.LongFileName
|
|
||||||
End If
|
|
||||||
If attachment.EmbeddedMessage IsNot Nothing Then
|
|
||||||
attachment_name = Utils.RemoveInvalidCharacters(attachment_name)
|
|
||||||
tempfile = Path.Combine(Path.GetTempPath, attachment_name & ".msg")
|
|
||||||
tempfile = ClassFilehandle.Versionierung_Datei(tempfile)
|
|
||||||
|
|
||||||
If tempfile <> String.Empty Then
|
|
||||||
Dim oMessage = attachment.EmbeddedMessage
|
|
||||||
oMessage.Save(tempfile)
|
|
||||||
TEMP_FILES.Add(tempfile)
|
|
||||||
LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile)
|
|
||||||
erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
|
|
||||||
i1 += 1
|
|
||||||
End If
|
|
||||||
ElseIf Not attachment_name.Contains("inline") Then
|
|
||||||
'Sonderzeichen entfernen
|
|
||||||
attachment_name = Utils.RemoveInvalidCharacters(attachment_name)
|
|
||||||
tempfile = Path.Combine(Path.GetTempPath, attachment_name)
|
|
||||||
tempfile = ClassFilehandle.Versionierung_Datei(tempfile)
|
|
||||||
If tempfile <> "" Then
|
|
||||||
attachment.Save(tempfile)
|
|
||||||
'Datei in Array zum Templöschen speichern
|
|
||||||
TEMP_FILES.Add(tempfile)
|
|
||||||
LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile)
|
|
||||||
'nun der Insert des Anhanges
|
|
||||||
erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
|
|
||||||
i1 += 1
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
Return erfolgreich
|
|
||||||
|
Return oSuccess
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Error in Email_Decay: " & ex.Message, MsgBoxStyle.Critical)
|
LOGGER.Warn("Saving email to disk failed (Email_Decay)")
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
|
||||||
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
'Private Shared Function Email_Decay(msgname As String, Optional FW As Boolean = False)
|
||||||
|
' Try
|
||||||
|
' Dim msgonly As String = "|MSGONLY|"
|
||||||
|
' Dim ATT_EXTR As String = "|ATTMNTEXTRACTED|"
|
||||||
|
' If FW = True Then
|
||||||
|
' msgonly = "|FW_MSGONLY|"
|
||||||
|
' ATT_EXTR = "|FW_ATTMNTEXTRACTED|"
|
||||||
|
' End If
|
||||||
|
' Dim erfolgreich As Boolean = False
|
||||||
|
' Dim msg As New MSG.Message(msgname)
|
||||||
|
|
||||||
|
' If msg.InternetMessageId IsNot Nothing Then
|
||||||
|
' CURRENT_MESSAGEID = msg.InternetMessageId
|
||||||
|
' Else
|
||||||
|
' LOGGER.Info("Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!")
|
||||||
|
' Dim sGUID As String
|
||||||
|
' sGUID = System.Guid.NewGuid.ToString()
|
||||||
|
' CURRENT_MESSAGEID = sGUID
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' 'Nur die MSGDatei ablegen
|
||||||
|
' Dim tempfile As String = Path.Combine(Path.GetTempPath, Path.GetFileNameWithoutExtension(msgname) & "_excl_att.msg")
|
||||||
|
|
||||||
|
' If File.Exists(tempfile) Then
|
||||||
|
' File.Delete(tempfile)
|
||||||
|
' End If
|
||||||
|
' Dim _msgEXAtt As New Msg.Message(msgname)
|
||||||
|
' _msgEXAtt.Attachments.Clear()
|
||||||
|
' _msgEXAtt.Save(tempfile)
|
||||||
|
' 'Datei in Array zum Templöschen speichern
|
||||||
|
' TEMP_FILES.Add(tempfile)
|
||||||
|
|
||||||
|
' If Insert_GI_File(tempfile, msgonly) = True Then
|
||||||
|
' erfolgreich = True
|
||||||
|
' 'Hier nun die Anhänge herauslösen
|
||||||
|
' Dim _msg As New Msg.Message(msgname)
|
||||||
|
' Dim i1 As Integer = 1
|
||||||
|
|
||||||
|
' LOGGER.Info(">> Anzahl der Attachments: " & _msg.Attachments.Count)
|
||||||
|
' For Each attachment As Independentsoft.Msg.Attachment In _msg.Attachments
|
||||||
|
' If erfolgreich = False Then
|
||||||
|
' Exit For
|
||||||
|
' End If
|
||||||
|
' Dim attachment_name As String
|
||||||
|
' If attachment.LongFileName Is Nothing Then
|
||||||
|
' attachment_name = attachment.DisplayName
|
||||||
|
' Else
|
||||||
|
' attachment_name = attachment.LongFileName
|
||||||
|
' End If
|
||||||
|
' If attachment.EmbeddedMessage IsNot Nothing Then
|
||||||
|
' attachment_name = Utils.RemoveInvalidCharacters(attachment_name)
|
||||||
|
' tempfile = Path.Combine(Path.GetTempPath, attachment_name & ".msg")
|
||||||
|
' tempfile = ClassFilehandle.Versionierung_Datei(tempfile)
|
||||||
|
|
||||||
|
' If tempfile <> String.Empty Then
|
||||||
|
' Dim oMessage = attachment.EmbeddedMessage
|
||||||
|
' oMessage.IsEmbedded = False
|
||||||
|
' oMessage.Save(tempfile)
|
||||||
|
' TEMP_FILES.Add(tempfile)
|
||||||
|
' LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile)
|
||||||
|
' erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
|
||||||
|
' i1 += 1
|
||||||
|
' End If
|
||||||
|
' ElseIf Not attachment_name.Contains("inline") Then
|
||||||
|
' 'Sonderzeichen entfernen
|
||||||
|
' attachment_name = Utils.RemoveInvalidCharacters(attachment_name)
|
||||||
|
' tempfile = Path.Combine(Path.GetTempPath, attachment_name)
|
||||||
|
' tempfile = ClassFilehandle.Versionierung_Datei(tempfile)
|
||||||
|
' If tempfile <> "" Then
|
||||||
|
' attachment.Save(tempfile)
|
||||||
|
' 'Datei in Array zum Templöschen speichern
|
||||||
|
' TEMP_FILES.Add(tempfile)
|
||||||
|
' LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile)
|
||||||
|
' 'nun der Insert des Anhanges
|
||||||
|
' erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
|
||||||
|
' i1 += 1
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' Return erfolgreich
|
||||||
|
' Catch ex As Exception
|
||||||
|
' MsgBox("Error in Email_Decay: " & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
' End Try
|
||||||
|
'End Function
|
||||||
|
|
||||||
Private Shared Function Insert_GI_File(filename As String, handleType As String)
|
Private Shared Function Insert_GI_File(filename As String, handleType As String)
|
||||||
Try
|
Try
|
||||||
filename = filename.Replace("'", "''")
|
filename = filename.Replace("'", "''")
|
||||||
@@ -145,7 +195,7 @@ Public Class ClassFilehandle
|
|||||||
Dim oHash As String = String.Empty
|
Dim oHash As String = String.Empty
|
||||||
|
|
||||||
If File.Exists(filename) Then
|
If File.Exists(filename) Then
|
||||||
If filename.ToUpper.EndsWith(".MSG") And (handleType = "|OUTLOOK_MESSAGE|" Or handleType = "|MSGONLY|") Then
|
If (filename.ToUpper.EndsWith(".MSG") Or filename.ToUpper.EndsWith(".EML")) And (handleType = "|OUTLOOK_MESSAGE|" Or handleType = "|MSGONLY|") Then
|
||||||
oHash = FILESYSTEM.GetChecksumFromString(filename)
|
oHash = FILESYSTEM.GetChecksumFromString(filename)
|
||||||
Else
|
Else
|
||||||
oHash = FILESYSTEM.GetChecksum(filename)
|
oHash = FILESYSTEM.GetChecksum(filename)
|
||||||
@@ -190,7 +240,7 @@ Public Class ClassFilehandle
|
|||||||
Try
|
Try
|
||||||
Dim version As Integer = 1
|
Dim version As Integer = 1
|
||||||
|
|
||||||
Dim Stammname As String = Path.GetDirectoryName(Dateiname) & "\" & Path.GetFileNameWithoutExtension(Dateiname)
|
Dim Stammname As String = Path.GetDirectoryName(Dateiname) & "\" & Path.GetFileNameWithoutExtension(Dateiname).Trim()
|
||||||
extension = Path.GetExtension(Dateiname)
|
extension = Path.GetExtension(Dateiname)
|
||||||
|
|
||||||
Dim _neuername As String = Stammname
|
Dim _neuername As String = Stammname
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports Independentsoft
|
|
||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
|
|
||||||
Public Class ClassFolderWatcher
|
Public Class ClassFolderWatcher
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports DLLLicenseManager
|
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.Config
|
Imports DigitalData.Modules.Config
|
||||||
Imports DigitalData.Modules.Windream
|
Imports DigitalData.Modules.Windream
|
||||||
Imports DigitalData.Modules.Filesystem
|
Imports DigitalData.Modules.Filesystem
|
||||||
|
Imports DigitalData.Modules.Messaging
|
||||||
|
Imports DLLLicenseManager
|
||||||
|
|
||||||
Public Class ClassInit
|
Public Class ClassInit
|
||||||
Public _lizenzManager As ClassLicenseManager
|
Public _lizenzManager As ClassLicenseManager
|
||||||
@@ -67,6 +68,7 @@ Public Class ClassInit
|
|||||||
configResult = Load_BasicConfig()
|
configResult = Load_BasicConfig()
|
||||||
|
|
||||||
FILESYSTEM = New File(LOGCONFIG)
|
FILESYSTEM = New File(LOGCONFIG)
|
||||||
|
EMAIL = New Email2(LOGCONFIG)
|
||||||
|
|
||||||
If configResult = False Then
|
If configResult = False Then
|
||||||
If USER_LANGUAGE = "de-DE" Then
|
If USER_LANGUAGE = "de-DE" Then
|
||||||
|
|||||||
@@ -175,6 +175,9 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DigitalData.Modules.Messaging">
|
||||||
|
<HintPath>..\..\DDMonorepo\Modules.Messaging\bin\Debug\DigitalData.Modules.Messaging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Windows">
|
<Reference Include="DigitalData.Modules.Windows">
|
||||||
<HintPath>..\..\DDMonorepo\Windows\bin\Debug\DigitalData.Modules.Windows.dll</HintPath>
|
<HintPath>..\..\DDMonorepo\Windows\bin\Debug\DigitalData.Modules.Windows.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -186,10 +189,6 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll</HintPath>
|
<HintPath>P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Independentsoft.Msg, Version=2.0.570.21482, Culture=neutral, PublicKeyToken=76be97fe952f1ec7, processorArchitecture=MSIL">
|
|
||||||
<SpecificVersion>False</SpecificVersion>
|
|
||||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\22_11_19\Independentsoft.Msg.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Interop.WINDREAMLib">
|
<Reference Include="Interop.WINDREAMLib">
|
||||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WINDREAMLib.dll</HintPath>
|
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WINDREAMLib.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
@@ -198,6 +197,10 @@
|
|||||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll</HintPath>
|
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Mail, Version=3.0.21189.1553, Culture=neutral, PublicKeyToken=6dc438ab78a525b3, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Limilabs\Mail.dll\Mail.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
||||||
@@ -471,6 +474,7 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmIndexFileList.en-US.resx">
|
<EmbeddedResource Include="frmIndexFileList.en-US.resx">
|
||||||
<DependentUpon>frmIndexFileList.vb</DependentUpon>
|
<DependentUpon>frmIndexFileList.vb</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmIndexFileList.en.resx">
|
<EmbeddedResource Include="frmIndexFileList.en.resx">
|
||||||
<DependentUpon>frmIndexFileList.vb</DependentUpon>
|
<DependentUpon>frmIndexFileList.vb</DependentUpon>
|
||||||
@@ -772,6 +776,9 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="globe_handdrawn.ico" />
|
<Content Include="globe_handdrawn.ico" />
|
||||||
|
<Content Include="MailLicense.xml">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Resources\DD_Icons_ICO_GLOBIX_1.ico" />
|
<Content Include="Resources\DD_Icons_ICO_GLOBIX_1.ico" />
|
||||||
<None Include="Resources\itemtypechecked.svg" />
|
<None Include="Resources\itemtypechecked.svg" />
|
||||||
<None Include="Resources\trackingchanges_next.svg" />
|
<None Include="Resources\trackingchanges_next.svg" />
|
||||||
|
|||||||
23
Global_Indexer/MailLicense.xml
Normal file
23
Global_Indexer/MailLicense.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<License>
|
||||||
|
<Id>4dc5ef40-f1a9-468b-994c-b7ed600ad878</Id>
|
||||||
|
<ProductName>Mail.dll</ProductName>
|
||||||
|
<SubscriptionUntil>2022-07-29</SubscriptionUntil>
|
||||||
|
<RegisteredTo>Digital Data GmbH</RegisteredTo>
|
||||||
|
<LicenseType>single developer</LicenseType>
|
||||||
|
<BuyerName>Digital Data GmbH</BuyerName>
|
||||||
|
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||||
|
<SignedInfo>
|
||||||
|
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
|
||||||
|
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
|
||||||
|
<Reference URI="">
|
||||||
|
<Transforms>
|
||||||
|
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
|
||||||
|
</Transforms>
|
||||||
|
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
|
<DigestValue>75MRtl4ipYelIZYlpT8O7QDX9Zc=</DigestValue>
|
||||||
|
</Reference>
|
||||||
|
</SignedInfo>
|
||||||
|
<SignatureValue>Raxfkz6DfQVs/sMvH+F2nH0eHXD8FoUFSdP3t7AgBUdpABJQx86srlyuMSEhXPlc1THCqPouEVob4RsWnd9OXvTiPPSOUSK9zuNG6uz93KLAhpSD5PraAgBCF4jwZArlAp7aCNfZpHqQ3w6TRHS+CfravUU0AHHG3MZ1ZcRkGuo=</SignatureValue>
|
||||||
|
</Signature>
|
||||||
|
</License>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports DigitalData.Modules.Config
|
Imports DigitalData.Modules.Config
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.Filesystem
|
Imports DigitalData.Modules.Filesystem
|
||||||
|
Imports DigitalData.Modules.Messaging
|
||||||
|
|
||||||
Module ModuleCURRENT
|
Module ModuleCURRENT
|
||||||
Public ERROR_STATE As String
|
Public ERROR_STATE As String
|
||||||
@@ -16,6 +17,7 @@ Module ModuleCURRENT
|
|||||||
Public LOGCONFIG As LogConfig
|
Public LOGCONFIG As LogConfig
|
||||||
Public LOGGER As Logger
|
Public LOGGER As Logger
|
||||||
Public FILESYSTEM As File
|
Public FILESYSTEM As File
|
||||||
|
Public EMAIL As Email2
|
||||||
|
|
||||||
Public CURRENT_DOKART_ID As Integer
|
Public CURRENT_DOKART_ID As Integer
|
||||||
Public CURRENT_DOKART_DUPLICATE_HANDLING As String = "Default"
|
Public CURRENT_DOKART_DUPLICATE_HANDLING As String = "Default"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
<Assembly: AssemblyVersion("2.4.2.8")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|
||||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||||
@@ -516,11 +516,4 @@ Public Class frmConfig_Basic
|
|||||||
' Navigate to a URL.
|
' Navigate to a URL.
|
||||||
System.Diagnostics.Process.Start("http://www.didalog.de/Support")
|
System.Diagnostics.Process.Start("http://www.didalog.de/Support")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'Private Sub chkdelete_origin_CheckedChanged(sender As Object, e As EventArgs) Handles chkdelete_origin.CheckedChanged
|
|
||||||
' If CURR_DELETE_ORIGIN <> chkdelete_origin.Checked Then
|
|
||||||
' CURR_DELETE_ORIGIN = chkdelete_origin.Checked
|
|
||||||
' SaveConfigValue("Delete_OriginFile", CURR_DELETE_ORIGIN)
|
|
||||||
' End If
|
|
||||||
'End Sub
|
|
||||||
End Class
|
End Class
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,5 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports Microsoft.Office.Interop
|
Imports Microsoft.Office.Interop
|
||||||
Imports Independentsoft
|
|
||||||
Imports DLLLicenseManager
|
Imports DLLLicenseManager
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
@@ -255,6 +254,8 @@ Public Class frmStart
|
|||||||
MsgBox("Unexpected Error in Closing Application: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Unexpected Error in Closing Application: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
EMAIL.Clear_TempFiles()
|
||||||
|
|
||||||
'TempDateien löschen
|
'TempDateien löschen
|
||||||
For Each oFile In TEMP_FILES
|
For Each oFile In TEMP_FILES
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -119,6 +119,9 @@
|
|||||||
<File Id="Windream" Name="DigitalData.Modules.Windream.dll" Source="DigitalData.Modules.Windream.dll" KeyPath="no" />
|
<File Id="Windream" Name="DigitalData.Modules.Windream.dll" Source="DigitalData.Modules.Windream.dll" KeyPath="no" />
|
||||||
<File Id="Windows" Name="DigitalData.Modules.Windows.dll" Source="DigitalData.Modules.Windows.dll" KeyPath="no" />
|
<File Id="Windows" Name="DigitalData.Modules.Windows.dll" Source="DigitalData.Modules.Windows.dll" KeyPath="no" />
|
||||||
<File Id="Language" Name="DigitalData.Modules.Language.dll" Source="DigitalData.Modules.Language.dll" KeyPath="no" />
|
<File Id="Language" Name="DigitalData.Modules.Language.dll" Source="DigitalData.Modules.Language.dll" KeyPath="no" />
|
||||||
|
|
||||||
|
<File Id="Messaging" Name="DigitalData.Modules.Messaging.dll" Source="DigitalData.Modules.Messaging.dll" KeyPath="no" />
|
||||||
|
<File Id="Messaging.License" Name="MailLicense.xml" Source="MailLicense.xml" KeyPath="no" />
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="GDPictureLibs" Guid="9ea5ab43-58ff-4813-9a8b-f854784f0275">
|
<Component Id="GDPictureLibs" Guid="9ea5ab43-58ff-4813-9a8b-f854784f0275">
|
||||||
@@ -130,8 +133,8 @@
|
|||||||
|
|
||||||
<!--Verschiedene Bibliotheken-->
|
<!--Verschiedene Bibliotheken-->
|
||||||
<Component Id="MiscLibs" Guid="56bb39d9-101a-411d-8b11-5d4e3a602275">
|
<Component Id="MiscLibs" Guid="56bb39d9-101a-411d-8b11-5d4e3a602275">
|
||||||
<File Id="MSGLib" Name="Independentsoft.Msg.dll" Source="P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\Independentsoft.Msg.2.0.570.21482.dll" KeyPath="yes" />
|
|
||||||
<File Id="NLog" Name="NLog.dll" Source="NLog.dll" KeyPath="no" />
|
<File Id="NLog" Name="NLog.dll" Source="NLog.dll" KeyPath="no" />
|
||||||
|
<File Id="Limilabs.Mail" Name="Mail.dll" Source="Mail.dll" KeyPath="no" />
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<!--WINDREAM Bibliotheken-->
|
<!--WINDREAM Bibliotheken-->
|
||||||
|
|||||||
Reference in New Issue
Block a user