diff --git a/AppServer/LocationThread.cs b/AppServer/LocationThread.cs index 2c2d41c..19efcf9 100644 --- a/AppServer/LocationThread.cs +++ b/AppServer/LocationThread.cs @@ -415,7 +415,7 @@ namespace AppServer { if (MainForm.IsBlacklistedAddress(mailAdr)) { - Utils.WriteLine($"sendMailGeo : The email was not sent. Email address '{mailAdr}' is in blacklist "); + Utils.WriteLine($"sendMailGeo : The email '{subj}' was not sent. Email address '{mailAdr}' is in blacklist count = {MainForm.blackListAddress[mailAdr]}"); return; } @@ -442,7 +442,8 @@ namespace AppServer } catch (Exception ex) { - if (ex.ToString().Contains("timed out")) + if (ex.ToString().Contains("timed out") || + ex.ToString().Contains("the client was not authenticated")) MainForm.HandleTimeoutError(mailAdr); Utils.WriteLine($"Exception in sendMailGeo: {ex.ToString()}"); @@ -470,7 +471,7 @@ namespace AppServer if (MainForm.IsBlacklistedAddress(mailAdr)) { - Utils.WriteLine($" sendAlarmMail : The email was not sent. Email address '{mailAdr}' is in blacklist "); + Utils.WriteLine($" sendAlarmMail : The email '{title}' was not sent. Email address '{mailAdr}' is in blacklist count = {MainForm.blackListAddress[mailAdr]}"); return; } @@ -485,7 +486,8 @@ namespace AppServer } catch (Exception ex) { - if (ex.ToString().Contains("timed out")) + if ( ex.ToString().Contains("timed out") || + ex.ToString().Contains("the client was not authenticated")) MainForm.HandleTimeoutError(mailAdr); Utils.WriteLine("Exception in sendMailAlarm2: {0}" + ex.ToString(), ConsoleColor.Red); diff --git a/AppServer/MulticastListener.cs b/AppServer/MulticastListener.cs index 22db15f..d10efc6 100644 --- a/AppServer/MulticastListener.cs +++ b/AppServer/MulticastListener.cs @@ -2387,7 +2387,7 @@ namespace AppServer if (MainForm.IsBlacklistedAddress(mailAdr)) { - Utils.WriteLine($"sendMailGeo : The email was not sent. Email address '{mailAdr}' is in blacklist "); + Utils.WriteLine($"sendMail : The email was not sent. Email address '{mailAdr}' is in blacklist count = {MainForm.blackListAddress[mailAdr]}"); return; } @@ -2409,7 +2409,8 @@ namespace AppServer } catch (Exception ex) { - if (ex.ToString().Contains("timed out")) + if (ex.ToString().Contains("timed out") || + ex.ToString().Contains("the client was not authenticated")) MainForm.HandleTimeoutError(mailAdr); Utils.WriteLine("Exception in sendMail: " + ex.ToString(), ConsoleColor.Red); @@ -2437,7 +2438,7 @@ namespace AppServer if (MainForm.IsBlacklistedAddress(mailAdr)) { - Utils.WriteLine($"sendMailGeo : The email was not sent. Email address '{mailAdr}' is in blacklist "); + Utils.WriteLine($"sendMail_SW : The email was not sent. Email address '{mailAdr}' is in blacklist count = {MainForm.blackListAddress[mailAdr]}"); return; } @@ -2455,7 +2456,8 @@ namespace AppServer } catch (Exception ex) { - if (ex.ToString().Contains("timed out")) + if (ex.ToString().Contains("timed out") || + ex.ToString().Contains("the client was not authenticated")) MainForm.HandleTimeoutError(mailAdr); Utils.WriteLine("Exception in sendMail Sierra Wireless Gateway: " + ex.ToString(), ConsoleColor.Red); diff --git a/SafeMobileLIB_DLL/EmailServerSSL.cs b/SafeMobileLIB_DLL/EmailServerSSL.cs index 7882feb..aa51df2 100644 --- a/SafeMobileLIB_DLL/EmailServerSSL.cs +++ b/SafeMobileLIB_DLL/EmailServerSSL.cs @@ -393,8 +393,17 @@ namespace SafeMobileLib private void ConnectAsync() { - if (popClient != null && popClient.Connected) - popClient.Disconnect(); + try + { + + if (popClient != null && popClient.Connected) + popClient.Disconnect(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + + } popClient = null; popClient = new Pop3Client();