diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 4e7ad75..d59cfa9 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
113 | } | 113 | } |
114 | catch (Exception e) | 114 | catch (Exception e) |
115 | { | 115 | { |
116 | m_log.Error("[EMAIL] DefaultEmailModule not configured: " + e.Message); | 116 | m_log.Error("[EMAIL]: DefaultEmailModule not configured: " + e.Message); |
117 | m_Enabled = false; | 117 | m_Enabled = false; |
118 | return; | 118 | return; |
119 | } | 119 | } |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | 145 | m_log.Info("[EMAIL]: Activated DefaultEmailModule"); |
146 | } | 146 | } |
147 | 147 | ||
148 | public void RemoveRegion(Scene scene) | 148 | public void RemoveRegion(Scene scene) |
@@ -224,8 +224,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
224 | return null; | 224 | return null; |
225 | } | 225 | } |
226 | 226 | ||
227 | private void resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) | 227 | private bool resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) |
228 | { | 228 | { |
229 | ObjectName = ObjectAbsolutePosition = ObjectRegionName = String.Empty; | ||
229 | string m_ObjectRegionName; | 230 | string m_ObjectRegionName; |
230 | int objectLocX; | 231 | int objectLocX; |
231 | int objectLocY; | 232 | int objectLocY; |
@@ -239,15 +240,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
239 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; | 240 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; |
240 | ObjectName = part.Name; | 241 | ObjectName = part.Name; |
241 | ObjectRegionName = m_ObjectRegionName; | 242 | ObjectRegionName = m_ObjectRegionName; |
242 | return; | 243 | return true; |
243 | } | 244 | } |
244 | objectLocX = (int)part.AbsolutePosition.X; | 245 | return false; |
245 | objectLocY = (int)part.AbsolutePosition.Y; | ||
246 | objectLocZ = (int)part.AbsolutePosition.Z; | ||
247 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; | ||
248 | ObjectName = part.Name; | ||
249 | ObjectRegionName = m_ObjectRegionName; | ||
250 | return; | ||
251 | } | 246 | } |
252 | 247 | ||
253 | /// <summary> | 248 | /// <summary> |
@@ -273,12 +268,12 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
273 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); | 268 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); |
274 | if (!isEMailStrictMatch) | 269 | if (!isEMailStrictMatch) |
275 | { | 270 | { |
276 | m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); | 271 | m_log.Error("[EMAIL]: REGEX Problem in EMail Address: "+address); |
277 | return; | 272 | return; |
278 | } | 273 | } |
279 | if ((subject.Length + body.Length) > m_MaxEmailSize) | 274 | if ((subject.Length + body.Length) > m_MaxEmailSize) |
280 | { | 275 | { |
281 | m_log.Error("[EMAIL] subject + body larger than limit of " + m_MaxEmailSize + " bytes"); | 276 | m_log.Error("[EMAIL]: subject + body larger than limit of " + m_MaxEmailSize + " bytes"); |
282 | return; | 277 | return; |
283 | } | 278 | } |
284 | 279 | ||
@@ -286,7 +281,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
286 | string LastObjectPosition = string.Empty; | 281 | string LastObjectPosition = string.Empty; |
287 | string LastObjectRegionName = string.Empty; | 282 | string LastObjectRegionName = string.Empty; |
288 | 283 | ||
289 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 284 | if (!resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName)) |
285 | return; | ||
290 | 286 | ||
291 | if (!address.EndsWith(m_InterObjectHostname)) | 287 | if (!address.EndsWith(m_InterObjectHostname)) |
292 | { | 288 | { |
@@ -302,7 +298,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
302 | //Subject | 298 | //Subject |
303 | emailMessage.Subject = subject; | 299 | emailMessage.Subject = subject; |
304 | //TEXT Body | 300 | //TEXT Body |
305 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 301 | if (!resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName)) |
302 | return; | ||
306 | emailMessage.BodyText = "Object-Name: " + LastObjectName + | 303 | emailMessage.BodyText = "Object-Name: " + LastObjectName + |
307 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + | 304 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + |
308 | LastObjectPosition + "\n\n" + body; | 305 | LastObjectPosition + "\n\n" + body; |
@@ -321,11 +318,11 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
321 | emailMessage.Send(smtpServer); | 318 | emailMessage.Send(smtpServer); |
322 | 319 | ||
323 | //Log | 320 | //Log |
324 | m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString() + "@" + m_HostName); | 321 | m_log.Info("[EMAIL]: EMail sent to: " + address + " from object: " + objectID.ToString() + "@" + m_HostName); |
325 | } | 322 | } |
326 | catch (Exception e) | 323 | catch (Exception e) |
327 | { | 324 | { |
328 | m_log.Error("[EMAIL] DefaultEmailModule Exception: " + e.Message); | 325 | m_log.Error("[EMAIL]: DefaultEmailModule Exception: " + e.Message); |
329 | } | 326 | } |
330 | } | 327 | } |
331 | else | 328 | else |