add error handling

master
Christopher 2020-06-30 17:37:12 +02:00
parent 5a6179ed6e
commit 649829f307
1 changed files with 56 additions and 47 deletions

View File

@ -70,6 +70,8 @@ namespace OpenSim.Modules.EMail
scene.RegisterModuleInterface<IEmailModule>(this); scene.RegisterModuleInterface<IEmailModule>(this);
m_scene = scene; m_scene = scene;
if(IMAP_SERVER_HOSTNAME != String.Empty)
{
m_timer = new Timer(); m_timer = new Timer();
m_timer.Interval = 1000 * 60; m_timer.Interval = 1000 * 60;
@ -77,6 +79,7 @@ namespace OpenSim.Modules.EMail
m_timer.Enabled = true; m_timer.Enabled = true;
m_timer.Start(); m_timer.Start();
} }
}
public void Close() public void Close()
{ {
@ -128,6 +131,8 @@ namespace OpenSim.Modules.EMail
#endregion #endregion
private void checkForMails(object sender, ElapsedEventArgs e) private void checkForMails(object sender, ElapsedEventArgs e)
{
try
{ {
m_log.Info("[" + Name + "] checkForMails"); m_log.Info("[" + Name + "] checkForMails");
@ -182,6 +187,10 @@ namespace OpenSim.Modules.EMail
IMAPInbox.Expunge(); IMAPInbox.Expunge();
client.Disconnect(true); client.Disconnect(true);
} }
}catch(Exception _error)
{
m_log.Error("[" + Name + "] " + _error.Message);
}
} }
public void SendEmail(UUID objectID, string address, string subject, string body) public void SendEmail(UUID objectID, string address, string subject, string body)