/// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Reference to server.</param>
        /// <param name="defaultPort">Specifies default port.</param>
        /// <param name="defaultSSLPort">Specifies default SSL port.</param>
        public wfrm_sys_BindInfo(Server server,bool allowUDP,int defaultPort,int defaultSSLPort)
        {
            m_DefaultPort    = defaultPort;
            m_DefaultSSLPort = defaultSSLPort;

            InitUI();

            m_pProtocol.Items.Add("TCP");
            if(allowUDP){
                m_pProtocol.Items.Add("UDP");
            }
            m_pProtocol.SelectedIndex = 0;

            foreach(IPAddress ip in server.IPAddresses){
                if(ip.Equals(IPAddress.Any)){
                    m_pIP.Items.Add(new WComboBoxItem("any IPv4",ip));
                }
                else if(ip.Equals(IPAddress.Loopback)){
                    m_pIP.Items.Add(new WComboBoxItem("localhost IPv4",ip));
                }
                else if(ip.Equals(IPAddress.IPv6Any)){
                    m_pIP.Items.Add(new WComboBoxItem("Any IPv6",ip));
                }
                else if(ip.Equals(IPAddress.IPv6Loopback)){
                    m_pIP.Items.Add(new WComboBoxItem("localhost IPv6",ip));
                }
                else{
                    m_pIP.Items.Add(new WComboBoxItem(ip.ToString(),ip));
                }
            }

            m_pIP.SelectedIndex = 0;
            m_pPort.Value = defaultPort;
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="parent">Server object that is the parent of this object.</param>
        internal VirtualServerCollection(Server parent)
        {
            m_pParent = parent;
            m_pVirtualServers = new List<VirtualServer>();

            Bind();
        }
Exemple #3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Owner Server object that owns this collection.</param>
        internal SessionCollection(Server owner)
        {
            m_pOwner    = owner;
            m_pSessions = new List<Session>();

            Bind();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Owner Server object that owns this collection.</param>
        internal EventCollection(Server owner)
        {
            m_pOwner  = owner;
            m_pEvents = new List<Event>();

            Bind();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        public wfrm_se_VirtualServerAPI(Server server)
        {
            m_pServer = server;

            InitUI();

            LoadAPIs();
        }
Exemple #6
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Reference to mail server.</param>
        public wfrm_Server_Info(Server server)
        {
            m_pServer = server;

            InitUI();
                       
            Start();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        /// <param name="frame"></param>
        public wfrm_EventsAndLogs_Events(Server server,WFrame frame)
        {
            m_pServer = server;

            InitUI();

            LoadEvents();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        public wfrm_Monitoring_Sessions(Server server)
        {
            m_pServer = server;

            InitUI();

            m_pShow.SelectedIndex = 0;

            StartMonitoring();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        /// <param name="frame"></param>
        public wfrm_EventsAndLogs_Logs(Server server,WFrame frame)
        {
            m_pServer = server;

            InitUI();

            LoadVirtualServers();
            if(m_pVirtualServer.Items.Count > 0){
                m_pVirtualServer.SelectedIndex = 0;
            }
        }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="server">Owner server.</param>
 /// <param name="owner">Owner VirtualServerCollection collection that owns this object.</param>
 /// <param name="id">Virtual server ID.</param>
 /// <param name="enabled">Specifies if virtual server is enabled.</param>
 /// <param name="name">Virtual server name.</param>
 /// <param name="assembly">API assembly name.</param>
 /// <param name="type">API Type name.</param>
 /// <param name="initString">API init string.</param>
 internal VirtualServer(Server server,VirtualServerCollection owner,string id,bool enabled,string name,string assembly,string type,string initString)
 {
     m_pServer         = server;
     m_pOwner          = owner;
     m_VirtualServerID = id;
     m_Enabled         = enabled;
     m_Name            = name;
     m_Assembly        = assembly;
     m_Type            = type;
     m_InitString      = initString;
 }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        /// <param name="frame"></param>
        public wfrm_Monitoring_SIP_Calls(Server server,WFrame frame)
        {
            m_pServer = server;

            InitUI();

            // Move toolbar to Frame
            frame.Frame_ToolStrip = m_pToolbar;

            LoadData();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="mainFrm">Reference to main UI window.</param>
        /// <param name="virtualServersNode">Reference to owner virtual servers tree node.</param>
        /// <param name="server">Mail server.</param>
        /// <param name="frame"></param>
        public wfrm_VirtualServers(wfrm_Main mainFrm,TreeNode virtualServersNode,Server server,WFrame frame)
        {
            m_pFrmMain            = mainFrm;
            m_pVirtualServersNode = virtualServersNode;
            m_pServer             = server;

            InitUI();

            // Move toolbar to Frame
            frame.Frame_ToolStrip = m_pToolbar;

            LoadVirtualServers();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Reference to contact owner server.</param>
        public wfrm_Monitoring_SipRegistration(Server server)
        {
            m_pServer = server;
            m_pContactsToRemove = new List<string>();

            InitUI();

            m_pToolbar.Items[3].Enabled = false;

            // Load virtual servers
            foreach(VirtualServer virtualServer in m_pServer.VirtualServers){
                m_pVirtualServer.Items.Add(new WComboBoxItem(virtualServer.Name,virtualServer));
            }
            if(m_pVirtualServer.Items.Count > 0){
                m_pVirtualServer.SelectedIndex = 0;
            }
        }
        /// <summary>
        /// Edit constructor.
        /// </summary>
        /// <param name="server">Reference to contact owner server.</param>
        /// <param name="registration">Registration what contacts to show.</param>
        public wfrm_Monitoring_SipRegistration(Server server,SipRegistration registration)
        {
            m_pServer = server;
            m_pRegistration = registration;
            m_pContactsToRemove = new List<string>();

            InitUI();

            // Load virtual servers
            foreach(VirtualServer virtualServer in m_pServer.VirtualServers){
                m_pVirtualServer.Items.Add(new WComboBoxItem(virtualServer.Name,virtualServer));
            }
            if(m_pVirtualServer.Items.Count > 0){
                m_pVirtualServer.SelectedIndex = 0;
            }

            m_pVirtualServer.Enabled = false;
            m_pAOR.Enabled = false;
            m_pAOR.Text = registration.AddressOfRecord;

            LoadContacts();
        }
Exemple #15
0
        public static bool AddMessageAccount()
        {
            Server server = new Server();
            try
            {
                server.Connect(Host, "Administrator", "");
                LumiSoft.MailServer.API.UserAPI.User newAccount = server.VirtualServers[0].Users.Add(FrameworkParams.currentUser.username,
                    ((FrameworkParams.currentUser.fullname != null) ? FrameworkParams.currentUser.fullname : ""),
                    (FrameworkParams.currentUser.id.ToString() + "_protocolvn"),
                    "", 0, true, UserPermissions_enum.All);
                newAccount.EmailAddresses.Add(FrameworkParams.currentUser.username.ToString() + "@" + domain);
                newAccount.Commit();
                server.Disconnect();

                return true;
            }
            catch (Exception ex)
            {
                PLException.AddException(ex);
                return false;
            }
        }
Exemple #16
0
 public void ProcessApiRequest(MailApiPart request)
 {
     using (ls.Server lsMailServer = new ls.Server())
     {
         lsMailServer.Connect(_mailIP, _mailAdminUsername, _mailAdminPassword);
         if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.AliasAdd))
         {
             //add new email (val) to alias username(=email) (key)
             // Loop all virtual servers
             foreach (ls.VirtualServer virtualServer in lsMailServer.VirtualServers)
             {
                 foreach (ls.User user in virtualServer.Users)
                 {
                     if (user != null)
                     {
                         try
                         {
                             user.EmailAddresses.Add(request.ApiValue);
                         }
                         catch { }
                         break;
                     }
                 }
             }
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.AliasRemove))
         {
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.MailingListAdd))
         {
             //add new email (val) to list (key)
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.MailingListRemove))
         {
         }
     }
     request.Completed = DateTime.UtcNow;
 }
Exemple #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            try{
                using(Server lsMailServer = new Server()){
                    lsMailServer.Connect("localhost","Administrator","");

                    //lsMailServer.VirtualServers[0].Backup("c:\\backup.bck");
                    
                    //Console.WriteLine(lsMailServer.VirtualServers[0].SystemSettings.Relay.SmartHost);

                    
                    // Loop all virtual servers
                    foreach(VirtualServer virtualServer in lsMailServer.VirtualServers){
                        Console.WriteLine(virtualServer.Name + " : " + virtualServer.VirtualServerID);        
                    }

                    /*
                    // Loop first virtual server all domains
                    foreach(Domain domain in lsMailServer.VirtualServers[0].Domains){
                        Console.WriteLine("DomainName: " + domain.DomainName);
                    } */

                    /*
                    // Loop first virtual server all users
                    foreach(User user in lsMailServer.VirtualServers[0].Users){
                        Console.WriteLine("Login Name: " + user.UserName);
                    } */
                   
                    /*
                    // Loop first virtual server all groups
                    foreach(Group group in lsMailServer.VirtualServers[0].Groups){
                        Console.WriteLine("GroupName: " + group.GroupName);
                    } */

                    /*
                    // Add new group to first virtual server
                    Group gX = lsMailServer.VirtualServers[0].Groups.Add("new group","this is added from user api",false);
                    System.Threading.Thread.Sleep(15000);
                    // Delete specified group after 15 sec
                    lsMailServer.VirtualServers[0].Groups.Remove(gX);
                    */

                    // Add new member to first virtual server group
                    //lsMailServer.VirtualServers[0].Groups[0].Members.Add("xxx");

                    // Delete member
                    //lsMailServer.VirtualServers[0].Groups[0].Members.Remove("xxx
                                        
                    /*
                    // Update first virtual server first group description
                    lsMailServer.VirtualServers[0].Groups[0].Description = "some group";
                    lsMailServer.VirtualServers[0].Groups[0].Commit();
                    */
                                        
                    /*
                    // Loop first virtual server first user email addresses
                    foreach(string email in lsMailServer.VirtualServers[0].Users[0].EmailAddresses){
                        Console.WriteLine("Email: " + email);
                    }*/

                    /*
                    // Loop first virtual server first group members
                    foreach(string member in lsMailServer.VirtualServers[0].Groups[0].Members){
                        Console.WriteLine("Member: " + member);
                    }*/

                    /*
                    // Loop first virtual server first user root folders (no childs)
                    foreach(UserFolder folder in lsMailServer.VirtualServers[0].Users[0].Folders){
                        Console.WriteLine("FolderName: " + folder.FolderName + " childs: " + folder.ChildFolders.Count);
                    }*/
                    

                    //lsMailServer.VirtualServers[0].Users[1].Description = "test User api set description";
                    //lsMailServer.VirtualServers[0].Users[1].Commit();

                    //lsMailServer.VirtualServers[0].Users.Add("testXXX","full name","pwd","description",10,true,false);
                    //lsMailServer.VirtualServers[0].Users.Remove(lsMailServer.VirtualServers[0].Users[6]);

                    //lsMailServer.VirtualServers[0].Users[0].EmailAddresses.Remove("*****@*****.**");
                    //lsMailServer.VirtualServers[0].Users[3].RemoteServers.Add("new rem serv","ivx",110,false,"user","pwd",false);
                    //lsMailServer.VirtualServers[0].Users[3].RemoteServers.Remove(lsMailServer.VirtualServers[0].Users[3].RemoteServers[1]);
                    //lsMailServer.VirtualServers[0].Users[3].RemoteServers[0].Description = "Test desc";
                    //lsMailServer.VirtualServers[0].Users[3].RemoteServers[0].Commit();
                    //MessageBox.Show(lsMailServer.VirtualServers[0].Users[3].RemoteServers[0].Description);

                    //lsMailServer.VirtualServers[0].Users[0].Folders.Add("test api folder");
                    //MessageBox.Show(lsMailServer.VirtualServers[0].Users[0].Folders["test api folder"].FolderPath);
                    //lsMailServer.VirtualServers[0].Users[0].Folders["test api folder"].ChildFolders.Remove(lsMailServer.VirtualServers[0].Users[0].Folders["test api folder"].ChildFolders[0]);
                    //lsMailServer.VirtualServers[0].Users[0].Folders[0].ACL.Add("anyone",IMAP_ACL_Flags.All);
                    //lsMailServer.VirtualServers[0].Users[0].Folders[0].ACL.Remove(lsMailServer.VirtualServers[0].Users[0].Folders[0].ACL[0]);

                    /*
                    // Loop first virtual server first user root folders ACLd
                    foreach(UserFolder folder in lsMailServer.VirtualServers[0].Users[0].Folders){
                        string t = "Folder: " + folder.FolderName;
                        foreach(UserFolderAcl acl in folder.ACL){
                            t += "\r\n\tUser or Group: '" + acl.UserOrGroup + "' permissions: " + IMAP_Utils.ACL_to_String(acl.Permissions);
                        }
                        Console.WriteLine(t);
                    }
                    */

                    //lsMailServer.VirtualServers[0].MailingLists.Add("*****@*****.**","descr",true);
                    //lsMailServer.VirtualServers[0].MailingLists.Remove(lsMailServer.VirtualServers[0].MailingLists[4]);

                    /*
                    // Loop first virtual server all mailing lists
                    foreach(MailingList mailingList in lsMailServer.VirtualServers[0].MailingLists){
                        string t = "Mailing list Name: " + mailingList.Name;
                        t += "\r\n\tMembers: -----------------------";
                        foreach(string member in mailingList.Members){
                            t += "\r\n\tMember: '" + member;
                        }
                        t += "\r\n\tACL: -----------------------";
                        foreach(string acl in mailingList.ACL){
                            t += "\r\n\tUserOrGroup: '" + acl;
                        }
                        Console.WriteLine(t);
                    }*/

                    /*
                    // Update first virtual server first mailing list description
                    lsMailServer.VirtualServers[0].MailingLists[0].Description = "xxx list";
                    lsMailServer.VirtualServers[0].MailingLists[0].Commit();
                    */

                    // Add new member to first virtual server mailing list
                    //lsMailServer.VirtualServers[0].MailingLists[0].Members.Add("*****@*****.**");
                    //lsMailServer.VirtualServers[0].MailingLists[0].Members.Remove("*****@*****.**");
                    //lsMailServer.VirtualServers[0].MailingLists[0].ACL.Add("xxx");
                    //lsMailServer.VirtualServers[0].MailingLists[0].ACL.Remove("xxx");

                    /*
                    // Loop first virtual server first user email addresses
                    foreach(UserRemoteServer remoteServer in lsMailServer.VirtualServers[0].Users[3].RemoteServers){
                        Console.WriteLine("Server: " + remoteServer.Host);
                    }*/


                    /*
                    foreach(GlobalMessageRule gRule in lsMailServer.VirtualServers[0].GlobalMessageRules){
                        Console.WriteLine(gRule.Description);
                    }*/

                    //lsMailServer.VirtualServers[0].GlobalMessageRules[11].Description = "new descr";
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[11].Commit();
                    //lsMailServer.VirtualServers[0].GlobalMessageRules.Remove(lsMailServer.VirtualServers[0].GlobalMessageRules[11]);
                    //Console.WriteLine(lsMailServer.VirtualServers[0].GlobalMessageRules[11].Description);
                    //lsMailServer.VirtualServers[0].GlobalMessageRules.Add(true,"desc","sys.date = \"01.01.2006\"",GlobalMessageRule_CheckNextRule_enum.IfMatches);
                    //Console.WriteLine(lsMailServer.VirtualServers[0].GlobalMessageRules[0].CheckNextRule);
                    //Console.WriteLine(((GlobalMessageRuleAction_DeleteMessage)lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions[0]).Description);
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions[0].Description = "test action update";
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions[0].Commit();
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_AddHeaderField("desc","to:","test");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_AutoResponse("A resp test","*****@*****.**",new byte[0]);
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_DeleteMessage("d m test");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_ExecuteProgram("xxx desr","w.exe","-d");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_ForwardToEmail("desrc","*****@*****.**");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_ForwardToHost("descr","mail.ee",1025);
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_MoveToImapFolder("descr","spam");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_PostToHttp("desc","http://www.ee");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_PostToNntp("desc","server",10119,"test");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_RemoveHeaderField("descr","to:");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_StoreToDisk("desc","c:\\");
                    //lsMailServer.VirtualServers[0].GlobalMessageRules[0].Actions.Add_StoreToFtp("desc","host",1021,"user","pass","folder");


                    //lsMailServer.VirtualServers[0].RootFolders.Add(false,"xxxTestXX","desc",SharedFolderRootType_enum.UsersSharedFolder,"","");
                    //lsMailServer.VirtualServers[0].RootFolders.Remove(lsMailServer.VirtualServers[0].RootFolders[3]);
                    //lsMailServer.VirtualServers[0].RootFolders[3].Description = "new description";
                    //lsMailServer.VirtualServers[0].RootFolders[3].Commit();
                    
                    /*
                    foreach(SharedRootFolder rootFolder in lsMailServer.VirtualServers[0].RootFolders){
                        Console.WriteLine(rootFolder.Name);
                    }*/

                    /*
                    foreach(Filter filter in lsMailServer.VirtualServers[0].Filters){
                        Console.WriteLine(filter.Description);
                    }*/

                }
            }
            catch(Exception x){
                MessageBox.Show(x.Message + x.StackTrace);
            }
        }
Exemple #18
0
        private void m_pOk_Click(object sender, EventArgs e)
        {
            try{
                string host = m_pServer.Text;
                if(host == ""){
                    host = "localhost";
                }

                Server server = new Server();
                server.Connect(host,m_pUserName.Text,m_pPassword.Text);
                m_pApiServer = server;

                SaveRecentConnections();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch(Exception x){
                MessageBox.Show(this,"Error connecting to server:\r\n\t" + x.Message,"Error:",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
Exemple #19
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="server">Reference to server.</param>
 /// <param name="allowUDP">Specifies if UDP protocol is enabled.</param>
 /// <param name="defaultPort">Specifies default port.</param>
 /// <param name="defaultSSLPort">Specifies default SSL port.</param>
 public wfrm_sys_BindInfo(Server server,bool allowUDP,int defaultPort,int defaultSSLPort) : this(server,allowUDP,defaultPort,defaultSSLPort,null)
 {
 }
        /// <summary>
        /// Loads specified mail server to UI treeview.
        /// </summary>
        /// <param name="serverNode">Node to where to load server noders.</param>
        /// <param name="server">Server to load.</param>
        /// <param name="serverID">Server ID.</param>
        private void LoadServer(TreeNode serverNode,Server server,string serverID)
        {
            /* Tree node struct:
                machineName
                    Virtual Servers
                        ...
            */

            TreeNode node_machine = serverNode;
            if(serverNode == null){
                // Create machine root tree node
                node_machine = new TreeNode(server.Host);
                node_machine.Tag = new TreeNodeTag(server,NodeType.Server,serverID);
                m_pTree.Nodes.Add(node_machine);
            }
            else{
                node_machine.Tag = new TreeNodeTag(server,NodeType.Server,serverID);
            }
                TreeNode node_Monitoring = new TreeNode("Monitoring",0,0);
                //node_Monitoring.Tag = new NodeData(NodeType.LocalMachineMonitoring);
                node_machine.Nodes.Add(node_Monitoring);

                    TreeNode node_Monitoring_Sessions = new TreeNode("Sessions",0,0);
                    node_Monitoring_Sessions.Tag = new TreeNodeTag(server,NodeType.LocalMachineMonitoring,null);
                    node_Monitoring.Nodes.Add(node_Monitoring_Sessions);

                    TreeNode node_Monitoring_SipRegistrations = new TreeNode("SIP Registrations",0,0);
                    node_Monitoring_SipRegistrations.Tag = new TreeNodeTag(server,NodeType.Monitoring_SipRegistrations,null);
                    node_Monitoring.Nodes.Add(node_Monitoring_SipRegistrations);

                TreeNode node_LogsAndEvents = new TreeNode("Logs and Events",13,13);
                //node_LogsAndEvents.Tag = new NodeData(NodeType.Dummy);
                node_machine.Nodes.Add(node_LogsAndEvents);

                    TreeNode node_LogsAndEvents_Events = new TreeNode("Events",12,12);
                    node_LogsAndEvents_Events.Tag = new TreeNodeTag(server,NodeType.EventsAndLogs_Events,null);
                    node_LogsAndEvents.Nodes.Add(node_LogsAndEvents_Events);

                    TreeNode node_LogsAndEvents_Logs = new TreeNode("Logs",13,13);
                    node_LogsAndEvents_Logs.Tag = new TreeNodeTag(server,NodeType.EventsAndLogs_Logs,null);
                    node_LogsAndEvents.Nodes.Add(node_LogsAndEvents_Logs);

                // Create machine node virtual servers
                TreeNode node_virtualServers = new TreeNode("Virtual Servers",1,1);
                node_virtualServers.Tag = new TreeNodeTag(node_virtualServers,server,NodeType.VirtualServers,null);
                node_machine.Nodes.Add(node_virtualServers);
                    LoadVirtualServers(node_virtualServers,server);
        }
Exemple #21
0
 public void ProcessApiRequest(MailApiPart request)
 {
     using (ls.Server lsMailServer = new ls.Server())
     {
         lsMailServer.Connect(_mailIP, _mailAdminUsername, _mailAdminPassword);
         if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.AliasAdd))
         {
             //add new email (val) to alias username(=email) (key)
             // Loop all virtual servers
             foreach (ls.VirtualServer virtualServer in lsMailServer.VirtualServers)
             {
                 foreach (ls.User user in virtualServer.Users)
                 {
                     if (user != null)
                     {
                         try
                         {
                             user.EmailAddresses.Add(request.ApiValue);
                         }
                         catch { }
                         break;
                     }
                 }
             }
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.AliasRemove))
         {
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.MailingListAdd))
         {
             //add new email (val) to list (key)
         }
         else if (request.ApiMethod == EnumHelper.EnumToString(MailApiCall.MailingListRemove))
         {
         }
         
     }
     request.Completed = DateTime.UtcNow;
 }
Exemple #22
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="server">Reference to server.</param> 
 /// <param name="defaultPort">Specifies default port.</param>
 /// <param name="defaultSSLPort">Specifies default SSL port.</param>
 public wfrm_sys_BindInfo(Server server,int defaultPort,int defaultSSLPort) : this(server,false,defaultPort,defaultSSLPort)
 {
 }
Exemple #23
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="server">Reference to server.</param>
 /// <param name="allowUDP">Specifies if UDP protocol is enabled.</param>
 /// <param name="defaultPort">Specifies default port.</param>
 /// <param name="defaultSSLPort">Specifies default SSL port.</param>
 /// <param name="bindInfo">Bind info.</param>
 public wfrm_sys_BindInfo(Server server,bool allowUDP,int defaultPort,int defaultSSLPort,IPBindInfo bindInfo) : this(server,allowUDP,true,true,defaultPort,defaultSSLPort,bindInfo)
 {
 }
        /// <summary>
        /// Edit constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        /// <param name="virtualServer">Virtual server to update.</param>
        public wfrm_VirtualServers_VirtualServer(Server server,VirtualServer virtualServer)
        {
            m_pServer        = server;
            m_pVirtualServer = virtualServer;

            InitUI();

            m_pGetAPI.Enabled = false;
            m_pEnabled.Checked = virtualServer.Enabled;
            m_pName.Text       = virtualServer.Name;
            m_pAssembly.Text   = virtualServer.AssemblyName;
            m_pType.Text       = virtualServer.TypeName;
            if(m_pAssembly.Text.ToLower() == "xml_api.dll"){
                m_pPropertyGrid.SelectedObject = new XML_InitString(virtualServer.InitString);
            }
            else if(m_pAssembly.Text.ToLower() == "mssql_api.dll"){
                m_pPropertyGrid.SelectedObject = new MSSQL_InitString(virtualServer.InitString);
            }                
            else if(m_pAssembly.Text.ToLower() == "pgsql_api.dll"){
                m_pPropertyGrid.SelectedObject = new PGSQL_InitString(virtualServer.InitString);
            }
            else{
                MessageBox.Show("TODO:");
            }
        }
        /// <summary>
        /// Add new constructor.
        /// </summary>
        /// <param name="server">Mail server.</param>
        public wfrm_VirtualServers_VirtualServer(Server server)
        {
            m_pServer = server;

            InitUI();
        }
        /// <summary>
        /// Loads virtual servers to specified tree node.
        /// </summary>
        /// <param name="virtualServersNode">Tree node where to load virtual servers.</param>
        /// <param name="server">Server what virtual servers to load.</param>
        internal void LoadVirtualServers(TreeNode virtualServersNode,Server server)
        {
            virtualServersNode.Nodes.Clear();

            // Add all virtual servers
            foreach(VirtualServer vServer in server.VirtualServers){
                TreeNode node_virtualServers_vServer = new TreeNode(vServer.Name,0,0);
                if(vServer.Enabled){
                    node_virtualServers_vServer.ImageIndex = 18;
                    node_virtualServers_vServer.SelectedImageIndex = 18;
                }
                else{
                    node_virtualServers_vServer.ImageIndex = 19;
                    node_virtualServers_vServer.SelectedImageIndex = 19;
                }
                virtualServersNode.Nodes.Add(node_virtualServers_vServer);
                    TreeNode node_Sys = new TreeNode("System",15,15);
                    //node_Sys.Tag = new NodeData(NodeType.System,null);
                    node_virtualServers_vServer.Nodes.Add(node_Sys);

                        TreeNode node_Authentication = new TreeNode("Authentication",16,16);
                        node_Authentication.Tag = new TreeNodeTag(server,NodeType.System_Authentication,vServer);
                        node_Sys.Nodes.Add(node_Authentication);

                        TreeNode node_Services = new TreeNode("Services",14,14);
                        //node_Services.Tag = new NodeData(NodeType.System_Services,null);
                        node_Sys.Nodes.Add(node_Services);

                            TreeNode node_Services_SMTP = new TreeNode("SMTP",14,14);
                            node_Services_SMTP.Tag = new TreeNodeTag(server,NodeType.System_Services_SMTP,vServer);
                            node_Services.Nodes.Add(node_Services_SMTP);

                            TreeNode node_Services_POP3 = new TreeNode("POP3",14,14);
                            node_Services_POP3.Tag = new TreeNodeTag(server,NodeType.System_Services_POP3,vServer);
                            node_Services.Nodes.Add(node_Services_POP3);

                            TreeNode node_Services_IMAP = new TreeNode("IMAP",14,14);
                            node_Services_IMAP.Tag = new TreeNodeTag(server,NodeType.System_Services_IMAP,vServer);
                            node_Services.Nodes.Add(node_Services_IMAP);

                            TreeNode node_Services_Relay = new TreeNode("Relay",14,14);
                            node_Services_Relay.Tag = new TreeNodeTag(server,NodeType.System_Services_Relay,vServer);
                            node_Services.Nodes.Add(node_Services_Relay);

                            TreeNode node_Services_FetchPOP3 = new TreeNode("Fetch POP3",14,14);
                            node_Services_FetchPOP3.Tag = new TreeNodeTag(server,NodeType.System_Services_FetchPOP3,vServer);
                            node_Services.Nodes.Add(node_Services_FetchPOP3);

                            TreeNode node_Services_SIP = new TreeNode("SIP",14,14);
                            node_Services_SIP.Tag = new TreeNodeTag(server,NodeType.System_Services_SIP,vServer);
                            node_Services.Nodes.Add(node_Services_SIP);

                        TreeNode node_Sys_Logging = new TreeNode("Logging",13,13);
                        node_Sys_Logging.Tag = new TreeNodeTag(server,NodeType.System_Logging,vServer);
                        node_Sys.Nodes.Add(node_Sys_Logging);

                        TreeNode node_Sys_Backup = new TreeNode("Backup",17,17);
                        node_Sys_Backup.Tag = new TreeNodeTag(server,NodeType.System_Backup,vServer);
                        node_Sys.Nodes.Add(node_Sys_Backup);

                        TreeNode node_Sys_ReturnMessages = new TreeNode("Return Messages",21,21);
                        node_Sys_ReturnMessages.Tag = new TreeNodeTag(server,NodeType.System_ReturnMessages,vServer);
                        node_Sys.Nodes.Add(node_Sys_ReturnMessages);

                    TreeNode node_Domains = new TreeNode("Domains",3,3);
                    node_Domains.Tag = new TreeNodeTag(server,NodeType.Domains,vServer);
                    node_virtualServers_vServer.Nodes.Add(node_Domains);

                    TreeNode node_UsersAndGroups = new TreeNode("Users and Groups",4,4);
                    //node_UsersAndGroups.Tag = new NodeData(NodeType.Dummy,api);
                    node_virtualServers_vServer.Nodes.Add(node_UsersAndGroups);

                        TreeNode node_UsersAndGroups_Users = new TreeNode("Users",4,4);
                        node_UsersAndGroups_Users.Tag = new TreeNodeTag(server,NodeType.UsersAndGroups_Users,vServer);
                        node_UsersAndGroups.Nodes.Add(node_UsersAndGroups_Users);

                        TreeNode node_UsersAndGroups_Groups = new TreeNode("Groups",5,5);
                        node_UsersAndGroups_Groups.Tag = new TreeNodeTag(server,NodeType.UsersAndGroups_Groups,vServer);
                        node_UsersAndGroups.Nodes.Add(node_UsersAndGroups_Groups);

                    TreeNode node_Rules = new TreeNode("Rules",9,9);
                    //node_Rules.Tag = new NodeData(NodeType.Rules,api);
                    node_virtualServers_vServer.Nodes.Add(node_Rules);

                    TreeNode node_MessageRules = new TreeNode("Message Rules",9,9);
                    //node_MessageRules.Tag = new NodeData(NodeType.Dummy,api);
                    node_Rules.Nodes.Add(node_MessageRules);

                        TreeNode node_GlobalMessageRules = new TreeNode("Global",9,9);
                        node_GlobalMessageRules.Tag = new TreeNodeTag(server,NodeType.Rules_Message_Global,vServer);
                        node_MessageRules.Nodes.Add(node_GlobalMessageRules);
                        /*
                        TreeNode node_UserMessageRules = new TreeNode("User",8,8);
                        node_UserMessageRules.Tag = new NodeData(NodeType.Rules,api);
                        node_MessageRules.Nodes.Add(node_UserMessageRules);
                            */

                    TreeNode node_MailingLists = new TreeNode("Mailing Lists",5,5);
                    node_MailingLists.Tag = new TreeNodeTag(server,NodeType.MailingLists,vServer);
                    node_virtualServers_vServer.Nodes.Add(node_MailingLists);

                    TreeNode node_Routing = new TreeNode("Routing",6,6);
                    node_Routing.Tag = new TreeNodeTag(server,NodeType.Routing,vServer);
                    node_virtualServers_vServer.Nodes.Add(node_Routing);

                    TreeNode node_FoldersManagement = new TreeNode("Folders Management",11,11);
                    //node_FoldersManagement.Tag = new NodeData(NodeType.Dummy,api);
                    node_virtualServers_vServer.Nodes.Add(node_FoldersManagement);

                        TreeNode node_FoldersManagement_RootFolders = new TreeNode("Shared Root Folders",10,10);
                        node_FoldersManagement_RootFolders.Tag = new TreeNodeTag(server,NodeType.SharedFolders_RootFolders,vServer);
                        node_FoldersManagement.Nodes.Add(node_FoldersManagement_RootFolders);

                        //TreeNode node_FoldersManagement_MangeUserFolders = new TreeNode("Manage User Folders",7,7);
                        //node_FoldersManagement_MangeUserFolders.Tag = new TreeNodeTag(server,NodeType.SharedFolders_Users,vServer);
                        //node_FoldersManagement.Nodes.Add(node_FoldersManagement_MangeUserFolders);

                        TreeNode node_FoldersManagement_UsersDefaultFolders = new TreeNode("Users Default Folders",11,11);
                        node_FoldersManagement_UsersDefaultFolders.Tag = new TreeNodeTag(server,NodeType.Folders_UsersDefaultFolders,vServer);
                        node_FoldersManagement.Nodes.Add(node_FoldersManagement_UsersDefaultFolders);

                        TreeNode node_FoldersManagement_RecycelBin = new TreeNode("Recycle Bin",20,20);
                        node_FoldersManagement_RecycelBin.Tag = new TreeNodeTag(server,NodeType.Folders_RecycleBin,vServer);
                        node_FoldersManagement.Nodes.Add(node_FoldersManagement_RecycelBin);

                    TreeNode node_Queues = new TreeNode("Queues",12,12);
                    //node_Queues.Tag = new NodeData(NodeType.Dummy,api);
                    node_virtualServers_vServer.Nodes.Add(node_Queues);

                        TreeNode node_Queues_IncomingSmtp = new TreeNode("Incoming SMTP",12,12);
                        node_Queues_IncomingSmtp.Tag = new TreeNodeTag(server,NodeType.Queues_IncomingSMTP,vServer);
                        node_Queues.Nodes.Add(node_Queues_IncomingSmtp);

                        TreeNode node_Queues_OutgoingSmtp = new TreeNode("Outgoing SMTP",12,12);
                        node_Queues_OutgoingSmtp.Tag = new TreeNodeTag(server,NodeType.Queues_OutgoingSMTP,vServer);
                        node_Queues.Nodes.Add(node_Queues_OutgoingSmtp);

                    TreeNode node_Security = new TreeNode("Security",7,7);
                    node_Security.Tag = new TreeNodeTag(server,NodeType.Security,vServer);
                    node_virtualServers_vServer.Nodes.Add(node_Security);

                    TreeNode node_Filters = new TreeNode("Filters",8,8);
                    node_Filters.Tag = new TreeNodeTag(server,NodeType.Filters,vServer);
                    node_virtualServers_vServer.Nodes.Add(node_Filters);

                        /*
                    TreeNode node_Utils = new TreeNode("Utils",8,8);
                    node_Utils.Tag = new NodeData(NodeType.Dummy,api);
                    node_Server.Nodes.Add(node_Utils);

                       TreeNode node_DnsQuery = new TreeNode("Dns Query",8,8);
                       node_DnsQuery.Tag = new NodeData(NodeType.Dummy,api);
                       node_Utils.Nodes.Add(node_DnsQuery);

                       TreeNode node_SmtpStress = new TreeNode("Smtp Stress",8,8);
                       node_SmtpStress.Tag = new NodeData(NodeType.Dummy,api);
                       node_Utils.Nodes.Add(node_SmtpStress);*/
            }
        }
 /// <summary>
 /// Loads specified mail server to UI treeview.
 /// </summary>
 /// <param name="server">Server to load.</param>
 /// <param name="serverID">Server ID.</param>
 private void LoadServer(Server server,string serverID)
 {
     LoadServer(null,server,serverID);
 }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="node">Tree node that owns this object.</param>
 /// <param name="server">Mail server object.</param>
 /// <param name="type">Treenode type.</param>
 /// <param name="tag">User data.</param>
 public TreeNodeTag(TreeNode node,Server server,NodeType type,object tag)
 {
     m_pNode    = node;
     m_pServer  = server;
     m_NodeType = type;
     m_Tag      = tag;
 }
Exemple #29
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="server">Reference to server.</param>
        /// <param name="allowUDP">Specifies if UDP protocol is enabled.</param>
        /// <param name="allowSSL">Specifies if SSL is enabled.</param>
        /// <param name="allowChangePort">Specifies if port can be changed.</param>
        /// <param name="defaultPort">Specifies default port.</param>
        /// <param name="defaultSSLPort">Specifies default SSL port.</param>
        /// <param name="bindInfo">Bind info.</param>
        public wfrm_sys_BindInfo(Server server,bool allowUDP,bool allowSSL,bool allowChangePort,int defaultPort,int defaultSSLPort,IPBindInfo bindInfo)
        {
            m_SslEnabled     = allowSSL;
            m_DefaultPort    = defaultPort;
            m_DefaultSSLPort = defaultSSLPort;

            InitUI();
                        
            m_pSslMode.SelectedIndex = 0;
            if(!allowSSL){
                m_pSslMode.Enabled = false;
            }
            if(!allowChangePort){
                m_pPort.Enabled = false;
            }

            if(bindInfo != null){
                m_pHostName.Text = bindInfo.HostName;
            }

            m_pProtocol.Items.Add("TCP");
            if(allowUDP){
                m_pProtocol.Items.Add("UDP");
            }
            if(bindInfo == null){
                m_pProtocol.SelectedIndex = 0;
            }
            else{
                m_pProtocol.Text = bindInfo.Protocol.ToString();
            }

            foreach(IPAddress ip in server.IPAddresses){
                m_pIP.Items.Add(new WComboBoxItem(IpToString(ip),ip));
            }

            if(bindInfo == null){
                m_pIP.SelectedIndex = 0;
                m_pPort.Value = defaultPort;
            }
            else{
                m_pCert = bindInfo.Certificate;

                m_pIP.Text = IpToString(bindInfo.IP);
                m_pPort.Value = bindInfo.Port;
                m_pSslMode.Text = bindInfo.SslMode.ToString();                           
            }

            UpdateCertStatus();
        }