示例#1
0
 public SmtpSession(SmtpConnection connection, ISmtpResponderFactory responderFactory)
     : base(connection)
 {
     if (responderFactory == null) throw new ArgumentNullException("responderFactory");
     ResponderFactory = responderFactory;
     SessionInfo = new SmtpSessionInfo();
 }
        public SmtpSessionInfoResponder(ISmtpResponderFactory responderFactory, SmtpSessionInfo sessionInfo)
        {
            if (responderFactory == null) throw new ArgumentNullException("responderFactory");
            if (sessionInfo == null) throw new ArgumentNullException("sessionInfo");

            SessionInfo = sessionInfo;
            _responderFactory = responderFactory;
        }
 public SmtpSession(SmtpConnection connection, ISmtpResponderFactory responderFactory)
     : base(connection)
 {
     if (responderFactory == null)
     {
         throw new ArgumentNullException("responderFactory");
     }
     ResponderFactory = responderFactory;
     SessionInfo      = new SmtpSessionInfo();
 }
示例#4
0
        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 + ")"));
        }
示例#5
0
        public SmtpSessionInfoResponder(ISmtpResponderFactory responderFactory, SmtpSessionInfo sessionInfo)
        {
            if (responderFactory == null)
            {
                throw new ArgumentNullException("responderFactory");
            }
            if (sessionInfo == null)
            {
                throw new ArgumentNullException("sessionInfo");
            }

            SessionInfo       = sessionInfo;
            _responderFactory = responderFactory;
        }
示例#6
0
 public SmtpResponse Verify(SmtpSessionInfo sessionInfo, string arguments)
 {
     return(new SmtpResponse(252, "2.5.2 Send some mail, i'll try my best"));
 }
 public SmtpResponse RawLine(SmtpSessionInfo sessionInfo, string line)
 {
     return(SmtpResponse.None);
 }
示例#8
0
 public SmtpResponse VerifyRecipientTo(SmtpSessionInfo sessionInfo, MailAddressWithParameters mailAddressWithParameters)
 {
     return(SmtpResponse.OK);
 }
示例#9
0
 public SmtpResponse Reset(SmtpSessionInfo sessionInfo)
 {
     return(SmtpResponse.OK);
 }
示例#10
0
 public SmtpResponse VerifyMailFrom(SmtpSessionInfo sessionInfo, MailAddressWithParameters mailAddressWithParameters)
 {
     return(SmtpResponse.OK);
 }
示例#11
0
 public SmtpResponse DataEnd(SmtpSessionInfo sessionInfo)
 {
     return SmtpResponse.OK;
 }
示例#12
0
 public SmtpResponse DataLine(SmtpSessionInfo sessionInfo, byte[] lineBuf)
 {
     _mailData.AppendLine(Encoding.UTF8.GetString(lineBuf));
     return SmtpResponse.None;
 }
示例#13
0
 public SmtpResponse DataStart(SmtpSessionInfo sessionInfo)
 {
     return SmtpResponse.DataStart;
 }
 public virtual SmtpResponse DataEnd(SmtpSessionInfo sessionInfo)
 {
     return(SmtpResponse.OK);
 }
 public virtual SmtpResponse DataLine(SmtpSessionInfo sessionInfo, byte[] lineBuf)
 {
     return(SmtpResponse.None);
 }
 public virtual SmtpResponse DataStart(SmtpSessionInfo sessionInfo)
 {
     return(SmtpResponse.DataStart);
 }