diff options
author | Melanie Thielker | 2009-02-15 13:54:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-02-15 13:54:34 +0000 |
commit | 272a319a3e3dd1a3e9e3ad4c79eed22e5eff4109 (patch) | |
tree | 2671ae921367b2f6365e85d182568705153cd462 /OpenSim/Region/CoreModules/Scripting | |
parent | Guarding the new call to SetHeight in MakeRoot, so that ODE doesn't complain ... (diff) | |
download | opensim-SC_OLD-272a319a3e3dd1a3e9e3ad4c79eed22e5eff4109.zip opensim-SC_OLD-272a319a3e3dd1a3e9e3ad4c79eed22e5eff4109.tar.gz opensim-SC_OLD-272a319a3e3dd1a3e9e3ad4c79eed22e5eff4109.tar.bz2 opensim-SC_OLD-272a319a3e3dd1a3e9e3ad4c79eed22e5eff4109.tar.xz |
Thank you, Vytek, for a patch that streamlines the delay in the email
module and changes SMTP authentication (applied with changes)
Fixes Mantis #3168
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 9e2abf2..43eccf3 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -178,17 +178,15 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /// <summary> | 180 | /// <summary> |
181 | /// | 181 | /// Delay function using thread in seconds |
182 | /// </summary> | 182 | /// </summary> |
183 | /// <param name="seconds"></param> | 183 | /// <param name="seconds"></param> |
184 | private void DelayInSeconds(int seconds) | 184 | private void DelayInSeconds(int delay) |
185 | { | 185 | { |
186 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); | 186 | delay = (int)((float)delay * 1000); |
187 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); | 187 | if (delay == 0) |
188 | while (DateTime.Now < EndDelay) | 188 | return; |
189 | { | 189 | System.Threading.Thread.Sleep(delay); |
190 | ;//Do nothing!! | ||
191 | } | ||
192 | } | 190 | } |
193 | 191 | ||
194 | private bool IsLocal(UUID objectID) | 192 | private bool IsLocal(UUID objectID) |
@@ -293,12 +291,19 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
293 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + | 291 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + |
294 | LastObjectPosition + "\n\n" + body; | 292 | LastObjectPosition + "\n\n" + body; |
295 | 293 | ||
294 | //Config SMTP Server | ||
296 | //Set SMTP SERVER config | 295 | //Set SMTP SERVER config |
297 | SmtpServer smtpServer = new SmtpServer(SMTP_SERVER_HOSTNAME, SMTP_SERVER_PORT); | 296 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); |
298 | //Authentication | 297 | // Add authentication only when requested |
299 | smtpServer.SmtpAuthToken = new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); | 298 | // |
299 | if (SMTP_SERVER_LOGIN != String.Empty && SMTP_SERVER_PASSWORD != String.Empty) | ||
300 | { | ||
301 | //Authentication | ||
302 | smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); | ||
303 | } | ||
300 | //Send Email Message | 304 | //Send Email Message |
301 | emailMessage.Send(smtpServer); | 305 | emailMessage.Send(smtpServer); |
306 | |||
302 | //Log | 307 | //Log |
303 | m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString()); | 308 | m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString()); |
304 | } | 309 | } |