add some debug

master
Christopher 2020-07-01 18:45:41 +02:00
parent 8295c88818
commit d98e706e26
1 changed files with 41 additions and 15 deletions

View File

@ -37,6 +37,8 @@ namespace OpenSim.Modules.EMail
private List<InternalMail> m_messages = new List<InternalMail>();
private bool m_debug = false;
private String SMTP_SERVER_HOSTNAME = null;
private String SMTP_SERVER_LOGIN = null;
private String SMTP_SERVER_PASSWORD = null;
@ -102,6 +104,8 @@ namespace OpenSim.Modules.EMail
if (source.Configs["Mail"] == null)
return;
m_debug = m_config.Configs["Mail"].GetBoolean("DEBUG", m_debug);
SMTP_SERVER_HOSTNAME = m_config.Configs["Mail"].GetString("SMTP_SERVER_HOSTNAME", String.Empty);
SMTP_SERVER_PORT = m_config.Configs["Mail"].GetInt("SMTP_SERVER_PORT", 25);
SMTP_SERVER_SSL = m_config.Configs["Mail"].GetBoolean("SMTP_SERVER_SSL", false);
@ -135,6 +139,7 @@ namespace OpenSim.Modules.EMail
{
try
{
if(m_debug)
m_log.Info("[" + Name + "] checkForMails");
using (var client = new ImapClient())
@ -176,9 +181,13 @@ namespace OpenSim.Modules.EMail
foreach (MailboxAddress adress in message.To.Mailboxes)
{
try
{
if (m_debug)
{
m_log.Info("[" + Name + "] Message To: " + adress.Address);
m_log.Info("[" + Name + "] Objekt ID: " + adress.Address.Split('@')[0]);
}
String UUIDString = adress.Address.Split('@')[0].Trim();
@ -191,6 +200,8 @@ namespace OpenSim.Modules.EMail
{
m_messages.Add(new InternalMail(message, objID));
IMAPInbox.SetFlags(i, MessageFlags.Deleted, true);
if (m_debug)
m_log.Info("[" + Name + "] Get Message for objekt " + sceneObject.Name + " (" + sceneObject.UUID + ")");
}
}
@ -265,10 +276,12 @@ namespace OpenSim.Modules.EMail
return null;
if(messages[0] != null)
{
if(messages[0].Mail != null)
{
Email lslMessage = new Email();
lslMessage.time = messages[0].Mail.Date.ToUnixTimeSeconds().ToString();
lslMessage.time = DateTime.Now.ToShortTimeString();
lslMessage.message = messages[0].Mail.TextBody.ToString();
lslMessage.sender = messages[0].Mail.Sender.GetAddress(true);
lslMessage.subject = messages[0].Mail.Subject;
@ -279,13 +292,26 @@ namespace OpenSim.Modules.EMail
}
else
{
if (m_debug)
m_log.Error("[" + Name + "] Cant find mail data!");
return null;
}
}
else
{
if (m_debug)
m_log.Error("[" + Name + "] Cant find caller objekt!");
return null;
}
}
else
{
if (m_debug)
m_log.Error("[" + Name + "] Cant find caller objekt!");
return null;
}
}