Beispiel #1
0
        /// <summary>
        /// Categorize recipients as follows:
        /// - are they in the local domain or are they external
        /// </summary>
        /// <param name="domains"></param>
        internal void CategorizeRecipientsByDomain(AgentDomains domains)
        {
            DirectAddressCollection recipients       = Recipients;
            DirectAddressCollection domainRecipients = null;
            MailAddressCollection   otherRecipients  = null;

            for (int i = 0, count = recipients.Count; i < count; ++i)
            {
                DirectAddress address = recipients[i];
                if (domains.IsManaged(address))
                {
                    if (domains.HsmEnabled(address))
                    {
                        address.HsmEnabled = true;
                    }

                    if (domainRecipients == null)
                    {
                        domainRecipients = new DirectAddressCollection();
                    }
                    domainRecipients.Add(address);
                }
                else
                {
                    if (otherRecipients == null)
                    {
                        otherRecipients = new MailAddressCollection();
                    }
                    otherRecipients.Add(address);
                }
            }

            this.DomainRecipients = domainRecipients;
            this.OtherRecipients  = otherRecipients;
        }
Beispiel #2
0
 /// <summary>
 /// Classify security level of sender
 /// </summary>
 /// <remarks>
 /// This will allow a consumer to decide how to handle decryption and digital signing.
 /// </remarks>
 /// <param name="domains"></param>
 public void EnsureSenderClassified(AgentDomains domains)
 {
     if (domains.IsManaged(Sender))
     {
         if (domains.HsmEnabled(Sender))
         {
             Sender.HsmEnabled = true;
         }
     }
 }