private void OnDisconnectHandler(DisconnectEventSource source, DisconnectEventArgs e) { Logger.Debug("[GenericTransportAgent] SmtpReceiveAgent - OnDisconnect fired..."); foreach (var x in Configuration.Config.SmtpReceiveAgentConfig.OnDisconnect) { try { x.Execute(); } catch (Exception ex) { Logger.Error(ex, @"Error executing ""OnDisconnect"""); } } }
private void DisconnectHandler(DisconnectEventSource source, DisconnectEventArgs args) { DeliveryThrottlingAgent.Diag.TraceDebug(0, (long)this.GetHashCode(), "DisconnectHandler started"); DeliveryThrottling.Instance.ClearSession(args.SmtpSession.SessionId); if (DeliveryConfiguration.Instance.Throttling.DynamicMailboxDatabaseThrottlingEnabled && this.connectionManager != null) { if (this.mailboxDatabaseConnectionInfo != null) { DeliveryThrottlingAgent.Diag.TraceDebug <long>(0, (long)this.GetHashCode(), "Dynamic Throttling: Connection lock was previously acquired. Being released during disconnect. SessionId {0}", args.SmtpSession.SessionId); if (!this.connectionManager.Release(ref this.mailboxDatabaseConnectionInfo)) { DeliveryThrottlingAgent.Diag.TraceWarning <long>(0, (long)this.GetHashCode(), "Dynamic Throttling: Connection lock was previously acquired but release returned false during disconnect. SessionId {0}", args.SmtpSession.SessionId); } } bool flag = this.connectionManager.RemoveConnection(args.SmtpSession.SessionId, args.SmtpSession.RemoteEndPoint.Address); this.connectionManager = null; if (flag) { DeliveryThrottlingAgent.Diag.TraceDebug <Guid, long, IPAddress>(0, (long)this.GetHashCode(), "Dynamic Throttling: Connection removed. MDB {0} SessionId {1} IP {2}", this.destinationMdbGuid, args.SmtpSession.SessionId, args.SmtpSession.RemoteEndPoint.Address); return; } DeliveryThrottlingAgent.Diag.TraceWarning <Guid, long, IPAddress>(0, (long)this.GetHashCode(), "Dynamic Throttling: Remove Connection returned false during disconnect. MDB {0} SessionId {1} IP {2}", this.destinationMdbGuid, args.SmtpSession.SessionId, args.SmtpSession.RemoteEndPoint.Address); } }
void OnDisconnectHandler(DisconnectEventSource source, DisconnectEventArgs e) { Logger.Debug("[GenericTransportAgent] SmtpReceiveAgent - OnDisconnect fired..."); _config.SmtpReceiveAgentConfig.OnDisconnect.ToList().ForEach(x => { try { x.Execute(); } catch (Exception ex) { Logger.Error(ex, @"Error executing ""OnDisconnect"""); } }); }
void OnDisconnectHandler(DisconnectEventSource source, DisconnectEventArgs e) { Logger.Debug("[GenericExchangeTransportagent] [SmtpReceiveAgent] OnDisconnect fired..."); _config.SmtpReceiveAgentConfig.OnDisconnect.ToList().ForEach(x => { try { x.Execute(); } catch (Exception ex) { Logger.Error(ex, @"Error executing ""OnDisconnect"""); } }); }