Esempio n. 1
0
        public static ServerMailboxData ToMailboxData(Mailbox mailbox, ServerDomainAddressData address,
                                                      List <ServerDomainAddressData> aliases)
        {
            var userDisplayName = "";

            try
            {
                var user = CoreContext.UserManager.GetUsers(new Guid(mailbox.User));
                userDisplayName = user.DisplayUserName();
            }
            catch
            {
                // skip any errors
            }

            return(new ServerMailboxData
            {
                Id = mailbox.Id,
                UserId = mailbox.User,
                UserDisplayName = userDisplayName,
                Address = address,
                Name = mailbox.Name,
                Aliases = aliases
            });
        }
Esempio n. 2
0
        public static ServerDomainAddressData ToServerDomainAddressData(ServerAddress address, string email)
        {
            var result = new ServerDomainAddressData
            {
                Id       = address.Id,
                DomainId = address.DomainId,
                Email    = email
            };

            return(result);
        }
Esempio n. 3
0
        public static ServerDomainAddressData ToServerDomainAddressData(ServerAddress address, ServerDomainData domain)
        {
            var result = new ServerDomainAddressData
            {
                Id       = address.Id,
                DomainId = address.DomainId,
                Email    = string.Format("{0}@{1}", address.AddressName, domain.Name)
            };

            return(result);
        }
        public static ServerDomainGroupData ToServerDomainGroupData(int groupId, ServerDomainAddressData address, List <ServerDomainAddressData> addresses)
        {
            var group = new ServerDomainGroupData
            {
                Id        = groupId,
                Address   = address,
                Addresses = addresses
            };

            return(group);
        }
Esempio n. 5
0
 public static ServerMailboxData ToMailboxData(Mailbox mailbox, ServerDomainAddressData address,
                                               List <ServerDomainAddressData> aliases)
 {
     return(new ServerMailboxData
     {
         Id = mailbox.Id,
         UserId = mailbox.User,
         Address = address,
         Name = mailbox.Name,
         Aliases = aliases
     });
 }