WIP Rename Inbox files to eml files
This commit is contained in:
parent
2101f51816
commit
527b15c01c
@ -27,6 +27,28 @@ Public Class ClassFilehandle
|
|||||||
|
|
||||||
Dim oTempFilePath = pFilepath
|
Dim oTempFilePath = pFilepath
|
||||||
|
|
||||||
|
Dim oInboxRegex As New Regex("\.INBOX\d+$")
|
||||||
|
|
||||||
|
If oInboxRegex.IsMatch(oTempFilePath) Then
|
||||||
|
LOGGER.Info("Renaming INBOX file to EML")
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim oInfo As New FileInfo(oTempFilePath)
|
||||||
|
LOGGER.Info("Old Name: {0}", oInfo.Name)
|
||||||
|
Dim oNewName = $"{oInfo.Name}.eml"
|
||||||
|
LOGGER.Info("New Name: {0}", oNewName)
|
||||||
|
Dim oTempDirectory = IO.Path.GetTempPath()
|
||||||
|
Dim oNewPath = IO.Path.Combine(oTempDirectory, oNewName)
|
||||||
|
|
||||||
|
IO.File.Copy(oInfo.Name, oNewPath)
|
||||||
|
TEMP_FILES.Add(oNewPath)
|
||||||
|
|
||||||
|
oTempFilePath = oNewPath
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
If oTempFilePath.ToUpper.EndsWith(".MSG") Or oTempFilePath.ToUpper.EndsWith(".EML") Then
|
If oTempFilePath.ToUpper.EndsWith(".MSG") Or oTempFilePath.ToUpper.EndsWith(".EML") Then
|
||||||
CURRENT_MESSAGEID = ""
|
CURRENT_MESSAGEID = ""
|
||||||
Dim oMail As IMail = EMAIL.Load_Email(oTempFilePath)
|
Dim oMail As IMail = EMAIL.Load_Email(oTempFilePath)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user