public SmtpSessionInfo() { CreatedTimestamp = DateTime.UtcNow; Identification = new SmtpIdentification(); Recipients = new List<MailAddressWithParameters>(); }
public SmtpSessionInfo() { CreatedTimestamp = DateTime.UtcNow; Identification = new SmtpIdentification(); Recipients = new List <MailAddressWithParameters>(); }
protected override SmtpResponse ProcessCommandHelo(string name, string arguments) { var identification = new SmtpIdentification(SmtpIdentificationMode.HELO, arguments); var response = _responderFactory.IdentificationResponder.VerifyIdentification(SessionInfo, identification); if (response.Success) { SessionInfo.Identification = identification; } return response; }
protected override SmtpResponse ProcessCommandHelo(string name, string arguments) { var identification = new SmtpIdentification(SmtpIdentificationMode.HELO, arguments); var response = _responderFactory.IdentificationResponder.VerifyIdentification(SessionInfo, identification); if (response.Success) { SessionInfo.Identification = identification; } return(response); }
public virtual SmtpResponse VerifyIdentification(ISmtpSessionInfo sessionInfo, SmtpIdentification smtpIdentification) { if (smtpIdentification == null) throw new ArgumentNullException("smtpIdentification"); switch (smtpIdentification.Mode) { case SmtpIdentificationMode.HELO: return VerifyHelo(); case SmtpIdentificationMode.EHLO: return VerifyEhlo(); } return new SmtpResponse(500, "Invalid Identification (" + smtpIdentification.Mode + ")"); }
protected override SmtpResponse ProcessCommandEhlo(string name, string arguments) { if (String.IsNullOrWhiteSpace(arguments)) { return new SmtpResponse(501, "EHLO Missing domain address."); } var identification = new SmtpIdentification(SmtpIdentificationMode.EHLO, arguments); var response = _responderFactory.IdentificationResponder.VerifyIdentification(SessionInfo, identification); if (response.Success) { SessionInfo.Identification = identification; } return response; }
protected override SmtpResponse ProcessCommandEhlo(string name, string arguments) { if (String.IsNullOrWhiteSpace(arguments)) { return(SmtpResponses.EhloMissingDomainAddress); } var identification = new SmtpIdentification(SmtpIdentificationMode.EHLO, arguments); var response = _responderFactory.IdentificationResponder.VerifyIdentification(SessionInfo, identification); if (response.Success) { SessionInfo.Identification = identification; } return(response); }
public virtual SmtpResponse VerifyIdentification(ISmtpSessionInfo sessionInfo, SmtpIdentification smtpIdentification) { if (smtpIdentification == null) throw new ArgumentNullException(nameof(smtpIdentification)); switch (smtpIdentification.Mode) { case SmtpIdentificationMode.HELO: return VerifyHelo(); case SmtpIdentificationMode.EHLO: return VerifyEhlo(); case SmtpIdentificationMode.NotIdentified: break; default: throw new ArgumentOutOfRangeException(); } return new SmtpResponse(500, "Invalid Identification (" + smtpIdentification.Mode + ")"); }
public virtual SmtpResponse VerifyIdentification(SmtpSessionInfo sessionInfo, SmtpIdentification smtpIdentification) { if (smtpIdentification.Mode == SmtpIdentificationMode.HELO) { return(VerifyHelo()); } if (smtpIdentification.Mode == SmtpIdentificationMode.EHLO) { return(VerifyEhlo()); } return(new SmtpResponse(500, "Invalid Identification (" + smtpIdentification.Mode + ")")); }
protected override SmtpResponse ProcessCommandHelo(string name, string arguments) { if (String.IsNullOrWhiteSpace(arguments)) { return SmtpResponses.HeloMissingDomainAddress; } var identification = new SmtpIdentification(SmtpIdentificationMode.HELO, arguments); var response = _responderFactory.IdentificationResponder.VerifyIdentification(SessionInfo, identification); if (response.Success) { SessionInfo.Identification = identification; } return response; }
public virtual SmtpResponse VerifyIdentification(ISmtpSessionInfo sessionInfo, SmtpIdentification smtpIdentification) { if (smtpIdentification == null) { throw new ArgumentNullException("smtpIdentification"); } switch (smtpIdentification.Mode) { case SmtpIdentificationMode.HELO: return(VerifyHelo()); case SmtpIdentificationMode.EHLO: return(VerifyEhlo()); } return(new SmtpResponse(500, "Invalid Identification (" + smtpIdentification.Mode + ")")); }