Ejemplo n.º 1
0
 public void SetUp()
 {
     server        = TestContext.CreateServer();
     peter_domain  = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     peter_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_account = TestContext.GetMailAccount(peter_address.LocalPart, _peterDomainName);
 }
Ejemplo n.º 2
0
        protected MailGroupModel(int id, int tenant, IMailAddress address, List <IMailAddress> in_addresses, MailServerBase server)
            : base(new MailAddressBase(address), (in_addresses.Select(a => new MailAddressBase(a)).ToList()))
        {
            if (id < 0)
            {
                throw new ArgumentException("Invalid domain id", "id");
            }

            if (tenant < 0)
            {
                throw new ArgumentException("Invalid tenant id", "tenant");
            }

            if (address == null)
            {
                throw new ArgumentException("Invalid address", "address");
            }

            if (in_addresses == null)
            {
                throw new ArgumentException("Invalid aliases", "in_addresses");
            }

            if (server == null)
            {
                throw new ArgumentException("Invalid server", "server");
            }

            Id          = id;
            Tenant      = tenant;
            Address     = address;
            InAddresses = in_addresses;
            Server      = server;
        }
Ejemplo n.º 3
0
 public void Init()
 {
     server               = TestContext.CreateServer();
     peter_domain         = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     peter_address        = TestContext.CreateRandomMailAddress(peter_domain);
     peter_second_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_alias          = TestContext.CreateRandomMailAddress(peter_domain);
     peter_account        = TestContext.GetMailAccount(peter_address.LocalPart, _peterDomainName);
     peter_second_account = TestContext.GetMailAccount(peter_second_address.LocalPart, _peterDomainName);
     peter_mailbox        = server.CreateMailbox(peter_address.LocalPart, PETER_PASSWORD, peter_domain, peter_account, TestContext.ServerFactory);
     peter_second_mailbox = server.CreateMailbox(peter_second_address.LocalPart, PETER_PASSWORD, peter_domain, peter_second_account, TestContext.ServerFactory);
 }
Ejemplo n.º 4
0
 public void Init()
 {
     server               = TestContext.CreateServer();
     peter_domain         = server.CreateWebDomain(_peterDomainName, _isVerified, TestContext.ServerFactory);
     peter_address        = TestContext.CreateRandomMailAddress(peter_domain);
     peter_second_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_alias          = TestContext.CreateRandomMailAddress(peter_domain);
     peter_account        = TestContext.GetMailAccount(peter_address.LocalPart, _peterDomainName);
     peter_second_account = TestContext.GetMailAccount(peter_second_address.LocalPart, _peterDomainName);
     peter_mailbox        = server.CreateMailbox(peter_address.LocalPart, PeterPassword, peter_domain, peter_account, TestContext.ServerFactory);
     peter_second_mailbox = server.CreateMailbox(peter_second_address.LocalPart, PeterPassword, peter_domain, peter_second_account, TestContext.ServerFactory);
 }
Ejemplo n.º 5
0
        public MailRemoveMailserverMailboxOperation(Tenant tenant, IAccount user, IMailbox mailBox, MailBoxManager mailBoxManager, MailServerBase mailServer, IMailServerFactory mailServerFactory)
            : base(tenant, user)
        {
            _mailBox = mailBox;

            _mailBoxManager = mailBoxManager;

            _mailServer = mailServer;

            _mailServerFactory = mailServerFactory;

            SetSource(_mailBox.Id.ToString());
        }
Ejemplo n.º 6
0
        protected WebDomainModel(int id, int tenant, string name, bool isVerified, MailServerBase server)
            : base(name)
        {
            if (id < 0)
            {
                throw new ArgumentException("Negative domain teamlab id", "id");
            }

            Id         = id;
            Tenant     = tenant;
            Server     = server;
            IsVerified = isVerified;
        }
Ejemplo n.º 7
0
        public void Init()
        {
            server                   = TestContext.CreateServer();
            peter_domain             = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
            peter_mail_group_address = TestContext.CreateRandomMailAddress(peter_domain);
            var peterMailboxAddress = TestContext.CreateRandomMailAddress(peter_domain);
            var peterAccount        = TestContext.GetMailAccount(peterMailboxAddress.LocalPart, _peterDomainName);

            peter_mailbox = server.CreateMailbox(peterAccount.TeamlabAccount.Name, peterMailboxAddress.LocalPart,
                                                 PETER_PASSWORD, peterMailboxAddress.Domain, peterAccount, TestContext.ServerFactory);
            peter_mail_group = server.CreateMailGroup(peter_mail_group_address.LocalPart, peter_mail_group_address.Domain, new List <int> {
                peter_mailbox.Address.Id
            }, TestContext.ServerFactory);
        }
        public void Init()
        {
            server                   = TestContext.CreateServer();
            peter_domain             = server.CreateWebDomain(_peterDomainName, _isVerified, TestContext.ServerFactory);
            peter_mail_group_address = TestContext.CreateRandomMailAddress(peter_domain);
            var peter_mailbox_address = TestContext.CreateRandomMailAddress(peter_domain);
            var peter_account         = TestContext.GetMailAccount(peter_mailbox_address.LocalPart, _peterDomainName);

            peter_mailbox = server.CreateMailbox(peter_mailbox_address.LocalPart, PeterPassword, peter_mailbox_address.Domain, peter_account,
                                                 TestContext.ServerFactory);
            peter_mail_group = server.CreateMailGroup(peter_mail_group_address.LocalPart, peter_mail_group_address.Domain, new List <int> {
                peter_mailbox.Address.Id
            }, TestContext.ServerFactory);
        }
Ejemplo n.º 9
0
        protected MailboxModel(int id, int tenant, IMailAddress address, string name, IMailAccount account,
                               ICollection <IMailAddress> aliases, MailServerBase server)
            : base(new MailAccountBase(account), new MailAddressBase(address), name, (aliases.Select(a => new MailAddressBase(a)).ToList()))
        {
            if (id < 0)
            {
                throw new ArgumentException("Invalid domain id", "id");
            }

            if (tenant < 0)
            {
                throw new ArgumentException("Invalid tenant id", "tenant");
            }

            if (account == null)
            {
                throw new ArgumentException("Invalid account", "account");
            }

            if (address == null)
            {
                throw new ArgumentException("Invalid address", "address");
            }

            if (aliases == null)
            {
                throw new ArgumentException("Invalid aliases", "aliases");
            }

            if (server == null)
            {
                throw new ArgumentException("Invalid server", "server");
            }

            Id      = id;
            Tenant  = tenant;
            Account = account;
            Address = address;
            Aliases = aliases;
            Server  = server;
        }
        public static IMailbox CompleteMailbox(this IMailbox mailbox,
                                               MailboxDto mailbox_dto, MailAddressDto mailbox_address_dto,
                                               List <MailAddressDto> list_alias_dto, MailServerBase server)
        {
            mailbox.Id          = mailbox_dto.id;
            mailbox.Tenant      = server.Tenant;
            mailbox.DateCreated = mailbox_dto.date_created;

            mailbox.Account.Login          = mailbox_dto.address;
            mailbox.Account.Password       = "";
            mailbox.Account.TeamlabAccount = new Account(new Guid(mailbox_dto.user_id), "", false);
            mailbox.Account.ServerInformation.ConnectionString = server.ConnectionString;

            mailbox.Address.Id          = mailbox_address_dto.id;
            mailbox.Address.Name        = mailbox_address_dto.name;
            mailbox.Address.Tenant      = mailbox_address_dto.tenant;
            mailbox.Address.DateCreated = mailbox_address_dto.date_created;

            mailbox.Address.Domain.Id          = mailbox_address_dto.Domain.id;
            mailbox.Address.Domain.Name        = mailbox_address_dto.Domain.name;
            mailbox.Address.Domain.DateCreated = mailbox_address_dto.Domain.date_added;

            foreach (var server_alias in mailbox.Aliases)
            {
                var alias = list_alias_dto.Find(d => d.name == server_alias.Name);
                server_alias.Id                 = alias.id;
                server_alias.Name               = alias.name;
                server_alias.Tenant             = alias.tenant;
                server_alias.Domain.Id          = alias.Domain.id;
                server_alias.Domain.Name        = alias.Domain.name;
                server_alias.Domain.DateCreated = alias.Domain.date_added;
            }

            mailbox.Server = server;

            return(mailbox);
        }
Ejemplo n.º 11
0
 public override IWebDomain CreateWebDomain(int id, int tenant, string name, bool isVerified, MailServerBase server)
 {
     return(new MockDomain(id, tenant, name, isVerified, server));
 }
Ejemplo n.º 12
0
 public PostfixDomain(int id, int tenant, string name, bool isVerified, MailServerBase server)
     : base(id, tenant, name, isVerified, server)
 {
 }
 public void Init()
 {
     server       = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, _isVerified, TestContext.ServerFactory);
 }
Ejemplo n.º 14
0
 public void Dispose()
 {
     server.DeleteWebDomain(peter_domain, TestContext.ServerFactory);
     server = null;
 }
Ejemplo n.º 15
0
 public void Init()
 {
     server       = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
 }
 public abstract IWebDomain CreateWebDomain(int id, int tenant, string name, bool is_verified, MailServerBase server);
 public void Init()
 {
     _server       = TestContext.CreateServer();
     _petersDomain = _server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     _peterAddress = TestContext.CreateRandomMailAddress(_petersDomain);
 }
Ejemplo n.º 18
0
 public PostfixMailbox(int id, int tenant, IMailAddress address, IMailAccount account, List <IMailAddress> aliases, MailServerBase server)
     : base(id, tenant, address, account, aliases, server)
 {
 }
 public abstract IMailbox CreateMailbox(int id, int tenant, IMailAddress address, IMailAccount account,
                                        List <IMailAddress> aliases, MailServerBase server);
Ejemplo n.º 20
0
 public MockDomain(int id, int tenant, string name, bool is_verified, MailServerBase server)
     : base(id, tenant, name, is_verified, server)
 {
 }
Ejemplo n.º 21
0
 public override IMailbox CreateMailbox(int id, int tenant, IMailAddress address, IMailAccount account, List <IMailAddress> aliases,
                                        MailServerBase server)
 {
     return(new PostfixMailbox(id, tenant, address, account, aliases, server));
 }
 public void SetUp()
 {
     factory = TestContext.ServerFactory;
     server  = TestContext.CreateServer();
 }
Ejemplo n.º 23
0
 public override IMailbox CreateMailbox(int id, int tenant, IMailAddress address, string name,
                                        IMailAccount account, List <IMailAddress> aliases, MailServerBase server)
 {
     return(new MockMailbox(id, tenant, address, name, account, aliases, server));
 }
Ejemplo n.º 24
0
 public MockMailGroup(int id, int tenant, IMailAddress address, List <IMailAddress> inAddresses, MailServerBase server)
     : base(id, tenant, address, inAddresses, server)
 {
     _serverData = MockServerData.GetInstance();
 }
Ejemplo n.º 25
0
 public override IMailGroup CreateMailGroup(int id, int tenant, IMailAddress address, List <IMailAddress> inAddresses, MailServerBase server)
 {
     return(new MockMailGroup(id, tenant, address, inAddresses, server));
 }
Ejemplo n.º 26
0
 public MockMailbox(int id, int tenant, IMailAddress address, IMailAccount account,
                    List <IMailAddress> aliases, MailServerBase server)
     : base(id, tenant, address, account, aliases, server)
 {
     _serverData = MockServerData.GetInstance();
 }
Ejemplo n.º 27
0
 public PostfixMailGroup(int id, int tenant, IMailAddress address, List <IMailAddress> inAddresses, MailServerBase server)
     : base(id, tenant, address, inAddresses, server)
 {
 }
 public abstract IMailGroup CreateMailGroup(int id, int tenant, IMailAddress address, List <IMailAddress> in_addresses, MailServerBase server);