/// <summary> /// Get aliases which was created by this application /// </summary> /// <param name="config">mailias.json configuration</param> /// <returns>Aliases which match the prefix and domain</returns> public async Task <IList <Data.Alias> > GetAliases(MailiasConfig config) { return((await this.GetAliases()) .Where(a => (string.IsNullOrWhiteSpace(config.Prefix) || a.LocalPart.StartsWith(config.Prefix + ".")) && a.Domain == config.MailDomain && a.TargetAddresses.Any(ta => ta == config.TargetAddress) ) .ToList()); }
/// <summary> /// Apply the configuration parameters to the provider /// </summary> /// <param name="config">The config object</param> public void Configure(MailiasConfig config) { this.Generator.Username = config.ProviderConfig.Single(cfg => cfg.Key == CFGKEY_USERNAME).Value; this.Generator.PasswordHash = config.ProviderConfig.Single(cfg => cfg.Key == CFGKEY_PASSWORD).Value; }