From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- .../Modules/Scripting/EMailModules/EmailModule.cs | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs') diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { m_Config = config; IConfig SMTPConfig; - + //FIXME: RegionName is correct?? //m_RegionName = scene.RegionInfo.RegionName; IConfig startupConfig = m_Config.Configs["Startup"]; m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); - + //Load SMTP SERVER config try { @@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Enabled = false; return; } - + if (!SMTPConfig.GetBoolean("enabled", false)) { m_log.InfoFormat("[SMTP] module disabled in configuration"); m_Enabled = false; return; } - + m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); - SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); + SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { get { return true; } } - + /// - /// + /// /// /// private void DelayInSeconds(int seconds) @@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); DateTime EndDelay = DateTime.Now.Add(DiffDelay); while (DateTime.Now < EndDelay) - { + { ;//Do nothing!! } } - + private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) { lock (m_Scenes) @@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectName = part.Name; - ObjectRegionName = m_ObjectRegionName; + ObjectRegionName = m_ObjectRegionName; return; } ObjectAbsolutePosition = part.AbsolutePosition.ToString(); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules ObjectRegionName = m_ObjectRegionName; return; } - + /// /// SendMail function utilized by llEMail /// @@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules public void SendEmail(LLUUID objectID, string address, string subject, string body) { //Check if address is empty - if (address == string.Empty) + if (address == string.Empty) return; - + //FIXED:Check the email is correct form in REGEX - string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" - + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" - + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" - + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" + + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; Regex EMailreStrict = new Regex(EMailpatternStrict); bool isEMailStrictMatch = EMailreStrict.IsMatch(address); @@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules if ((subject.Length + body.Length) > 1024) { m_log.Error("[EMAIL] subject + body > 1024 Byte"); - return; + return; } - + try { string LastObjectName = string.Empty; @@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //From emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); //To - Only One - emailMessage.AddToAddress(new EmailAddress(address)); + emailMessage.AddToAddress(new EmailAddress(address)); //Subject emailMessage.Subject = subject; //TEXT Body resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + - LastObjectPosition+"\r\n\r\n\r\n" + body); + LastObjectPosition+"\r\n\r\n\r\n" + body); //HTML Body - emailMessage.HtmlPart = new HtmlAttachment("

" + + emailMessage.HtmlPart = new HtmlAttachment("

" + "
Object-Name: " + LastObjectName + "
Region: " + LastObjectRegionName + "
Local-Position: " + LastObjectPosition + "


" +body+"\r\n

"); - + //Set SMTP SERVER config SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); //Authentication @@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return; } } - + /// - /// + /// /// /// /// -- cgit v1.1