check with uuid
parent
ad9eac6e17
commit
c52fce1b8d
|
@ -176,15 +176,29 @@ namespace OpenSim.Modules.EMail
|
||||||
MimeMessage message = IMAPInbox.GetMessage(i);
|
MimeMessage message = IMAPInbox.GetMessage(i);
|
||||||
foreach (MailboxAddress adress in message.To.Mailboxes)
|
foreach (MailboxAddress adress in message.To.Mailboxes)
|
||||||
{
|
{
|
||||||
m_log.Info("[" + Name + "] Message To: " + adress.Address);
|
try
|
||||||
m_log.Info("[" + Name + "] Objekt ID: " + adress.Address.Split('@')[0]);
|
|
||||||
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(adress.Address.Split('@')[0]);
|
|
||||||
|
|
||||||
if (sceneObject != null)
|
|
||||||
{
|
{
|
||||||
m_messages.Add(message);
|
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();
|
||||||
|
|
||||||
|
if(isUUID(UUIDString))
|
||||||
|
{
|
||||||
|
UUID objID = UUID.Parse(UUIDString);
|
||||||
|
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(objID);
|
||||||
|
|
||||||
|
if (sceneObject != null)
|
||||||
|
{
|
||||||
|
m_messages.Add(message);
|
||||||
|
IMAPInbox.SetFlags(i, MessageFlags.Deleted, true);
|
||||||
|
m_log.Info("[" + Name + "] Get Message for objekt " + sceneObject.Name + " (" + sceneObject.UUID + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(Exception _innerEroor)
|
||||||
|
{
|
||||||
|
m_log.Error("[" + Name + "] " + _innerEroor.Message);
|
||||||
IMAPInbox.SetFlags(i, MessageFlags.Deleted, true);
|
IMAPInbox.SetFlags(i, MessageFlags.Deleted, true);
|
||||||
m_log.Info("[" + Name + "] Get Message for objekt " + sceneObject.Name + " (" + sceneObject.UUID + ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,5 +289,11 @@ namespace OpenSim.Modules.EMail
|
||||||
|
|
||||||
return lslMessage;
|
return lslMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool isUUID(string thing)
|
||||||
|
{
|
||||||
|
UUID test;
|
||||||
|
return UUID.TryParse(thing, out test) ? 1 : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue