void PostProcessIncoming(ISmtpMessage message, IncomingMessage envelope) { this.CopyMessage(message, m_settings.Incoming); if (envelope.HasDomainRecipients) { var routedRecipients = new DirectAddressCollection(); var messageRoute = m_router.Clone(); messageRoute.Route(message, envelope, routedRecipients); SendNotifications(envelope, routedRecipients); SendDeliveryStatus(messageRoute, envelope, routedRecipients); } // // Any recipients that were handled by routes are no longer in the DomainRecipients collection (removed) // Smtp Server should continue process any domain recipients whose delivery were NOT handled by routes // if (m_settings.Incoming.EnableRelay && envelope.HasDomainRecipients) { this.SendNotifications(envelope, envelope.DomainRecipients); // // We only want the incoming message sent to trusted domain recipients // We are not allowing arbitrary relay // message.SetRcptTo(envelope.DomainRecipients); m_diagnostics.LogEnvelopeHeaders(message); } else { // // SMTP Server need not proceed with delivery because we already routed the message to all domain recipients // message.Abort(); } }
void PostProcessOutgoing(ISmtpMessage message, OutgoingMessage envelope) { MonitorMdn(envelope); SendDeliveryStatus(envelope); this.RelayInternal(message, envelope); //Removes recipients in local domains if (envelope.HasRecipients) { this.CopyMessage(message, m_settings.Outgoing); } if (m_settings.Outgoing.EnableRelay && envelope.HasRecipients) { message.SetRcptTo(envelope.Recipients); m_diagnostics.LogEnvelopeHeaders(message); } else { message.Abort(); } }
void PostProcessIncoming(ISmtpMessage message, IncomingMessage envelope) { this.CopyMessage(message, m_settings.Incoming); if (envelope.HasDomainRecipients) { DirectAddressCollection routedRecipients = new DirectAddressCollection(); m_router.Route(message, envelope, routedRecipients); this.SendNotifications(envelope, routedRecipients); SendDeliveryStatus(m_router, envelope, routedRecipients); } // // Any recipients that were handled by routes are no longer in the DomainRecipients collection (removed) // Smtp Server should continue process any domain recipients whose delivery were NOT handled by routes // if (m_settings.Incoming.EnableRelay && envelope.HasDomainRecipients) { this.SendNotifications(envelope, envelope.DomainRecipients); // // We only want the incoming message sent to trusted domain recipients // We are not allowing arbitrary relay // message.SetRcptTo(envelope.DomainRecipients); m_diagnostics.LogEnvelopeHeaders(message); } else { // // SMTP Server need not proceed with delivery because we already routed the message to all domain recipients // message.Abort(); } }