示例#1
0
 public static Task <int> SendLine(
     this Connection connection,
     string message,
     params object[] args)
 {
     return(connection.SendLine(string.Format(message, args)));
 }
示例#2
0
        public override void Begin(Connection connection)
        {
            _logger = _logger.ForContext("ConnectionId", connection.Id);

            Context = new SmtpContext(connection, new SmtpSession());

            Connection.SendLine("220 {0}", NetworkHelper.GetLocalDnsHostName());
        }
示例#3
0
        protected override void ProcessRequest(string request)
        {
            if (string.IsNullOrWhiteSpace(request))
            {
                return;
            }

            foreach (var command in Commands.IfNullEmpty())
            {
                if (command.Execute(Context, request) == SmtpCommandResult.Done)
                {
                    //_logger.Debug("Executed {CommandType} with {CommandText} {Request}", command.GetType(), commandText, request);
                    return;
                }
            }

            Connection.SendLine("500 Command not recognized");
        }
示例#4
0
 public override void Begin(Connection connection)
 {
     Connection = connection;
     _logger.ForContext("ConnectionId", Connection.Id);
     Connection.SendLine("PAPERCUT");
 }
示例#5
0
 public override void Begin(Connection connection)
 {
     Connection = connection;
     _logger.ForContext("ConnectionId", Connection.Id);
     Connection.SendLine("PAPERCUT");
 }