/// <summary>
        /// Smart host relay session constructor.
        /// </summary>
        /// <param name="server">Owner relay server.</param>
        /// <param name="localBindInfo">Local bind info.</param>
        /// <param name="realyItem">Relay item.</param>
        /// <param name="smartHosts">Smart hosts.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>server</b>,<b>localBindInfo</b>,<b>realyItem</b> or <b>smartHosts</b>is null.</exception>
        /// <exception cref="ArgumentException">Is raised when any of the arguments has invalid value.</exception>
        internal Relay_Session(Relay_Server server,
                               IPBindInfo localBindInfo,
                               Relay_QueueItem realyItem,
                               Relay_SmartHost[] smartHosts)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }
            if (localBindInfo == null)
            {
                throw new ArgumentNullException("localBindInfo");
            }
            if (realyItem == null)
            {
                throw new ArgumentNullException("realyItem");
            }
            if (smartHosts == null)
            {
                throw new ArgumentNullException("smartHosts");
            }

            m_pServer        = server;
            m_pLocalBindInfo = localBindInfo;
            m_pRelayItem     = realyItem;
            m_pSmartHosts    = smartHosts;

            m_RelayMode         = Relay_Mode.SmartHost;
            m_SessionID         = Guid.NewGuid().ToString();
            m_SessionCreateTime = DateTime.Now;
            m_pTargets          = new List <Relay_Target>();
        }
Example #2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="sysSettings">Reference to system settings.</param>
 /// <param name="relayMode">Relay mode.</param>
 /// <param name="smartHostBalanceMode">Specifies how smart hosts will balance.</param>
 /// <param name="smartHosts">Smart hosts.</param>
 /// <param name="idleTimeout">Session idle timeout seconds.</param>
 /// <param name="maxConnections">Maximum conncurent conncetions.</param>
 /// <param name="maxConnectionsPerIP">Maximum conncurent conncetions to one IP address.</param>
 /// <param name="relayInterval">Relay messages interval seconds.</param>
 /// <param name="relayRetryInterval">Relay retry messages interval seconds.</param>
 /// <param name="undeliveredWarning">Specifies after how many minutes delayed delivery message is sent.</param>
 /// <param name="undelivered">Specifies after how many hours undelivered notification message is sent.</param>
 /// <param name="storeUndelivered">Specifies if undelivered messages are stored to "Undelivered" folder in mail store.</param>
 /// <param name="bindings">Specifies SMTP listening info.</param>
 internal Relay_Settings(System_Settings sysSettings,Relay_Mode relayMode,BalanceMode smartHostBalanceMode,Relay_SmartHost[] smartHosts,int idleTimeout,int maxConnections,int maxConnectionsPerIP,int relayInterval,int relayRetryInterval,int undeliveredWarning,int undelivered,bool storeUndelivered,IPBindInfo[] bindings)
 {
     m_pSysSettings          = sysSettings;
     m_RelayMode             = relayMode;
     m_SmartHostsBalanceMode = smartHostBalanceMode;
     m_pSmartHosts           = smartHosts;
     m_IdleTimeout           = idleTimeout;
     m_MaxConnections        = maxConnections;
     m_MaxConnectionsPerIP   = maxConnectionsPerIP;
     m_RelayInterval         = relayInterval;
     m_RelayRetryInterval    = relayRetryInterval;
     m_SendUndelWaringAfter  = undeliveredWarning;
     m_SendUndeliveredAfter  = undelivered;
     m_StoreUndeliveredMsgs  = storeUndelivered;
     m_pBinds                = bindings;
 }
Example #3
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="sysSettings">Reference to system settings.</param>
 /// <param name="relayMode">Relay mode.</param>
 /// <param name="smartHostBalanceMode">Specifies how smart hosts will balance.</param>
 /// <param name="smartHosts">Smart hosts.</param>
 /// <param name="idleTimeout">Session idle timeout seconds.</param>
 /// <param name="maxConnections">Maximum conncurent conncetions.</param>
 /// <param name="maxConnectionsPerIP">Maximum conncurent conncetions to one IP address.</param>
 /// <param name="relayInterval">Relay messages interval seconds.</param>
 /// <param name="relayRetryInterval">Relay retry messages interval seconds.</param>
 /// <param name="undeliveredWarning">Specifies after how many minutes delayed delivery message is sent.</param>
 /// <param name="undelivered">Specifies after how many hours undelivered notification message is sent.</param>
 /// <param name="storeUndelivered">Specifies if undelivered messages are stored to "Undelivered" folder in mail store.</param>
 /// <param name="bindings">Specifies SMTP listening info.</param>
 internal Relay_Settings(System_Settings sysSettings, Relay_Mode relayMode, BalanceMode smartHostBalanceMode, Relay_SmartHost[] smartHosts, int idleTimeout, int maxConnections, int maxConnectionsPerIP, int relayInterval, int relayRetryInterval, int undeliveredWarning, int undelivered, bool storeUndelivered, IPBindInfo[] bindings)
 {
     m_pSysSettings          = sysSettings;
     m_RelayMode             = relayMode;
     m_SmartHostsBalanceMode = smartHostBalanceMode;
     m_pSmartHosts           = smartHosts;
     m_IdleTimeout           = idleTimeout;
     m_MaxConnections        = maxConnections;
     m_MaxConnectionsPerIP   = maxConnectionsPerIP;
     m_RelayInterval         = relayInterval;
     m_RelayRetryInterval    = relayRetryInterval;
     m_SendUndelWaringAfter  = undeliveredWarning;
     m_SendUndeliveredAfter  = undelivered;
     m_StoreUndeliveredMsgs  = storeUndelivered;
     m_pBinds = bindings;
 }
Example #4
0
        /// <summary>
        /// Smart host relay session constructor.
        /// </summary>
        /// <param name="server">Owner relay server.</param>
        /// <param name="localBindInfo">Local bind info.</param>
        /// <param name="realyItem">Relay item.</param>
        /// <param name="smartHosts">Smart hosts.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>server</b>,<b>localBindInfo</b>,<b>realyItem</b> or <b>smartHosts</b>is null.</exception>
        /// <exception cref="ArgumentException">Is raised when any of the arguments has invalid value.</exception>
        internal Relay_Session(Relay_Server server,
                               IPBindInfo localBindInfo,
                               Relay_QueueItem realyItem,
                               Relay_SmartHost[] smartHosts)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }
            if (localBindInfo == null)
            {
                throw new ArgumentNullException("localBindInfo");
            }
            if (realyItem == null)
            {
                throw new ArgumentNullException("realyItem");
            }
            if (smartHosts == null)
            {
                throw new ArgumentNullException("smartHosts");
            }

            m_pServer = server;
            m_pLocalBindInfo = localBindInfo;
            m_pRelayItem = realyItem;
            m_pSmartHosts = smartHosts;

            m_RelayMode = Relay_Mode.SmartHost;
            m_SessionID = Guid.NewGuid().ToString();
            m_SessionCreateTime = DateTime.Now;
            m_pTargets = new List<Relay_Target>();
        }