MS Limilabs etc

This commit is contained in:
2021-10-22 15:24:49 +02:00
parent f2825b9d09
commit fb6f2558f2
449 changed files with 459298 additions and 427010 deletions

View File

@@ -1,6 +1,8 @@
Imports Independentsoft.Email.Mime
Imports WINDREAMLib
Imports WINDREAMLib
Imports Limilabs.Mail
Imports Limilabs.Mail.MIME
Imports Limilabs.Mail.Headers
Imports MailBox = Limilabs.Mail.Headers.MailBox
Public Class ClassCurrent
Public Shared WM_CON_STRING As String
Public Shared WM_DRIVE As String
@@ -31,13 +33,14 @@ Public Class ClassCurrent
Public Shared CURRENT_WORKMAIL_LIST As New ArrayList()
Public Shared CURRENT_MAIL_MESSAGE As Message
Public Shared CURRENT_MAIL_MESSAGE As IMail
Public Shared CURRENT_TEMP_MAIL_PATH As String
Public Shared CURRENT_MAIL_BODY_ALL As String
Public Shared CURRENT_MAIL_BODY_ANSWER1 As String = ""
Public Shared CURRENT_MAIL_BODY_Substr2 As String = ""
Public Shared CURRENT_MAIL_SUBJECT As String = ""
Public Shared CURRENT_MAIL_FROM As String = ""
Public Shared CURRENT_MAIL_MESSAGE_ID As String = ""
Public Shared CURRENT_MAIL_PROCESS_NAME As String
Public Shared CURRENT_POLL_TYPE As String

View File

@@ -53,8 +53,11 @@
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="Independentsoft.Email">
<HintPath>P:\Projekte DIGITAL DATA\DIGITAL DATA - Entwicklung\DLL_Bibliotheken\Email .NET\Bin\Independentsoft.Email.dll</HintPath>
<Reference Include="DigitalData.Modules.Messaging">
<HintPath>..\..\..\DDMonorepo\Modules.Messaging\bin\Debug\DigitalData.Modules.Messaging.dll</HintPath>
</Reference>
<Reference Include="Independentsoft.Msg">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\Independentsoft.Msg.dll</HintPath>
</Reference>
<Reference Include="Interop.WINDREAMLib">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WINDREAMLib.dll</HintPath>
@@ -68,6 +71,9 @@
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOSRCHLib.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Mail">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Limilabs\Mail.dll\Mail.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -104,7 +110,7 @@
<Compile Include="ClassCurrent.vb" />
<Compile Include="clsDatabase.vb" />
<Compile Include="clsEmail.IMAP.vb" />
<Compile Include="clsEmail.vb" />
<Compile Include="EmailStrings.vb" />
<Compile Include="clsEncryption.vb" />
<Compile Include="clsWindream_allgemein.vb" />
<Compile Include="clsWindream_Index.vb" />

View File

@@ -0,0 +1,38 @@
Public Class EmailStrings
Public Const EMAIL_WRAPPING_TEXT = "<html><body style=''font-family:""Arial"";font-size:10.0pt''>Sehr geehrte Damen und Herren,<br/><br/>
das Portal konnte die von Ihnen gesandte Email leider nicht verarbeiten! <br><br> Grund: {0}<p>Bitte prüfen Sie die Email und nehmen Sie bei Bedarf mit uns Kontakt auf.<p>
Vielen Dank für Ihr Verständnis.<br>Mit freundlichen Grüßen<br>Ihre IT-Abteilung</body></html>"
Public Const EMAIL_SUBJECT_TEXT = "<p>Der Betreff der Original-Email war: <em>{0}</em></p>"
Public Const EMAIL_SUBJECT_REJECTED = "Beleg abgelehnt"
Public Const EMAIL_SUBJECT_EXCEPTION = "Unbehandelte Ausnahme"
Public Const EMAIL_UNHANDLED_EXCEPTION = """
<p>Beim Verarbeiten der Datei mit der Message ID '{0}' ist ein schwerer Fehler aufgetreten.</p>
<p>Fehlerbeschreibung: {1}</p>
<pre>{2}</pre>
"""
Public Const EMAIL_MISSINGPROPERTIES_1 = "<p>Die angehängte Datei entspricht nicht dem ZUGFeRD-Format: {0}</p>"
Public Const EMAIL_MISSINGPROPERTIES_2 = "<p>Die folgenden Eigenschaften wurden als ERFORDERLICH eingestuft, wurden aber nicht gefunden:<p/>"
Public Const EMAIL_MD5_ERROR = "<p>Die von Ihnen gesendete Rechnung wurde bereits von unserem System verarbeitet.</p>"
Public Const EMAIL_TOO_MUCH_FERDS = "<p>Ihre Email enthielt mehr als ein ZUGFeRD-Dokument.</p>"
Public Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine Dokumente.</p>"
Public Const EMAIL_FILE_SIZE_REACHED = "
<p>Die von Ihnen gesendete Rechnung oder einer der Rechnungs-Anhänge überschreitet die erlaubte Größe von <strong>{0} MB</strong>.</p>
<p>Die folgende Datei hat die erlaubte Größe überschritten:<ul>
<li>{1}</li>
</ul></p>
"
Public Const EMAIL_INVALID_DOCUMENT = "
<p>Ihre Email enthielt ein ZUGFeRD Dokument, welches aber inkorrekt formatiert wurde.</p>
<p>Mögliche Gründe für ein inkorrektes Format:<ul>
<li>Betrags-Werte weisen ungültiges Format auf (25,01 anstatt 25.01)</li>
</ul></p>
"
End Class

View File

@@ -2,4 +2,5 @@
Public CURRENToWMSession As Object
Public CURRENToWMSession_Created As Date = Now
Public CURRENToWMConnect As Object
Public CURRENT_ATTMT_COUNT As Integer
End Module

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.2.0.0")>
<Assembly: AssemblyFileVersion("3.0.0.0")>
<Assembly: AssemblyVersion("3.5.0.0")>
<Assembly: AssemblyFileVersion("3.5.0.0")>

View File

@@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
@@ -53,6 +53,15 @@ Namespace My
Return defaultInstance
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("Email-Profiler")> _
Public ReadOnly Property PraefixSubject() As String
Get
Return CType(Me("PraefixSubject"),String)
End Get
End Property
End Class
End Namespace

View File

@@ -1,5 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
<Profiles />
<Settings />
<Settings>
<Setting Name="PraefixSubject" Type="System.String" Scope="Application">
<Value Profile="(Default)">Email-Profiler</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DigitalData.EMLProfiler.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
@@ -24,4 +27,11 @@
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<applicationSettings>
<DigitalData.EMLProfiler.My.MySettings>
<setting name="PraefixSubject" serializeAs="String">
<value>Email-Profiler</value>
</setting>
</DigitalData.EMLProfiler.My.MySettings>
</applicationSettings>
</configuration>

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DigitalData.EMLProfiler.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
@@ -24,4 +27,11 @@
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<applicationSettings>
<DigitalData.EMLProfiler.My.MySettings>
<setting name="PraefixSubject" serializeAs="String">
<value>Email-Profiler</value>
</setting>
</DigitalData.EMLProfiler.My.MySettings>
</applicationSettings>
</configuration>

View File

@@ -0,0 +1,149 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Filesystem
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Filesystem.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Filesystem.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Filesystem.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="T:DigitalData.Modules.Filesystem.FileContainer">
<module>FileContainer</module>
<version>0.0.0.2</version>
<date>21.11.2018</date>
<summary>
File Container for securely saving files
</summary>
<dependencies>
NLog, >= 4.5.8
</dependencies>
<params>
LogConfig, DigitalData.Module.Logging.LogConfig
A LogConfig object
Password, String
The Password to Encrypt
Path, String
The Path to save/load the container
</params>
<example>
dim oContainer = Container.Create(logConfig, "pass", "E:\some.container")
dim oContainer = Container.Load(logConfig, "pass", "E:\some.container")
dim oContainer = new Container(logConfig, "pass", "E:\some.container")
oContainer.Save()
dim oContainer = new Container(logConfig, "pass", "E:\some.container")
oContainer.Contents = oSomeData
oContainer.Save()
dim oContainer = new Container(logConfig, "pass", "E:\some.container")
oContainer.Load()
dim oContents = oContainer.Contents
dim oContainer = new Container(logConfig, "pass", "E:\some.container")
oContainer.Load()
oContainer.Contents = oSomeOtherData
oContainer.Save()
oContainer.SaveAs("E:\some2.container")
</example>
</member>
<member name="T:DigitalData.Modules.Filesystem.File">
<module>File</module>
<version>0.0.0.1</version>
<date>11.10.2018</date>
<summary>
Module that provides variouse File operations
</summary>
<dependencies>
NLog, >= 4.5.8
</dependencies>
<params>
LogConfig, DigitalData.Module.Logging.LogConfig
A LogConfig object
</params>
<props>
</props>
<example>
</example>
<remarks>
</remarks>
</member>
<member name="M:DigitalData.Modules.Filesystem.File.GetVersionedFilename(System.String)">
<summary>
Adds file version string to given filename `Destination` if that file already exists.
</summary>
<param name="Destination"></param>
<returns></returns>
</member>
<member name="M:DigitalData.Modules.Filesystem.File.RemoveFiles(System.String,System.Int32,System.String,System.String,System.Boolean)">
<summary>
Removes files in a directory filtered by filename, extension and last write date
</summary>
<param name="Path">The directory in which files will be deleted</param>
<param name="FileKeepTime">Only delete files which are older than x days. Must be between 0 and 1000 days.</param>
<param name="FileBaseName">A filename filter which will be checked</param>
<param name="FileExtension">A file extension which will be checked</param>
<param name="ContinueOnError">Should the function continue with deleting when a file could not be deleted?</param>
<returns>True if all files were deleted or if no files were deleted, otherwise false</returns>
</member>
<member name="M:DigitalData.Modules.Filesystem.File.CopyDirectory(System.String,System.String,System.Boolean)">
<summary>
Copied from https://docs.microsoft.com/en-us/dotnet/standard/io/how-to-copy-directories
</summary>
<param name="SourceDirName"></param>
<param name="DestDirName"></param>
<param name="CopySubDirs"></param>
</member>
<member name="M:DigitalData.Modules.Filesystem.File.CreateDirectory(System.String,System.Boolean)">
<summary>
Tries to create a directory and returns its path.
Returns a temp path if `DirectoryPath` can not be created or written to.
</summary>
<param name="DirectoryPath">The directory to create</param>
<param name="TestWriteAccess">Should a write access test be performed?</param>
<returns>The used path</returns>
</member>
<member name="M:DigitalData.Modules.Filesystem.FileWatcher.HandleFileChanged(System.Object,System.IO.FileSystemEventArgs)">
<summary>
This may fire twice for a single save operation,
see: https://blogs.msdn.microsoft.com/oldnewthing/20140507-00/?p=1053/
</summary>
</member>
<member name="T:DigitalData.Modules.Filesystem.FileWatcherFilters">
<summary>
Built-in filters for FileWatcher that are useful for correctly detecting changes on Office documents (currently Office 2016)
</summary>
</member>
<member name="T:DigitalData.Modules.Filesystem.FileWatcherFilters.BaseFileFilter">
<summary>
Base Filter that all filters must inherit from
Provides two functions that may be overridden and some useful file extension lists
</summary>
</member>
<member name="T:DigitalData.Modules.Filesystem.FileWatcherFilters.TempFileFilter">
<summary>
Simple Filter that filters changes made on temporary files
</summary>
</member>
<member name="T:DigitalData.Modules.Filesystem.FileWatcherFilters.OfficeFileFilter">
<summary>
Filter to detect changes on Office files
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,125 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Language
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Language.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Language.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Language.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="T:DigitalData.Modules.Language.Utils">
<summary>
Provides common utility functions that do not require a specific context.
</summary>
</member>
<member name="M:DigitalData.Modules.Language.Utils.ShortGUID">
<summary>
Generates a random short (8 characters) guid
</summary>
<returns>The generated guid as a String</returns>
</member>
<member name="M:DigitalData.Modules.Language.Utils.ToEnum``1(System.String)">
<summary>
Converts a String value to the given Enum
</summary>
<typeparam name="T">The Enum Type</typeparam>
<param name="value">The string value to convert</param>
</member>
<member name="M:DigitalData.Modules.Language.Utils.ToEnum``1(System.Int32)">
<summary>
Converts an Integer value to the given Enum
</summary>
<typeparam name="T">The Enum Type</typeparam>
<param name="value">The integer value to convert</param>
</member>
<member name="M:DigitalData.Modules.Language.Utils.ToEnum``1(System.Int64)">
<summary>
Converts a Long value to the given Enum
</summary>
<typeparam name="T">The Enum Type</typeparam>
<param name="value">The long value to convert</param>
</member>
<member name="M:DigitalData.Modules.Language.Utils.NotNull``1(``0,``0)">
<summary>
Checks a value for three different `null` values,
Nothing, Empty String, DBNull
Returns the original value if the value is not null, or `defaultValue`
</summary>
<typeparam name="T">The type of the value</typeparam>
<param name="value">The value</param>
<param name="defaultValue">The default Value</param>
<returns>The original value or the default value</returns>
</member>
<member name="M:DigitalData.Modules.Language.Utils.NotNull``1(System.Data.DataRow,System.String,``0)">
<summary>
Checks a Row value for three different `null` values,
Nothing, Empty String, DBNull
Returns the original value if the value is not null, or `defaultValue`
</summary>
<typeparam name="T">The type of the value</typeparam>
<param name="Row">The DataRow that contains the value</param>
<param name="Column">The column name</param>
<param name="DefaultValue">The default value</param>
<returns>The original value or the default value</returns>
</member>
<member name="M:DigitalData.Modules.Language.Utils.ConvertTextToSlug(System.String)">
<summary>
Creates a "slug" from text that can be used as part of a valid URL.
Invalid characters are converted to hyphens. Punctuation that Is
perfect valid in a URL Is also converted to hyphens to keep the
result mostly text. Steps are taken to prevent leading, trailing,
And consecutive hyphens.
</summary>
<param name="s">The string to convert</param>
</member>
<member name="M:DigitalData.Modules.Language.Utils.RemoveInvalidCharacters(System.String)">
<summary>
Removes Invalid characters from a string, suitable for file and path names
Removed characters are:
* Illegal File-characters
* Illegal Path-characters
* Unicode characters that classify as Emoji
* All characters above codepoint U+10000
See:
https://stackoverflow.com/questions/46905176/detecting-all-emojis
https://stackoverflow.com/questions/28023682/how-do-i-remove-emoji-characters-from-a-string
</summary>
<returns></returns>
</member>
<member name="M:DigitalData.Modules.Language.Utils.IsVisibleOnAnyScreen(System.Drawing.Point)">
<summary>
Checks if a point is Visible on any screen
</summary>
</member>
<member name="M:DigitalData.Modules.Language.Utils.SizeIsVisible(System.Drawing.Size)">
<summary>
Checks if Size is not negative
</summary>
</member>
<member name="M:DigitalData.Modules.Language.Utils.LocationIsVisible(System.Drawing.Point)">
<summary>
Checks if Location is not negative
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,107 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Messaging
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Messaging.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Messaging.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Messaging.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="M:DigitalData.Modules.Messaging.Email.TestIMAPLogin(System.String,System.Int32,System.String,System.String,System.String)">
<summary>
Tests connection to a given IMAP Server by connecting and doing a simple message query.
</summary>
<param name="Server">IP-Address or Domainname of Server</param>
<param name="Port">IMAP-Port</param>
<param name="Username">IMAP-Username</param>
<param name="Password">IMAP-Password</param>
<param name="Folder">The folder to fetch messages from. Defaults to `Inbox`</param>
<returns>True if connection and query were successful. False otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Messaging.Email.FetchIMAPMessages(System.String,System.Int32,System.String,System.String,System.String)">
<summary>
Connects to an IMAP Server with the given credentials and
fetches emails from the given folder.
Results can be filtered with `SearchCondition`
</summary>
<param name="Server">IP-Address or Domainname of Server</param>
<param name="Port">IMAP-Port</param>
<param name="Username">IMAP-Username</param>
<param name="Password">IMAP-Password</param>
<param name="Folder">The folder to fetch messages from</param>
<param name="SearchCondition">Filter the search command. Defaults to `All`</param>
<returns>A list of Independentsoft.Email.Mime.Message objects</returns>
</member>
<member name="M:DigitalData.Modules.Messaging.Email.WriteMessageToFile(System.Net.Mail.MailMessage,System.String)">
<summary>
Uses a private API from MailWriter to write a MailMessage to disk.
May break in future versions of .NET
</summary>
</member>
<member name="T:DigitalData.Modules.Messaging.EventBus">
<summary>
A Simple EventBus for .NET
https://stackoverflow.com/questions/368265/a-simple-event-bus-for-net
</summary>
</member>
<member name="M:DigitalData.Modules.Messaging.EventBus.Register(System.Object)">
<summary>
Register a form as an event listener.
</summary>
<param name="listener">The event listener, usually `Me`</param>
</member>
<member name="M:DigitalData.Modules.Messaging.Email2.Load_Email(System.String)">
<summary>
Loads an eml file from disk and returns the IMail representation of it
</summary>
<param name="pFileName">Path to the eml file</param>
<returns>The IMail object</returns>
</member>
<member name="M:DigitalData.Modules.Messaging.Email2.Remove_AttachmentsFromEmail(System.String,System.String)">
<summary>
Removes all attachments from an EML file and saves it to a temporary file.
</summary>
<param name="pFileName">The EML file to process.</param>
<param name="pSuffix">The optional suffix to add to the original filename.</param>
<returns>The path of the new EML without attachments.</returns>
</member>
<member name="M:DigitalData.Modules.Messaging.Limilab.InitIMAP(System.String,System.Int32,System.String,System.String,System.String,System.String)">
<summary>
Initializes the module.
</summary>
<param name="oImapServer">IP-Address or Domainname of Server</param>
<param name="oPort">IMAP-Port</param>
<param name="oUser">IMAP-Username</param>
<param name="oPassword">IMAP-Password</param>
<param name="oAuthType">Auth-Type</param>
<param name="Folder">The folder to fetch messages from. Defaults to `Inbox`</param>
</member>
<member name="M:DigitalData.Modules.Messaging.Limilab.IMAPTestLogin">
<summary>
Tests connection to a given IMAP Server by connecting and doing a simple message query.
</summary>
<returns>True if connection and query were successful. False otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Messaging.Limilab.NewSMTPEmail(System.String,System.String,System.String,System.String,System.String,System.Int32,System.String,System.String,System.String,System.String,System.String,System.String,System.Boolean)">
<summary>
Creates a MailObject and sends Mail via smtp.
</summary>
<returns>True if Message was send. False otherwise.</returns>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sources>
<!-- Dieser Abschnitt definiert die Protokollierungskonfiguration für My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben, um in das Anwendungsereignisprotokoll zu schreiben -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben und APPLICATION_NAME durch den Namen der Anwendung ersetzen, um in das Anwendungsereignisprotokoll zu schreiben -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>

View File

@@ -0,0 +1,114 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.EMLProfiler
</name>
</assembly>
<members>
<member name="T:DigitalData.EMLProfiler.My.Resources.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:DigitalData.EMLProfiler.My.Resources.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:DigitalData.EMLProfiler.My.Resources.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="M:DigitalData.EMLProfiler.clsEmailIMAP.WriteMessageToFile(System.Net.Mail.MailMessage,System.String)">
<summary>
Uses a private API from MailWriter to write a MailMessage to disk.
May break in future versions of .NET
</summary>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.#ctor(DigitalData.Modules.Logging.LogConfig)">
<summary>
Konstruktor für die windream-Klasse
</summary>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.Init">
<summary>
Initialisiert die statische Klasse (Login, Session starten, usw.)
</summary>
<returns>Liefert True wenn das Anmelden erfolgreich war, sonst False</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetObjecttypesAsObjects">
<summary>
Liefert alle Objekttypen des aktuellen Servers als windream-Objekte.
</summary>
<returns>Alle Objekttypen als WMObjects-Objekt</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetObjecttypesAsStrings">
<summary>
Liefert alle Objekttypen des aktuellen Servers als Array aus Strings.
</summary>
<returns>Array mit allen Objekttypen als Strings</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetIndicesByObjecttype(System.String)">
<summary>
Liefert alle Indexe eines Objekttypen.
</summary>
<param name="name">Name des Objekttyps</param>
<returns>Array mit allen Objekttyp zugeordneten Indexen als String</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetObjecttypeByName(System.String)">
<summary>
Liefert einen Objekttyp als WMObject an Hand dessen Name.
</summary>
<param name="objekttypName">Name des Objekttyps</param>
<returns>Objekttyp als WMObject</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.ExistIndexInObjekttyp(System.String,System.String)">
<summary>
Überprüft ob der angegebene Index im Objekttyp existiert
</summary>
<param name="objekttyp">Name des zu durchsuchenden Objekttyps</param>
<param name="indexname">Name des zu suchenden Indexes</param>
<returns>Liefert True wenn der Index im Objekttyp existiert, sonst False</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.IsLoggedIn">
<summary>
Liefert True wenn die windream-Session angemeldet ist und False für den Fall, dass die Session nicht eingeloggt ist.
</summary>
<returns>Anmeldestatus als Boolean</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetCurrentServer">
<summary>
Liefert den Servernamen an dem windream aktuell angemeldet ist.
</summary>
<returns>Servername als String</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_allgemein.GetTypeOfIndexAsIntByName(System.String)">
<summary>
Liefert den Typen eines Indexes als Integer.
</summary>
<param name="indexname">Name des zu überprüfenden Indexfeldes</param>
<returns>Liefert eine Zahl, die einen Typen beschreibt</returns>
<remarks></remarks>
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_Index.GetValueforIndex(System.String,System.String)">
Liefert den Wert eines Indexes als String
_indexname = Name des zu überprüfenden Indexfeldes
</member>
<member name="M:DigitalData.EMLProfiler.clsWindream_Index.GetValueforIndex_WMFile(WINDREAMLib.WMObject,System.String)">
Liefert den Wert eines Indexes als String
_indexname = Name des zu überprüfenden Indexfeldes
</member>
</members>
</doc>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="EntityFramework.Firebird.FbConnectionFactory, EntityFramework.Firebird" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="EntityFramework.Firebird.FbProviderServices, EntityFramework.Firebird" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,246 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Database
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Database.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Database.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Database.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="T:DigitalData.Modules.Database.Firebird">
<summary>
MODULE: Firebird
VERSION: 0.0.0.4
DATE: 18.12.2018
DESCRIPTION:
DEPENDENCIES: NLog, >= 4.5.10
EntityFramework.Firebird, >= 6.4.0
FirebirdSql.Data.FirebirdClient, >= 6.4.0
PARAMETERS: LogConfig, DigitalData.Modules.Logging.LogConfig
The LogFactory containing the current log config. Used to instanciate the class logger for this and any dependent class
DataSource, String
The server where the database lives, for example 127.0.0.1 or dd-vmx09-vm03
Database, String
The location of the Database in the format `127.0.0.1:E:\Path\To\Database.FDB`
User, String
The user name to connect as
Password, String
The user's password
PROPERTIES: ConnectionEstablished, Boolean
If the last opened connection was successful
ConnectionFailed, Boolean
If the last opened connection failed
ConnectionString, String
The used connectionstring
EXAMPLES:
REMARKS: If the connection fails due to "wrong username or password", the cause might be that the server harddrive is full..
</summary>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.#ctor(DigitalData.Modules.Logging.LogConfig,System.String,System.String,System.String,System.String)">
<summary>
</summary>
<param name="LogConfig">The LogFactory containing the current log config. Used to instanciate the class logger for this and any dependent class</param>
<param name="Datasource">The server where the database lives, for example 127.0.0.1 or dd-vmx09-vm03</param>
<param name="Database">The location of the Database in the format `127.0.0.1:E:\Path\To\Database.FDB`</param>
<param name="User">The user name to connect as</param>
<param name="Password">The user's password</param>
<exception cref="T:DigitalData.Modules.Database.Exceptions.DatabaseException"></exception>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.GetConnectionString(System.String,System.String,System.String,System.String)">
<summary>
Builds a connectionstring from the provided arguments.
</summary>
<param name="DataSource">The database server where to connect to</param>
<param name="Database">The datasource, eg. the path of the FDB-file</param>
<param name="User">The user used to connect to the database</param>
<param name="Password">The password of the connecting user</param>
<returns>A connectionstring</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.ExecuteNonQueryWithConnection(System.String,FirebirdSql.Data.FirebirdClient.FbConnection,DigitalData.Modules.Database.Firebird.TransactionMode,FirebirdSql.Data.FirebirdClient.FbTransaction)">
<summary>
Executes a non-query command.
</summary>
<param name="SqlCommand">The command to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>True, if command was executed sucessfully. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.ExecuteNonQuery(System.String)">
<summary>
Executes a non-query command.
</summary>
<param name="SqlCommand">The command to execute</param>
<returns>True, if command was executed sucessfully. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.ExecuteNonQuery(System.String,FirebirdSql.Data.FirebirdClient.FbTransaction)">
<summary>
Executes a non-query command inside the specified transaction.
</summary>
<param name="SqlCommand">The command to execute</param>
<returns>True, if command was executed sucessfully. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.GetScalarValueWithConnection(System.String,FirebirdSql.Data.FirebirdClient.FbConnection,DigitalData.Modules.Database.Firebird.TransactionMode,FirebirdSql.Data.FirebirdClient.FbTransaction)">
<summary>
Executes a sql query resulting in a scalar value.
</summary>
<param name="SqlQuery">The query to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.GetScalarValue(System.String)">
<summary>
Executes a sql query resulting in a scalar value.
</summary>
<param name="SqlQuery">The query to execute</param>
<returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.GetDatatableWithConnection(System.String,FirebirdSql.Data.FirebirdClient.FbConnection,DigitalData.Modules.Database.Firebird.TransactionMode,FirebirdSql.Data.FirebirdClient.FbTransaction)">
<summary>
Executes a sql query resulting in a table of values.
</summary>
<param name="SqlQuery">The query to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Firebird.GetDatatable(System.String,DigitalData.Modules.Database.Firebird.TransactionMode,FirebirdSql.Data.FirebirdClient.FbTransaction)">
<summary>
Executes a sql query resulting in a table of values.
</summary>
<param name="SqlQuery">The query to execute</param>
<returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.ExecuteNonQueryWithConnection(System.String,System.Data.Odbc.OdbcConnection)">
<summary>
Executes a non-query command.
</summary>
<param name="SqlQuery">The command to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>True, if command was executed sucessfully. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.ExecuteNonQuery(System.String)">
<summary>
Executes a non-query command.
</summary>
<param name="SqlCommand">The command to execute</param>
<returns>True, if command was executed sucessfully. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.GetScalarValueWithConnection(System.String,System.Data.Odbc.OdbcConnection)">
<summary>
Executes a sql query resulting in a scalar value.
</summary>
<param name="SqlQuery">The query to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.GetScalarValue(System.String)">
<summary>
Executes a sql query resulting in a table of values.
</summary>
<param name="SqlQuery">The query to execute</param>
<returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.GetDatatableWithConnection(System.String,System.Data.Odbc.OdbcConnection)">
<summary>
Executes a sql query resulting in a table of values.
</summary>
<param name="SqlQuery">The query to execute</param>
<param name="Connection">The Firebird connection to use</param>
<returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.ODBC.GetDatatable(System.String)">
<summary>
Executes a sql query resulting in a table of values.
</summary>
<param name="SqlQuery">The query to execute</param>
<returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
</member>
<member name="M:DigitalData.Modules.Database.Oracle.GetDatatable(System.String)">
<summary>
Returns a datatable for a sql-statement
</summary>
<param name="sqlcommand">sqlcommand for datatable (select XYZ from TableORView)</param>
<returns>Returns a datatable</returns>
</member>
<member name="M:DigitalData.Modules.Database.Oracle.NewExecutenonQuery(System.String)">
<summary>
Executes the passed sql-statement
</summary>
<param name="executeStatement">the sql statement</param>
<returns>Returns true if properly executed, else false</returns>
</member>
<member name="M:DigitalData.Modules.Database.Oracle.NewExecuteScalar(System.String)">
<summary>
Executes the passed sql-statement as Scalar
</summary>
<param name="executeStatement">the sql statement</param>
<returns>Returns the scalarvalue</returns>
</member>
<member name="M:DigitalData.Modules.Database.MSSQLServer.EncryptConnectionString(System.String)">
<summary>
Encrypts a connection string password.
</summary>
<param name="ConnectionString">A connection string with a plain-text password</param>
<returns>The connection string with the password encrypted.</returns>
</member>
<member name="M:DigitalData.Modules.Database.MSSQLServer.DecryptConnectionString(System.String)">
<summary>
Decrypts a connection string password.
</summary>
<param name="ConnectionString">A connection string with a encrypted password</param>
<returns>The connection string with the password decrypted.</returns>
</member>
<member name="M:DigitalData.Modules.Database.MSSQLServer.OpenSQLConnection(System.Data.SqlClient.SqlConnection)">
<summary>
This Function intentionally has no try..catch block to have any errors caught outside
</summary>
<param name="Connection"></param>
<returns></returns>
</member>
<member name="M:DigitalData.Modules.Database.MSSQLServer.GetDatatable(System.String,System.Int32)">
<summary>
Returns a datatable for a sql-statement
</summary>
<param name="SqlCommand">sqlcommand for datatable (select XYZ from TableORView)</param>
<returns>Returns a datatable</returns>
</member>
<member name="M:DigitalData.Modules.Database.MSSQLServer.NewExecuteNonQueryAsync(System.String,System.Int32)">
<summary>
Executes the passed sql-statement in asyncmode
</summary>
<param name="SqlCommand">the sql statement</param>
<param name="commandtimeout">Optional Timeout</param>
<remarks></remarks>
</member>
</members>
</doc>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Encryption
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Encryption.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Encryption.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Encryption.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="T:DigitalData.Modules.Encryption.Encryption">
<summary>
https://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,201 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
DigitalData.Modules.Logging
</name>
</assembly>
<members>
<member name="T:DigitalData.Modules.Logging.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:DigitalData.Modules.Logging.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:DigitalData.Modules.Logging.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="T:DigitalData.Modules.Logging.LogConfig">
<module>LogConfig</module>
<version>0.0.1.0</version>
<date>02.10.2018</date>
<summary>
Module that writes file-logs to different locations:
local application data, the current directory or a custom path.
Files and directories will be automatically created.
</summary>
<dependencies>
NLog, >= 4.5.8
</dependencies>
<example>
Imports DigitalData.Modules.Logging
Class FooProgram
Private Logger as Logger
Private LogConfig as LogConfig
Public Sub New()
LogConfig = new LogConfig(args)
Logger = LogConfig.GetLogger()
End Sub
Public Sub Bar()
Logger.Info("Baz")
End Sub
End Class
Class FooLib
Private Logger as NLog.Logger
Public Sub New(LogConfig as LogConfig)
Logger = LogConfig.GetLogger()
End Sub
Public Sub Bar()
Logger.Info("Baz")
End Sub
End Class
</example>
<remarks>
If logpath can not be written to, falls back to temp folder as defined in:
https://docs.microsoft.com/de-de/dotnet/api/system.io.path.gettemppath?view=netframework-4.7.2
If used in a service, LogPath must be set to CustomPath, otherwise the Log will be written to System32!
For NLog Troubleshooting, set the following Environment variables to write the NLog internal Log:
- NLOG_INTERNAL_LOG_LEVEL: Debug
- NLOG_INTERNAL_LOG_FILE: ex. C:\Temp\Nlog_Internal.log
</remarks>
</member>
<member name="P:DigitalData.Modules.Logging.LogConfig.LogFactory">
<summary>
Returns the NLog.LogFactory object that is used to create Loggers
</summary>
<returns>LogFactory object</returns>
</member>
<member name="P:DigitalData.Modules.Logging.LogConfig.LogFile">
<summary>
Returns the path to the current default logfile
</summary>
<returns>Filepath to the logfile</returns>
</member>
<member name="P:DigitalData.Modules.Logging.LogConfig.LogDirectory">
<summary>
Returns the path to the current log directory
</summary>
<returns>Directory path to the log directory</returns>
</member>
<member name="P:DigitalData.Modules.Logging.LogConfig.Debug">
<summary>
Determines if a debug log will be written
</summary>
<returns>True, if debug log will be written. False otherwise.</returns>
</member>
<member name="P:DigitalData.Modules.Logging.LogConfig.Logs">
<summary>
Returns Logs in Memory as List(Of String) if Debug is enabled
Returns an empty list if debug is disabled
</summary>
<returns>A list of log messages</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.#ctor(DigitalData.Modules.Logging.LogOptions)">
<summary>
Initializes a new LogConfig object with the options supplied as a LogOptions object
</summary>
<param name="Options"></param>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.#ctor(DigitalData.Modules.Logging.LogConfig.PathType,System.String,System.String,System.String,System.String,System.Int32)">
<summary>
Initializes a new LogConfig object with a logpath and optinally a filename-suffix.
</summary>
<param name="LogPath">The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath.</param>
<param name="CustomLogPath">If `logPath` is set to custom, this defines the custom logPath.</param>
<param name="Suffix">If set to anything other than Nothing, extends the logfile name with this suffix.</param>
<param name="CompanyName">CompanyName is used to construct log-path in when LogPath is set to PathType:AppData</param>
<param name="ProductName">ProductName is used to construct log-path in when LogPath is set to PathType:AppData</param>
<param name="FileKeepRangeInDays">Amount of days where files are kept and not deleted.</param>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.ClearOldLogfiles(System.Int32)">
<summary>
Clears old LogFiles from the configured logpath for compliance with the GDPR
</summary>
<param name="FileKeepRange">Days in which logfiles should be kept. All files older than `Now - FileKeepInterval` will be deleted.</param>
<returns>True, if files were deleted as expected or no files were deleted. Otherwise false.</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetLogger">
<summary>
Returns the Logger for the calling class
</summary>
<returns>An object of Logging.Logger</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetLogger(System.String)">
<summary>
Returns the Logger for the specified classname
</summary>
<returns>An object of Logging.Logger</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetLoggerFor(System.String)">
<summary>
Returns the Logger for the specified module using event-properties
</summary>
<remarks>
https://github.com/NLog/NLog/wiki/EventProperties-Layout-Renderer
https://stackoverflow.com/questions/31337030/separate-log-file-for-specific-class-instance-using-nlog/32065824#32065824
</remarks>
<returns>An object of Logging.Logger</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetLogger(System.String,System.String)">
<summary>
Returns the Logger for a class specified by `ClassName`
</summary>
<param name="ClassName">The name of the class the logger belongs to</param>
<returns>An object of Logging.Logger</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.ClearLogs">
<summary>
Clears the internal log
</summary>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetClassFullName(System.Boolean,System.Int32)">
<summary>
Gets the fully qualified name of the class invoking the calling method,
including the namespace but Not the assembly.
</summary>
<returns>The fully qualified class name</returns>
<remarks>This method is very resource-intensive!</remarks>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetConfig(System.String,System.String)">
<summary>
Returns the initial log configuration
</summary>
<param name="productName">The chosen productname</param>
<param name="logFileSuffix">The chosen suffix</param>
<returns>A NLog.LoggingConfiguration object</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.AddDefaultRules(NLog.Config.LoggingConfiguration@)">
<summary>
Adds the default rules
</summary>
<param name="config">A NLog.LoggingConfiguration object</param>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.GetCurrentLogFilePath">
<summary>
Returns the full path of the current default log file.
</summary>
<returns>Full path of the current default log file</returns>
</member>
<member name="M:DigitalData.Modules.Logging.LogConfig.ReloadConfig(System.Boolean)">
<summary>
Reconfigures and re-adds all loggers, optionally adding the debug rule.
</summary>
<param name="Debug">Adds the Debug rule if true.</param>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -32,11 +32,13 @@ Public Class clsEmailIMAP
Return False
End If
Logger.Info($"FetchIMAPMessagesS22 - Fetching unseen MessageIds from Inbox: {pInbox}")
Logger.Debug($"FetchIMAPMessagesS22 - Fetching unseen MessageIds from Inbox: {pInbox}")
Dim oMessageIds As IEnumerable(Of UInteger) = oClient.Search(S22.Imap.SearchCondition.Unseen, pInbox)
If oMessageIds.Count > 0 Then
Logger.Info("FetchIMAPMessagesS22 - Found [{0}] messages", oMessageIds.Count)
Logger.Debug("FetchIMAPMessagesS22 - Fetching messages...")
End If
Logger.Info("FetchIMAPMessagesS22 - Found [{0}] messages", oMessageIds.Count)
Logger.Debug("FetchIMAPMessagesS22 - Fetching messages...")
Dim oMessageCountRegular As Integer = 0
Dim oMessageCountWorked As Integer = 0
Dim oLastLog As String
@@ -153,203 +155,7 @@ Public Class clsEmailIMAP
Return False
End Try
End Function
Private Shared Sub OnWriteLog(ByVal sender As Object, ByVal e As WriteLogEventArgs)
Logger.Debug(e.Log)
End Sub
Public Function FetchIMAPMessagesIsoft(Server As String, Port As Integer, Username As String, Password As String, Inbox As String, Optional MoveMailTo As String = "", Optional IsoftLog As String = "", Optional IsTest As Boolean = False, Optional DeleteinTest As Boolean = False)
Try
Logger.Debug(String.Format("Working on IMAP_COLLECT Independentsoft..."))
Dim oClient As New Independentsoft.Email.Imap.ImapClient(Server, Port)
If IsoftLog <> "" And LogConfig.Debug = True Then
Dim iLogger As New Independentsoft.Email.Logger(IsoftLog)
AddHandler iLogger.WriteLog, AddressOf OnWriteLog
oClient.Logger = iLogger
End If
oClient.EnableSsl = True
oClient.ValidateRemoteCertificate = False
Try
oClient.Connect()
Catch ex As Exception
Logger.Warn("Error while oClient.Connec(): " & ex.Message)
Return False
End Try
Try
oClient.Login(Username, Password, AuthenticationType.Login)
Catch ex As Exception
Logger.Warn("Error while loginImap.now trying Ntlm-Auth: " & ex.Message)
Try
oClient.Login(Username, Password, AuthenticationType.Ntlm)
Catch ex1 As Exception
Logger.Error(ex)
Return False
End Try
End Try
Logger.Debug("Logged in...")
oClient.SelectFolder(Inbox)
Dim coSearchCriteria As New SearchCriteria()
coSearchCriteria.All = True
Dim oMessageCountRegular As Integer = 0
Dim oMessageCountWorked As Integer = 0
Dim oUniqueID As Integer() = oClient.Search(coSearchCriteria)
If IsTest = True Then
MsgBox($"{oUniqueID.Count} messages in Postbox! (oUniqueID.Length: {oUniqueID.Length.ToString})")
End If
Dim oFoundMessages As Message() = New Message(oUniqueID.Length - 1) {}
Dim oEnvelopes As Independentsoft.Email.Imap.Envelope() = oClient.ListMessages()
For oCounterEnvelope As Integer = 0 To oEnvelopes.Length - 1
Logger.Debug($"oEnvelopes.Length: {oEnvelopes.Length}")
For oCounterEmailInPostbox As Integer = 0 To oUniqueID.Length - 1
If oEnvelopes(oCounterEnvelope).UniqueID = oUniqueID(oCounterEmailInPostbox) Then
Dim oMimeMessage As Mime.Message = oClient.GetMessage(oEnvelopes(oCounterEnvelope).UniqueID)
If Not IsNothing(oMimeMessage) Then
Dim oMessageID = oMimeMessage.MessageID
oMessageID = oMessageID.Replace(">", "").Replace("<", "")
'oEnvelopes(oCounterEnvelope).UniqueI
Logger.Info($"Isoft: Working on email: MessageID [{oMessageID}] - Subject[{oEnvelopes(oCounterEnvelope).Subject}] - Date [{oEnvelopes(oCounterEnvelope).Date.ToString}]")
Dim oCHECKSQL = $"SELECT * FROM TBEMLP_HISTORY WHERE lower(EMAIL_MSGID) = lower('{oMessageID}')"
Dim oCHECKDT As DataTable = _DB_MSSQL.Return_Datatable(oCHECKSQL)
If Not IsNothing(oCHECKDT) Then
If oCHECKDT.Rows.Count = 0 Then
Logger.Info($"Isoft: Adding email: MessageID [{oMessageID}] - Subject[{oEnvelopes(oCounterEnvelope).Subject}] - Date [{oEnvelopes(oCounterEnvelope).Date.ToString}]")
oMessageCountRegular += 1
CURRENT_WORKMAIL_LIST.Add(oMimeMessage)
Else
Logger.Info($"Isoft: Already existing email with MessageID [{oMessageID}] - Subject[{oEnvelopes(oCounterEnvelope).Subject}] - Date [{oEnvelopes(oCounterEnvelope).Date.ToString}] ")
oMessageCountWorked += 1
Try
oClient.Delete(oEnvelopes(oCounterEnvelope).UniqueID)
Dim oUpd = $"UPDATE TBEMLP_HISTORY SET DATE_DELETED_INBOX = GETDATE(), COMMENT = 'DELETED MESSAGE FROM INBOX (2ndRun ALREADY WORKED)' WHERE lower(EMAIL_MSGID) = lower('{oMessageID}')"
_DB_MSSQL.Execute_non_Query(oUpd)
Catch ex As Exception
Logger.Warn($"Error deleting/Commenting message due to to already worked: {ex.Message}")
End Try
End If
oClient.Store(oEnvelopes(oCounterEnvelope).UniqueID, "+FLAGS", "SEEN")
If MoveMailTo <> String.Empty Then
Try
oClient.AddMessage(MoveMailTo, oMimeMessage)
Catch ex As Exception
Logger.Warn($"Isoft: Could not move message to folder [{MoveMailTo}] - Error: {ex.Message}")
End Try
End If
If oMessageCountRegular = 250 Then
Logger.Warn($"Worked 100 Mails exiting oCounterEmailInPostbox!")
Exit For
End If
End If
End If
End If
Next
Next
oClient.Expunge()
oClient.Disconnect()
If oMessageCountRegular > 0 Or oMessageCountWorked > 0 Then
Logger.Info($"###############################################")
If oMessageCountRegular > 0 Then
Logger.Info($"Isoft: Found [{oMessageCountRegular.ToString}] regular messages to work on!")
End If
If oMessageCountWorked > 0 Then
Logger.Info($"Isoft: Found [{oMessageCountWorked.ToString}] worked messages to work on!")
End If
If IsTest = True Then
Dim omsgtext As String
If oMessageCountRegular > 0 Then
omsgtext = $"Isoft: Found [{oMessageCountRegular.ToString}] regular Messages to work on!"
End If
If oMessageCountWorked > 0 Then
If omsgtext = String.Empty Then
Logger.Info($"Isoft: Found [{oMessageCountWorked.ToString}] worked messages to work on!")
Else
omsgtext += vbNewLine & $"Isoft: Found [{oMessageCountWorked.ToString}] worked messages to work on!"
End If
End If
MsgBox(omsgtext)
End If
Logger.Info($"###############################################")
End If
' Logger.Debug($"{oCount.ToString} messages will be worked..")
Logger.Debug("Isoft: IMAP COLLECT Independentsoft finished!")
Return True
Catch ex As Exception
Logger.Error(ex, "Unexpected Error in IMAP COLLECT Independentsoft:")
Return False
End Try
End Function
Public Function IMAP_Set2Seen(Server As String, Port As Integer, Username As String, Password As String, IsoftLog As String)
Try
Logger.Debug(String.Format("Working on IMAP_Set2Seen Independentsoft..."))
Dim oClient As New Independentsoft.Email.Imap.ImapClient(Server, Port)
If IsoftLog <> "" And LogConfig.Debug = True Then
Dim iLogger As New Independentsoft.Email.Logger(IsoftLog)
AddHandler iLogger.WriteLog, AddressOf OnWriteLog
oClient.Logger = iLogger
End If
oClient.EnableSsl = True
oClient.ValidateRemoteCertificate = False
oClient.Connect()
Try
oClient.Login(Username, Password, AuthenticationType.Login)
Catch ex As Exception
Logger.Warn("Error while loginImap.now trying Ntlm-Auth: " & ex.Message)
Try
oClient.Login(Username, Password, AuthenticationType.Ntlm)
Catch ex1 As Exception
Logger.Error(ex)
Return False
End Try
End Try
Logger.Debug("Logged in...")
oClient.SelectFolder("Inbox")
Dim coSearchCriteria As New SearchCriteria()
coSearchCriteria.Unseen = True
Dim oUniqueID As Integer() = oClient.Search(coSearchCriteria)
Dim oFoundMessages As Message() = New Message(oUniqueID.Length - 1) {}
For i As Integer = 0 To oUniqueID.Length - 1
oFoundMessages(i) = oClient.GetMessage(oUniqueID(i))
If oFoundMessages(i).Subject.ToLower.Contains("seen") Then
Logger.Debug($"Working on unseen email: [{oUniqueID(i)}] Subject:{oFoundMessages(i).Subject} - Date {oFoundMessages(i).Date}")
Dim oEnvelopes1 As Independentsoft.Email.Imap.Envelope() = oClient.ListMessages()
For i1 As Integer = 0 To oEnvelopes1.Length - 1
If oEnvelopes1(i1).UniqueID = oUniqueID(i) Then
Logger.Debug($"Setting email to Unseen!")
oClient.Store(oEnvelopes1(i1).UniqueID, "+FLAGS", "SEEN")
MsgBox("Set to SEEN")
End If
Next
End If
Next
oClient.Expunge()
MsgBox("Expunge done")
oClient.Disconnect()
Logger.Debug("IMAP_Set2Seen finished!")
Return True
Catch ex As Exception
Logger.Error(ex, "Unexpected Error in IMAP_Set2Seen Independentsoft:")
Return False
End Try
End Function
''' <summary>
''' Uses a private API from MailWriter to write a MailMessage to disk.

View File

@@ -1,327 +0,0 @@
Imports Independentsoft.Email
Imports Independentsoft.Email.Pop3
Imports Independentsoft.Email.Smtp
Imports Independentsoft.Email.Mime
Imports Independentsoft.Email.Imap
Imports DigitalData.EMLProfiler.ClassCurrent
Imports DigitalData.Modules.Logging
Imports System.Net
Public Class clsEmail
Private Shared Logger As DigitalData.Modules.Logging.Logger
Public Shared EMAIL_INBOX_LIST As New ArrayList()
Sub New(LogConf As LogConfig)
Logger = LogConf.GetLogger
End Sub
Private Shared Sub OnWriteLog(ByVal sender As Object, ByVal e As WriteLogEventArgs)
Logger.Info(e.Log)
End Sub
Public Function POP3_COLLECT() As Boolean
Try
Logger.Debug(String.Format("Working on POP3_COLLECT....."))
Dim oClient As New Pop3Client(MAIL_SERVER, MAIL_PORT)
oClient.ValidateRemoteCertificate = False
oClient.Connect()
Logger.Debug(String.Format("..connected!"))
oClient.Login(MAIL_USER, MAIL_USER_PW)
Dim oMessageInfo As MessageInfo() = oClient.List()
Dim oCOUNT As Integer = 0
For i As Integer = 0 To oMessageInfo.Length - 1
Dim oMessage As Message = oClient.GetMessage(oMessageInfo(i).Index)
Dim oMsgId_AlreadyExists As Boolean = False
For Each pulled_msg As Message In CURRENT_WORKMAIL_LIST
If pulled_msg.MessageID = oMessage.MessageID Then
oMsgId_AlreadyExists = True
End If
Next
If oMsgId_AlreadyExists = False Then
oCOUNT += 1
CURRENT_WORKMAIL_LIST.Add(oMessage)
Logger.Debug(String.Format("Message [{0}] added to working Mail_List", oMessage.Subject))
End If
'client.Delete(messageInfo(i).Index)
Next
Logger.Debug($"{oCOUNT.ToString} messages will be worked..")
oClient.Disconnect()
Logger.Debug(String.Format("POP3_COLLECT finished!"))
Return True
Catch ex As Exception
Logger.Error(ex)
' clsLogger.Add("Unexpected Error in POP3_COLLECT: " & ex.Message)
EventLog.WriteEntry("DD EmailProfiler", "Unexpected Error in POP3_COLLECT: " & ex.Message(), EventLogEntryType.Error)
Return False
End Try
End Function
Public Function TEST_POP3_COLLECT(MYMAIL_SERVER As String, MYMAIL_PORT As Integer, MYMAIL_USER As String, MYMAIL_USER_PW As String) As Boolean
Try
Logger.Debug(String.Format("Working on TEST_POP3_COLLECT..."))
Dim oPop3Client As New Pop3Client(MYMAIL_SERVER, MYMAIL_PORT)
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)
' oPop3Client.ValidateRemoteCertificate = False
oPop3Client.Logger = oindependentLogger
oPop3Client.Connect()
Logger.Debug(String.Format("..connected!"))
oPop3Client.Login(MYMAIL_USER, MYMAIL_USER_PW)
Dim messageInfo As MessageInfo() = oPop3Client.List()
For i As Integer = 0 To messageInfo.Length - 1
Dim message As Message = oPop3Client.GetMessage(messageInfo(i).Index)
MsgBox($"Message-subject: {message.Subject}, Message unique ID = {messageInfo(i).UniqueID} added", )
Next
oPop3Client.Disconnect()
MsgBox(String.Format("TEST_POP3_COLLECT finished!"))
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function DELETE_EMAIL(msgid As String, Optional CheckDeletedRun As Boolean = False)
Try
If CURRENT_POLL_TYPE = "POP" Then
Dim client As New Pop3Client(MAIL_SERVER, MAIL_PORT)
client.ValidateRemoteCertificate = False
client.Connect()
client.Login(MAIL_USER, MAIL_USER_PW)
Dim messageInfo As MessageInfo() = client.List()
For i As Integer = 0 To messageInfo.Length - 1
Dim message As Message = client.GetMessage(messageInfo(i).Index)
If message.MessageID = msgid Then
client.Delete(messageInfo(i).Index)
Logger.Info(String.Format("Message [{0}] was deleted!", message.Subject))
Exit For
End If
Next
client.Disconnect()
Return True
ElseIf CURRENT_POLL_TYPE = "IMAP" Then
If CheckDeletedRun = True Then
Try
Logger.Debug(String.Format("Working on S22 Delete..."))
Using oClient As New S22.Imap.ImapClient(MAIL_SERVER, MAIL_PORT, MAIL_USER, MAIL_USER_PW, S22.Imap.AuthMethod.Login, True)
Dim oMessageIds As IEnumerable(Of UInteger) = oClient.Search(S22.Imap.SearchCondition.Unseen, MAIL_INBOX_NAME)
For Each oMessageId As UInteger In oMessageIds
If oMessageId = msgid Then
Logger.Debug($"Message shall be deleted...")
oClient.DeleteMessage(oMessageId)
Logger.Debug($"Message has been deleted!")
End If
Next
oClient.Expunge() 'delete messages marked as deleted
End Using
Catch ex As Exception
Logger.Warn("Error while deleting s22Mail: " & ex.Message)
Return False
End Try
Else
Try
Logger.Debug(String.Format("Working on IMAP Delete..."))
Dim oIMAPClient As New ImapClient(MAIL_SERVER, MAIL_PORT)
oIMAPClient.EnableSsl = True
oIMAPClient.ValidateRemoteCertificate = False
oIMAPClient.Connect()
Try
oIMAPClient.Login(MAIL_USER, MAIL_USER_PW, AuthenticationType.Login)
Catch ex As Exception
Logger.Warn("Error while loginImap.now trying Ntlm-Auth: " & ex.Message)
Try
oIMAPClient.Login(MAIL_USER, MAIL_USER_PW, AuthenticationType.Ntlm)
Catch ex1 As Exception
Logger.Error(ex)
Return False
End Try
End Try
Logger.Debug("Logged in for delete...")
oIMAPClient.SelectFolder(MAIL_INBOX_NAME)
Dim oEnvelopes As Envelope() = oIMAPClient.ListMessages()
For i As Integer = 0 To oEnvelopes.Length - 1
If oEnvelopes(i).MessageID = msgid Then
oIMAPClient.Delete(oEnvelopes(i).UniqueID) 'mark as deleted
End If
Next
oIMAPClient.Expunge() 'delete messages marked as deleted
Dim oDeleted As Boolean = True
For i As Integer = 0 To oEnvelopes.Length - 1
If oEnvelopes(i).MessageID = msgid Then
Logger.Debug("Message is still existing. Deleting did not work!")
oDeleted = False
End If
Next
oIMAPClient.Disconnect()
If oDeleted = False Then
DELETE_EMAIL(msgid, True)
Else
Return True
End If
Catch ex As Exception
Logger.Warn("Error in IMAP Delete: " & ex.Message)
Return False
End Try
End If
Else
Return False
End If
Catch ex As Exception
Logger.Error(ex)
'clsLogger.Add("Unexpected Error in DELETE_EMAIL: " & ex.Message)
Return False
End Try
End Function
Public Function Email_Send_Independentsoft(ByVal mailSubject As String, ByVal mailBody As String, mailto As String,
mailfrom As String, mailsmtp As String, mailport As Integer, mailUser As String, mailPW As String,
AUTH_TYPE As String, Optional attment As String = "")
Try
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Logger.Debug($"in Email_Send_Independentsoft..")
Dim empfaenger As String()
If mailto.Contains(";") Then
empfaenger = mailto.Split(";")
Else
ReDim Preserve empfaenger(0)
empfaenger(0) = mailto
End If
Dim _error As Boolean = False
'Für jeden Empfänger eine Neue Mail erzeugen
For Each _mailempfaenger As String In empfaenger
Logger.Debug($"Working on email for {_mailempfaenger}..")
Try
Dim message As New Message()
message.From = New Mailbox(mailfrom, mailfrom)
message.[To].Add(New Mailbox(_mailempfaenger))
message.Subject = mailSubject
Logger.Debug($"Message created..")
Dim textBodyPart As New BodyPart()
textBodyPart.ContentType = New ContentType("text", "html", "utf-8")
textBodyPart.ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable
textBodyPart.Body = mailBody
message.BodyParts.Add(textBodyPart)
If attment <> String.Empty Then
If System.IO.File.Exists(attment) Then
Dim attachment1 As New Attachment(attment)
If attment.ToLower.EndsWith("pdf") Then
attachment1.ContentType = New ContentType("application", "pdf")
ElseIf attment.ToLower.EndsWith("jpg") Then
attachment1.ContentType = New ContentType("application", "jpg")
ElseIf attment.ToLower.EndsWith("docx") Then
attachment1.ContentType = New ContentType("application", "MS-word")
End If
message.BodyParts.Add(attachment1)
Else
Logger.Warn($"Attachment {attment.ToString} is not existing!")
End If
End If
Dim client As SmtpClient
Try
client = New SmtpClient(mailsmtp, mailport)
Catch ex As Exception
Logger.Warn("clsEmail.Create Client: " & ex.Message)
_error = True
Continue For
End Try
Try
client.Connect()
Catch ex As Exception
Logger.Warn("clsEmail.Client.Connect1: " & ex.Message)
Logger.Debug("Error in ClientConnect - but still trying to send")
_error = True
' Continue For
End Try
Logger.Debug("Connected to Client!")
If AUTH_TYPE = "SSL" Then
client.EnableSsl = True
'client.ValidateRemoteCertificate = True
Logger.Debug("Authentification via SSL.")
ElseIf AUTH_TYPE = "TLS" Then
' client.ValidateRemoteCertificate = False
client.StartTls()
client.EnableSsl = False
Logger.Debug("Authentification via TLS. SSL disabled")
Else
client.EnableSsl = False
Logger.Debug("Authentification NONE. SSL disabled")
End If
Try
client.Connect()
Catch ex As Exception
Logger.Warn("clsEmail.Client.Connect: " & ex.Message)
_error = True
' Continue For
End Try
Try
If mailsmtp.Contains("office365.com") Then
client.Login(mailUser, mailPW, AuthenticationType.None)
Else
client.Login(mailUser, mailPW)
End If
Logger.Debug("Logged in!")
Catch ex As Exception
Try
If mailsmtp.Contains("office365.com") Then
client.Login(mailUser, mailPW, AuthenticationType.Login)
Else
client.Login(mailUser, mailPW, AuthenticationType.Anonymous)
End If
Catch ex1 As Exception
Try
client.Login(mailUser, mailPW, AuthenticationType.Login)
Catch ex2 As Exception
Logger.Warn("clsEmail.Client.Login: " & ex.Message)
_error = True
client.Disconnect()
Continue For
End Try
End Try
End Try
Try
client.Send(message)
Logger.Info("Message to " & _mailempfaenger & " has been send.")
_error = False
Catch ex As Exception
Logger.Warn("clsEmail.Client.Send: " & ex.Message)
_error = True
client.Disconnect()
Continue For
End Try
client.Disconnect()
Catch ex As Exception
Logger.Error(ex)
_error = True
End Try
Next
If _error = True Then
Return False
Else
Return True
End If
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
End Class

View File

@@ -1,28 +1,33 @@
Imports Independentsoft.Email.Mime
Imports System.Text.RegularExpressions
Imports System.Text.RegularExpressions
Imports WINDREAMLib
Imports DigitalData.EMLProfiler.ClassCurrent
Imports System.IO
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Database
Imports System.Threading
Imports Limilabs.Mail
Imports Limilabs.Mail.MIME
Imports Limilabs.Mail.Headers
Imports MailBox = Limilabs.Mail.Headers.MailBox
Imports DigitalData.Modules.Messaging
Public Class clsWorkEmail
Private Shared Logger As Logger
Private MyLogger As LogConfig
Private _email As clsEmail
Private _limilab As DigitalData.Modules.Messaging.Limilab
Private _DB_MSSQL As clsDatabase
Private _USE_WM As Boolean
Private _windream As clsWindream_allgemein
Private _windream_index As clsWindream_Index
Private _firebird As Firebird
Private _worked_email As Boolean = False
Sub New(LogConf As LogConfig, ConStr As String, FB_DATASOURCE As String, FB_DATABASE As String, FB_USER As String, FB_PW As String, USE_WM As Boolean)
Private _EmailAccountID As Integer = 1
Sub New(LogConf As LogConfig, ConStr As String, FB_DATASOURCE As String, FB_DATABASE As String, FB_USER As String, FB_PW As String, USE_WM As Boolean, EmailAccountID As Integer)
Try
Logger = LogConf.GetLogger
MyLogger = LogConf
_email = New clsEmail(LogConf)
Logger.Debug("clsWorkmail _email initialized")
_limilab = New Limilab(LogConf)
Logger.Debug("Limilab initialized")
_DB_MSSQL = New clsDatabase(LogConf, ConStr)
Logger.Debug("clsWorkmail _email initialized")
_USE_WM = USE_WM
@@ -34,28 +39,41 @@ Public Class clsWorkEmail
If FB_DATASOURCE <> String.Empty Then
_firebird = New Firebird(LogConf, FB_DATASOURCE, FB_DATABASE, FB_USER, FB_PW)
End If
_EmailAccountID = EmailAccountID
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Public Function WorkEmailMessage(MyEmailMessage As Message) As Boolean
Public Function WorkEmailMessage(MyEmailMessage As IMail) As Boolean
Try
Logger.Debug($"Working on email from: {MyEmailMessage.From.EmailAddress}...Subject: {MyEmailMessage.Subject}")
For Each m As MailBox In MyEmailMessage.From
CURRENT_MAIL_FROM = m.Address
Next
Logger.Debug($"Working on email from: {CURRENT_MAIL_FROM}...Subject: {MyEmailMessage.Subject}")
CURRENT_MAIL_BODY_ALL = ""
CURRENT_MAIL_BODY_ANSWER1 = ""
CURRENT_MAIL_BODY_Substr2 = ""
CURRENT_MAIL_MESSAGE = MyEmailMessage
CURRENT_MAIL_SUBJECT = MyEmailMessage.Subject.ToUpper
CURRENT_MAIL_MESSAGE_ID = MyEmailMessage.MessageID
If IsNothing(CURRENT_MAIL_MESSAGE_ID) Then
CURRENT_MAIL_MESSAGE_ID = System.Guid.NewGuid.ToString()
Else
If CURRENT_MAIL_MESSAGE_ID.Length = 0 Then
CURRENT_MAIL_MESSAGE_ID = System.Guid.NewGuid.ToString()
End If
End If
CURRENT_MAIL_MESSAGE_ID.Replace(">", "").Replace("<", "")
If IsNothing(CURRENT_MAIL_SUBJECT) Then
CURRENT_MAIL_SUBJECT = ""
Else
Logger.Debug($"Subject: {CURRENT_MAIL_SUBJECT}...")
End If
CURRENT_MAIL_FROM = MyEmailMessage.From.EmailAddress
Logger.Debug($"Working on email from : {CURRENT_MAIL_FROM}...")
Dim oTempMailExists As Boolean = SAVE2TEMP()
'Checking wether Mail can be opened
@@ -77,6 +95,74 @@ Public Class clsWorkEmail
Logger.Info("CommonEmail-Process-Sniffer")
If COMMON_EMAIL_IN() = True Then
INSERT_HISTORY_MSSQL()
If CURRENT_ATTMT_COUNT = 0 Then
Logger.Info("### Mail contained no Attachments!! ###")
Dim oBody = EmailStrings.EMAIL_NO_FERDS
Dim oMessagId = CURRENT_MAIL_MESSAGE.MessageID.Replace("<", "").Replace(">", "")
AddToEmailQueueMSSQL(oMessagId, oBody, "No Attachments", _EmailAccountID)
End If
Return True
Else
Return False
End If
End If
End If
End If
Catch ex As Exception
Logger.Error(ex)
'clsLogger.Add("Unexpected Error in WORK_MAIL: " & ex.Message & "MESSAGE_ID: " & msg.MessageID)
Return False
End Try
End Function
Public Function WorkEmailMessageLimi(MyEmailMessage As IMail) As Boolean
Try
CURRENT_MAIL_BODY_ALL = ""
CURRENT_MAIL_BODY_ANSWER1 = ""
CURRENT_MAIL_BODY_Substr2 = ""
CURRENT_MAIL_MESSAGE = MyEmailMessage
CURRENT_MAIL_SUBJECT = MyEmailMessage.Subject.ToUpper
For Each m As MailBox In MyEmailMessage.From
CURRENT_MAIL_FROM = m.Address
Next
Logger.Debug($"Working on email from: {MyEmailMessage.From.ToString}...Subject: {MyEmailMessage.Subject}")
If IsNothing(CURRENT_MAIL_SUBJECT) Then
CURRENT_MAIL_SUBJECT = ""
Else
Logger.Debug($"Subject: {CURRENT_MAIL_SUBJECT}...")
End If
Logger.Debug($"Working on email from : {CURRENT_MAIL_FROM}...")
Dim oTempMailExists As Boolean = SAVE2TEMP()
'Checking wether Mail can be opened
Dim oTempMailAccessible As Boolean = False
If oTempMailExists = True Then
Try
Dim oFS As FileStream = File.OpenRead(CURRENT_TEMP_MAIL_PATH)
oTempMailAccessible = True
Catch ex As Exception
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 MyEmailMessage.Subject.Contains("[ADDI]") Then
Else
Logger.Info("CommonEmail-Process-Sniffer")
If COMMON_EMAIL_IN() = True Then
INSERT_HISTORY_MSSQL()
If CURRENT_ATTMT_COUNT = 0 Then
Logger.Info("### Mail contained no Attachments!! ###")
Dim oBody = EmailStrings.EMAIL_NO_FERDS
Dim oMessagId = CURRENT_MAIL_MESSAGE.MessageID.Replace("<", "").Replace(">", "")
AddToEmailQueueMSSQL(oMessagId, oBody, "No Attachments", _EmailAccountID)
End If
Return True
Else
Return False
@@ -95,6 +181,68 @@ Public Class clsWorkEmail
Return False
End Try
End Function
Public Sub AddToEmailQueueMSSQL(MessageId As String, BodyText As String, SourceProcedure As String, pEmailAccountId As Integer)
Try
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = $"{My.Settings.PraefixSubject} - {EmailStrings.EMAIL_SUBJECT_REJECTED}"
Dim oCreatedWho = "DDEmailProfiler"
Dim oMaskedBodyText = BodyText.Replace("'", "''")
Dim oSubjectBodyText = String.Format(EmailStrings.EMAIL_SUBJECT_TEXT, CURRENT_MAIL_SUBJECT).Replace("'", "''")
Dim oCompleteBodyText = oMaskedBodyText & oSubjectBodyText
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, oCompleteBodyText)
Dim oEmailAddress = CURRENT_MAIL_FROM
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
Logger.Warn("Could not find email-address for MessageId {0}", MessageId)
oEmailTo = String.Empty
Else
oEmailTo = oEmailAddress
End If
Logger.Debug("Trying to generate Email:")
Logger.Debug("To: {0}", oEmailTo)
Logger.Debug("Subject: {0}", oSubject)
Logger.Debug("Body {0}", oFinalBodyText)
Dim osql = $"Select MAX(GUID) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Dim oHistoryID = _DB_MSSQL.Execute_Scalar(osql)
If IsNumeric(oHistoryID) Then
Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] (
[REMINDER_TYPE_ID]
,[SENDING_PROFILE]
,[REFERENCE_ID]
,[REFERENCE_STRING]
,[WF_ID]
,[EMAIL_ADRESS]
,[EMAIL_SUBJ]
,[EMAIL_BODY]
,[COMMENT]
,[ADDED_WHO])
VALUES
(77
,{pEmailAccountId}
,{oHistoryID}
,'{MessageId}'
,77
,'{oEmailTo}'
,'{oSubject}'
,'{oFinalBodyText}'
,'{SourceProcedure}'
,'{oCreatedWho}')"
_DB_MSSQL.Execute_non_Query(oInsert)
Else
Logger.Warn($"!! Could not get oHistoryID in AddToEmailQueueMSSQL [{osql}]")
End If
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Private Function PROCESS_MANAGER_IN() As Boolean
Try
Dim oDel_email As Boolean = False
@@ -191,6 +339,7 @@ Public Class clsWorkEmail
If EXTRACT_ATTACHMENTS(oDataRow("PATH_EMAIL_TEMP"), oDataRow("PATH_EMAIL_ERRORS")) = True Then
Return True
Else
Logger.Warn("!##Returning false from EXTRACT_ATTACHMENTS!##")
Return False
End If
Else
@@ -230,16 +379,16 @@ Public Class clsWorkEmail
Next oFileName
Dim oResult As Boolean = False
Dim oTempFilename As String = Path.Combine(oTempPath, CURRENT_MAIL_MESSAGE.GetFileName)
Dim oTempFilename As String = Path.Combine(oTempPath, CURRENT_MAIL_MESSAGE.Subject.Replace(" ", "") & ".eml")
Dim oCounter As Integer = 1
If File.Exists(oTempFilename) = True Then
Do While File.Exists(oTempFilename)
oCounter += 1
oTempFilename = Path.Combine(oTempPath, oCounter & "_" & CURRENT_MAIL_MESSAGE.GetFileName)
oTempFilename = Path.Combine(oTempPath, oCounter & "_" & CURRENT_MAIL_MESSAGE.Subject.Replace(" ", "") & ".eml")
Loop
End If
CURRENT_MAIL_MESSAGE.Save(oTempFilename, True)
CURRENT_MAIL_MESSAGE.Save(oTempFilename)
CURRENT_TEMP_MAIL_PATH = oTempFilename
Logger.Debug($"Email saved to Temppath {CURRENT_TEMP_MAIL_PATH}")
oCounter = 0
@@ -280,7 +429,7 @@ Public Class clsWorkEmail
If messageid = True Then
oTempFilename &= "\" & CURRENT_MAIL_MESSAGE.MessageID & ".eml"
Else
oTempFilename &= "\" & CURRENT_MAIL_MESSAGE.GetFileName
oTempFilename &= "\" & CURRENT_MAIL_MESSAGE.Subject.Replace(" ", "") & ".eml"
End If
Dim cleanPath As String = String.Join("", oTempFilename.Split(Path.GetInvalidPathChars()))
@@ -292,7 +441,7 @@ Public Class clsWorkEmail
Return False
End Try
CURRENT_MAIL_MESSAGE.Save(cleanPath, True)
CURRENT_MAIL_MESSAGE.Save(cleanPath)
Dim oFileInfo As New FileInfo(cleanPath)
Dim oFileLenth As Long = oFileInfo.Length
If oFileLenth > 0 Then
@@ -326,39 +475,42 @@ Public Class clsWorkEmail
Dim oDTFunctionRegex As DataTable = _DB_MSSQL.Return_Datatable("SELECT * FROM TBDD_FUNCTION_REGEX WHERE UPPER(FUNCTION_NAME) IN (UPPER('EMAIL_PROFILER - RemoveHTMLText'),UPPER('EMAIL_PROFILER - RemoveHTMLText1'))")
Dim oMsg_email As New Independentsoft.Email.Mime.Message(CURRENT_TEMP_MAIL_PATH)
'Dim oMsg_email As New Independentsoft.Email.Mime.Message(CURRENT_TEMP_MAIL_PATH)
Dim oBodyText As String = ""
If IsNothing(oMsg_email.Body) Then
Dim oAllBodyParts As New BodyPartCollection()
oAllBodyParts.Add(oMsg_email.BodyParts)
oAllBodyParts.Add(GetChildren(oMsg_email.BodyParts))
For Each bodyPart As BodyPart In oAllBodyParts
If bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "plain" Then
If oBodyText = String.Empty Then
Logger.Debug(String.Format("BODY1-Text is....#{0}", bodyPart.Body))
oBodyText = bodyPart.Body
Else
Continue For
End If
ElseIf bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "html" Then
If oBodyText = String.Empty Then
oBodyText = bodyPart.Body
Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
Else
Continue For
End If
Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
End If
Next
If oBodyText = "" Then
Else
CURRENT_MAIL_BODY_ALL = oBodyText
End If
Else
CURRENT_MAIL_BODY_ALL = oMsg_email.Body
If Not IsNothing(CURRENT_MAIL_MESSAGE.Text) Then
CURRENT_MAIL_BODY_ALL = oBodyText
End If
'If IsNothing(oMsg_email.Body) Then
' Dim oAllBodyParts As New BodyPartCollection()
' oAllBodyParts.Add(oMsg_email.BodyParts)
' oAllBodyParts.Add(GetChildren(oMsg_email.BodyParts))
' For Each bodyPart As BodyPart In oAllBodyParts
' If bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "plain" Then
' If oBodyText = String.Empty Then
' Logger.Debug(String.Format("BODY1-Text is....#{0}", bodyPart.Body))
' oBodyText = bodyPart.Body
' Else
' Continue For
' End If
' ElseIf bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "html" Then
' If oBodyText = String.Empty Then
' oBodyText = bodyPart.Body
' Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
' Else
' Continue For
' End If
' Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
' End If
' Next
' If oBodyText = "" Then
' Else
' CURRENT_MAIL_BODY_ALL = oBodyText
' End If
'Else
' CURRENT_MAIL_BODY_ALL = oMsg_email.Body
'End If
@@ -495,17 +647,19 @@ Public Class clsWorkEmail
PATH_TEMP = pathemailtemp
PATH_ERROR = pathemail_errors
Logger.Debug(String.Format("PATH_TEMP[{0}]", PATH_TEMP))
Dim oAttachmentCount As Integer
oAttachmentCount = 0
Try
If CURRENT_TEMP_MAIL_PATH <> Nothing Then
If File.Exists(CURRENT_TEMP_MAIL_PATH) Then
Dim oCurrentMail As New Independentsoft.Email.Mime.Message(CURRENT_TEMP_MAIL_PATH)
Dim oMSGID = oCurrentMail.MessageID
If IsNothing(oMSGID) Then
oMSGID = System.Guid.NewGuid.ToString()
End If
oMSGID = oMSGID.Replace(">", "").Replace("<", "")
For Each oAttachment As Attachment In oCurrentMail.GetAttachments
Dim oATTFilename = oAttachment.GetFileName.ToString.ToLower
' Dim oCurrentMail As New Independentsoft.Email.Mime.Message(CURRENT_TEMP_MAIL_PATH)
For Each mime As MimeData In CURRENT_MAIL_MESSAGE.Attachments
mime.Save(mime.SafeFileName)
Next
For Each mime As MimeData In CURRENT_MAIL_MESSAGE.Attachments
' For Each oAttachment As Attachment In oCurrentMail.GetAttachments
Dim oATTFilename = mime.SafeFileName 'oAttachment.GetFileName.ToString.ToLower
Dim oValidExt As Boolean = False
If oATTFilename.EndsWith("pdf") Then
oValidExt = True
@@ -527,28 +681,29 @@ Public Class clsWorkEmail
Continue For
End If
Dim oAttachmentFileString
Logger.Info(String.Format(" Working on Attachment [{0}]", oAttachment.GetFileName))
Logger.Info(String.Format(" Working on Attachment [{0}]", mime.SafeFileName)) 'oAttachment.GetFileName))
Try
Dim oFilename = oAttachment.GetFileName
Dim oFilename = mime.SafeFileName 'oAttachment.GetFileName
oFilename = CleanInput(oFilename)
Logger.Debug($"oFilename [{oFilename}]")
If oFilename = String.Empty Then
oFilename = oAttachment.GetFileName
oFilename = mime.SafeFileName 'oAttachment.GetFileName
End If
oAttachmentFileString = Path.Combine(PATH_TEMP, $"{oMSGID}~{oFilename}")
oAttachmentFileString = Path.Combine(PATH_TEMP, $"{CURRENT_MAIL_MESSAGE_ID}~{oFilename}")
Logger.Debug($"oAttachmentFileString [{oAttachmentFileString}]")
If System.IO.File.Exists(oAttachmentFileString) = False Then
Logger.Debug(String.Format("Trying to save attachment [{0}]", oAttachmentFileString))
Try
oAttachment.Save(oAttachmentFileString)
mime.Save(oAttachmentFileString)
'oAttachment.Save(oAttachmentFileString)
Dim oFileInfo As New FileInfo(oAttachmentFileString)
Dim oFileLenth As Long = oFileInfo.Length
If oFileLenth > 0 Then
Logger.Info(String.Format("Attachment saved to [{0}]", oAttachmentFileString))
INSERT_HISTORY_FB(oMSGID, oAttachment.GetFileName)
INSERT_HISTORY_ATTMT_MSSQL(oMSGID, oAttachment.GetFileName)
INSERT_HISTORY_FB(CURRENT_MAIL_MESSAGE_ID, mime.SafeFileName)
INSERT_HISTORY_ATTMT_MSSQL(CURRENT_MAIL_MESSAGE_ID, mime.SafeFileName)
oAttachmentCount += 1
Else
Logger.Warn($"##!! oFileLenth for AttachmentObjects is 0 !!##")
Try
@@ -557,21 +712,22 @@ Public Class clsWorkEmail
Logger.Error(ex)
End Try
MessageError = True
Return False
End If
Catch ex As Exception
Logger.Warn($"Error while saving attachment-name: {ex.Message} - AttachmentName: {oAttachmentFileString}")
MessageError = True
End Try
Else
Logger.Info("EXATTMNT - Attachment (" & oAttachmentFileString & ") already existing!", False, "EXTRACT_ATTACHMENTS")
oAttachmentCount += 1
End If
Catch ex As Exception
Logger.Warn($"Error while creating and saving attachment-name: {ex.Message} - AttachmentName: {oAttachmentFileString}")
MessageError = True
Return False
End Try
Next
Else
@@ -580,7 +736,12 @@ Public Class clsWorkEmail
Else
Logger.Warn($"EXTRACT_ATTACHMENTSIf cause 1: CURRENT_TEMP_MAIL_PATH is NOTHING")
End If
CURRENT_ATTMT_COUNT = oAttachmentCount
If MessageError = True Then
Return False
Else
Return True
End If
Catch ex As Exception
Logger.Error(ex)
'clsLogger.Add("Unexpected Error in COPY2HDD: " & ex.Message & "MESSAGE_ID: " & CURRENT_MAIL_MESSAGE.MessageID, True)
@@ -616,7 +777,7 @@ Public Class clsWorkEmail
Dim ins = $"INSERT INTO TBEMLP_HISTORY (WORK_PROCESS,EMAIL_MSGID,EMAIL_SUBJECT,EMAIL_DATE,EMAIL_BODY,EMAIL_SUBSTRING1,EMAIL_SUBSTRING2,EMAIL_FROM,PROFILE_ID) VALUES " &
$"('{CURRENT_MAIL_PROCESS_NAME}'," &
$"'{CURRENT_MAIL_MESSAGE.MessageID.Replace("<", "").Replace(">", "")}'," &
$"'{CURRENT_MAIL_MESSAGE.Subject}'," &
$"'{CURRENT_MAIL_SUBJECT}'," &
$"'{CURRENT_MAIL_MESSAGE.Date}'," &
$"'{CURRENT_MAIL_BODY_ALL}'," &
$"'{CURRENT_MAIL_BODY_ANSWER1}'," &
@@ -639,8 +800,8 @@ Public Class clsWorkEmail
Dim ins = $"INSERT INTO TBEDM_EMAIL_PROFILER_HISTORY (WORK_PROCESS,EMAIL_MSGID,EMAIL_FROM,EMAIL_SUBJECT,EMAIL_DATETIME,EMAIL_BODY,EMAIL_SUBSTRING1,EMAIL_SUBSTRING2,EMAIL_ATTMT1) VALUES " &
$"('{CURRENT_MAIL_PROCESS_NAME}'," &
$"'{oGUID}'," &
$"'{CURRENT_MAIL_MESSAGE.From.EmailAddress}'," &
$"'{CURRENT_MAIL_MESSAGE.Subject}'," &
$"'{CURRENT_MAIL_FROM}'," &
$"'{CURRENT_MAIL_SUBJECT}'," &
$"'{CURRENT_MAIL_MESSAGE.Date}'," &
$"'{CURRENT_MAIL_BODY_ALL}'," &
$"'{CURRENT_MAIL_BODY_ANSWER1}'," &
@@ -664,7 +825,7 @@ Public Class clsWorkEmail
Dim ins = $"INSERT INTO TBEMLP_HISTORY_ATTACHMENT (WORK_PROCESS,EMAIL_MSGID,EMAIL_FROM,EMAIL_SUBJECT,EMAIL_DATETIME,EMAIL_BODY,EMAIL_ATTMT) VALUES " &
$"('{CURRENT_MAIL_PROCESS_NAME}'," &
$"'{oMSGID}'," &
$"'{CURRENT_MAIL_MESSAGE.From.EmailAddress}'," &
$"'{CURRENT_MAIL_FROM}'," &
$"'{CURRENT_MAIL_MESSAGE.Subject}'," &
$"'{CURRENT_MAIL_MESSAGE.Date}'," &
$"'{CURRENT_MAIL_BODY_ALL}'," &
@@ -676,20 +837,20 @@ Public Class clsWorkEmail
End Try
End Function
Private Function GetChildren(ByVal bodyParts As BodyPartCollection) As BodyPartCollection
'Private Function GetChildren(ByVal bodyParts As BodyPartCollection) As BodyPartCollection
Dim children As New BodyPartCollection()
' Dim children As New BodyPartCollection()
For i As Integer = 0 To bodyParts.Count - 1
children.Add(GetChildren(bodyParts(i).BodyParts))
children.Add(bodyParts(i))
Next
' For i As Integer = 0 To bodyParts.Count - 1
' children.Add(GetChildren(bodyParts(i).BodyParts))
' children.Add(bodyParts(i))
' Next
Return children
End Function
' Return children
'End Function
Private Function EMAIL_DELETE(del As Boolean)
If del = True And MessageError = False Then
_email.DELETE_EMAIL(CURRENT_MAIL_MESSAGE.MessageID)
_limilab.DeleteMessageByUID(CURRENT_MAIL_MESSAGE_ID)
Else
If MessageError = True Then
Logger.Warn($"Did not delete Message [{CURRENT_MAIL_MESSAGE.MessageID}] as there was an MessageError!")

View File

@@ -1,10 +1,14 @@
Imports DigitalData.EMLProfiler.ClassCurrent
Imports Independentsoft.Email.Mime
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Messaging
Imports Limilabs.Mail
Imports Limilabs.Mail.MIME
Imports Limilabs.Mail.Headers
Public Class clsWorker
Private Shared Logger As Logger
Private MyLogger As LogConfig
Private _email As clsEmail
'Private _email As clsEmail
Private _emailIMAP As clsEmailIMAP
Private _Database As clsDatabase
Private _USE_WM As Boolean = False
@@ -13,10 +17,12 @@ Public Class clsWorker
Private _workmail As clsWorkEmail
Private _wrapper As clsEncryption
Private _POLL_PROFILEID As Integer = 0
Private _limilab As DigitalData.Modules.Messaging.Limilab
Dim cs As String
Sub New(LogConf As LogConfig, ConStr As String, POLL_PROFILEID As Integer, FB_DATASOURCE As String, FB_DATABASE As String, FB_USER As String, FB_PW As String, USE_WM As Boolean, Optional plocaleml As String = "")
Sub New(LogConf As LogConfig, ConStr As String, POLL_PROFILEID As Integer, FB_DATASOURCE As String, FB_DATABASE As String, FB_USER As String, FB_PW As String, USE_WM As Boolean, EmailAccountID As Integer, Optional plocaleml As String = "")
Logger = LogConf.GetLogger
_email = New clsEmail(LogConf)
_limilab = New Limilab(LogConf)
' _email = New clsEmail(LogConf)
_emailIMAP = New clsEmailIMAP(LogConf, ConStr)
_Database = New clsDatabase(LogConf, ConStr)
cs = ConStr
@@ -26,7 +32,7 @@ Public Class clsWorker
_windream_index = New clsWindream_Index(LogConf)
End If
_workmail = New clsWorkEmail(LogConf, ConStr, FB_DATASOURCE, FB_DATABASE, FB_USER, FB_PW, USE_WM)
_workmail = New clsWorkEmail(LogConf, ConStr, FB_DATASOURCE, FB_DATABASE, FB_USER, FB_PW, USE_WM, EmailAccountID)
_wrapper = New clsEncryption("!35452didalog=", LogConf)
_POLL_PROFILEID = POLL_PROFILEID
ClassCurrent.CURRENT_DEBUG_LOCAL_EMAIL = plocaleml
@@ -131,12 +137,14 @@ Public Class clsWorker
Dim pollresult As Boolean = False
If LocalEmail = True Then
pollresult = True
Dim oEmail As IMail = New MailBuilder().CreateFromEmlFile(CURRENT_DEBUG_LOCAL_EMAIL)
Dim oMessage As New Message(CURRENT_DEBUG_LOCAL_EMAIL)
CURRENT_WORKMAIL_LIST.Add(oMessage)
CURRENT_WORKMAIL_LIST.Add(oEmail)
Else
Select Case CURRENT_POLL_TYPE
Case "POP"
pollresult = _email.POP3_COLLECT()
'pollresult = _email.POP3_COLLECT()
Case "IMAP"
'pollresult = _emailIMAP.IMAP_COLLECT()
'pollresult = _emailIMAP.FetchIMAPMessagesIsoft(MAIL_SERVER, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_INBOX_NAME, MAIL_ARCHIVE_FOLDER)
@@ -154,7 +162,11 @@ Public Class clsWorker
If CURRENT_WORKMAIL_LIST.Count() > 0 Then
Logger.Info(String.Format("Worked/Pulled: [{0}] E-Mails", CURRENT_WORKMAIL_LIST.Count()))
Try
For Each pulled_msg As Message In CURRENT_WORKMAIL_LIST
'For Each pulled_msg As Message In CURRENT_WORKMAIL_LIST
' _workmail.WorkEmailMessage(pulled_msg)
' CURRENT_MAIL_MESSAGE = Nothing
'Next
For Each pulled_msg As IMail In CURRENT_WORKMAIL_LIST
_workmail.WorkEmailMessage(pulled_msg)
CURRENT_MAIL_MESSAGE = Nothing
Next

View File

@@ -1 +1 @@
136cdd51591ed50b1b450959685bd8fafa36f167
24d36d8793b73fae098b106b4d1e325ae023f116

View File

@@ -1,3 +1,27 @@
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.EMLProfiler.dll.config
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.EMLProfiler.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.EMLProfiler.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.EMLProfiler.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\AE.Net.Mail.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Database.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Logging.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\Independentsoft.Email.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\Interop.WINDREAMLib.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\NLog.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\S22.Imap.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\FirebirdSql.Data.FirebirdClient.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\Oracle.ManagedDataAccess.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Encryption.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\AE.Net.Mail.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Database.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Database.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Database.dll.config
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Logging.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Logging.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\Independentsoft.Email.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\S22.Imap.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Encryption.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Release\DigitalData.Modules.Encryption.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.EMLProfiler.dll.config
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.EMLProfiler.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.EMLProfiler.pdb
@@ -5,23 +29,38 @@ E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\AE.Net.Mail.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Database.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Logging.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Email.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Messaging.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Msg.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Interop.WINDREAMLib.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Mail.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\NLog.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\S22.Imap.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\FirebirdSql.Data.FirebirdClient.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Oracle.ManagedDataAccess.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Encryption.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Email.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Filesystem.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Language.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\protobuf-net.dll
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\AE.Net.Mail.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Database.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Database.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Database.dll.config
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Logging.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Logging.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Email.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Messaging.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Messaging.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Msg.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\DigitalData.Modules.Encryption.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Encryption.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\Independentsoft.Email.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Filesystem.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Filesystem.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Language.pdb
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\DigitalData.Modules.Language.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\bin\Debug\protobuf-net.xml
E:\SchreiberM\Visual Studio\GIT\DD_EmailProfiler\App\DigitalData.EMLProfiler\obj\Debug\DigitalData.EMLProfiler.vbproj.AssemblyReference.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
@@ -29,4 +68,3 @@ 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