check with uuid
parent
ad9eac6e17
commit
c52fce1b8d
|
@ -175,10 +175,18 @@ namespace OpenSim.Modules.EMail
|
|||
{
|
||||
MimeMessage message = IMAPInbox.GetMessage(i);
|
||||
foreach (MailboxAddress adress in message.To.Mailboxes)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_log.Info("[" + Name + "] Message To: " + adress.Address);
|
||||
m_log.Info("[" + Name + "] Objekt ID: " + adress.Address.Split('@')[0]);
|
||||
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(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)
|
||||
{
|
||||
|
@ -187,6 +195,12 @@ namespace OpenSim.Modules.EMail
|
|||
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.Expunge();
|
||||
|
@ -275,5 +289,11 @@ namespace OpenSim.Modules.EMail
|
|||
|
||||
return lslMessage;
|
||||
}
|
||||
|
||||
public bool isUUID(string thing)
|
||||
{
|
||||
UUID test;
|
||||
return UUID.TryParse(thing, out test) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue