コード例 #1
0
ファイル: SmtpSession.cs プロジェクト: Snuk/simple.mailserver
 public SmtpSession(SmtpConnection connection, ISmtpResponderFactory responderFactory)
     : base(connection)
 {
     if (responderFactory == null) throw new ArgumentNullException("responderFactory");
     ResponderFactory = responderFactory;
     SessionInfo = new SmtpSessionInfo();
 }
コード例 #2
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;
        }
コード例 #3
0
 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"));
 }
コード例 #7
0
 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;
 }
コード例 #14
0
 public virtual SmtpResponse DataEnd(SmtpSessionInfo sessionInfo)
 {
     return(SmtpResponse.OK);
 }
コード例 #15
0
 public virtual SmtpResponse DataLine(SmtpSessionInfo sessionInfo, byte[] lineBuf)
 {
     return(SmtpResponse.None);
 }
コード例 #16
0
 public virtual SmtpResponse DataStart(SmtpSessionInfo sessionInfo)
 {
     return(SmtpResponse.DataStart);
 }