Esempio n. 1
0
        public static void DeleteDomainFilter(DomainInfo domain)
        {
            int serviceId = GetServiceId(domain.PackageId);

            if (IsPackageServiceEnabled(domain.PackageId, serviceId))
            {
                SpamExperts server = GetServer(serviceId);
                var         res    = server.DeleteDomainFilter(domain.DomainName);
            }
        }
Esempio n. 2
0
        public static SpamExpertsResult AddDomainFilterAlias(DomainInfo domain, string alias)
        {
            int serviceId = GetServiceId(domain.PackageId);

            if (!IsPackageServiceEnabled(domain.PackageId, serviceId))
            {
                return(new SpamExpertsResult(SpamExpertsStatus.Error, "Service not enabled"));
            }

            SpamExperts server = GetServer(serviceId);

            return(server.AddDomainFilterAlias(domain.DomainName, alias));
        }
Esempio n. 3
0
        public static SpamExpertsResult AddDomainFilter(SpamExpertsRoute route)
        {
            int serviceId = GetServiceId(route.PackageId);

            if (!IsPackageServiceEnabled(route.PackageId, serviceId))
            {
                return(new SpamExpertsResult(SpamExpertsStatus.Error, "Service not enabled"));
            }

            SpamExperts server = GetServer(serviceId);

            return(server.AddDomainFilter(route.DomainName, "", "postmaster@" + route.DomainName, route.Destinations));
        }
Esempio n. 4
0
        internal static SpamExperts GetServer(int serviceId)
        {
            SpamExperts ws = new SpamExperts();

            ServiceProviderProxy.Init(ws, serviceId);

            string[] settings = ws.ServiceProviderSettingsSoapHeaderValue.Settings;

            List <string> resSettings = new List <string>(settings);

            ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray();
            return(ws);
        }
Esempio n. 5
0
        public static void SetEmailFilterPassword(int packageId, string email, string password)
        {
            int serviceId = GetServiceId(packageId);

            if (IsPackageServiceEnabled(packageId, serviceId))
            {
                if (Convert.ToBoolean(PackageController.GetPackageQuota(packageId, Quotas.FILTERS_ENABLE_EMAIL_USERS).QuotaAllocatedValue))
                {
                    SpamExperts server = GetServer(serviceId);
                    var         res    = server.SetEmailFilterUserPassword(email, password);
                }
            }
        }
Esempio n. 6
0
        public static SpamExpertsResult AddEmailFilter(int packageId, string username, string password, string domain)
        {
            int serviceId = GetServiceId(packageId);

            if (!IsPackageServiceEnabled(packageId, serviceId))
            {
                return(new SpamExpertsResult(SpamExpertsStatus.Error, "Service not enabled"));
            }
            if (Convert.ToBoolean(PackageController.GetPackageQuota(packageId, Quotas.FILTERS_ENABLE_EMAIL_USERS).QuotaAllocatedValue))
            {
                SpamExperts server = GetServer(serviceId);

                return(server.AddEmailFilter(username, domain, password));
            }
            return(new SpamExpertsResult(SpamExpertsStatus.Error, "Service not enabled for users"));
        }