public static int AddMailList(MailList item)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // check package
            int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
            if (packageCheck < 0) return packageCheck;

            // check quota
            QuotaValueInfo quota = PackageController.GetPackageQuota(item.PackageId, Quotas.MAIL_LISTS);
            if (quota.QuotaExhausted)
                return BusinessErrorCodes.ERROR_MAIL_LISTS_RESOURCE_QUOTA_LIMIT;

            // check recipients number
            if (!CheckRecipientsAllowedNumber(item.PackageId, Quotas.MAIL_MAXLISTMEMBERS, item.Members))
                return BusinessErrorCodes.ERROR_MAIL_LISTS_RECIPIENTS_LIMIT;

            // check if mail resource is available
            int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.Mail);
            if (serviceId == 0)
                return BusinessErrorCodes.ERROR_MAIL_RESOURCE_UNAVAILABLE;

            // check package items
            if (PackageController.GetPackageItemByName(item.PackageId, item.Name, typeof(MailList)) != null)
                return BusinessErrorCodes.ERROR_MAIL_LISTS_PACKAGE_ITEM_EXISTS;

            // place log record
            TaskManager.StartTask("MAIL_LIST", "ADD", item.Name);
            
            try
            {
                // check service items
                MailServer mail = new MailServer();
                ServiceProviderProxy.Init(mail, serviceId);
                if (mail.ListExists(item.Name))
                    return BusinessErrorCodes.ERROR_MAIL_LISTS_SERVICE_ITEM_EXISTS;

                // add domain if not exists
                string domainName = item.Name.Substring(item.Name.IndexOf("@") + 1);
                int domainResult = AddMailDomain(item.PackageId, serviceId, domainName);
                if (domainResult < 0)
                    return domainResult;

                // create service item
                item.Enabled = true;
				item.Members = RemoveItemNameFromMembersList(
						  item.Name
						, item.Members.Clone() as string[]
					);

                // add service item
                mail.CreateList(item);

                // save item
                item.ServiceId = serviceId;
                item.Password = CryptoUtils.Encrypt(item.Password);
                int itemId = PackageController.AddPackageItem(item);

                TaskManager.ItemId = itemId;

                return itemId;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }