public static Task <int> SendLine( this Connection connection, string message, params object[] args) { return(connection.SendLine(string.Format(message, args))); }
public override void Begin(Connection connection) { _logger = _logger.ForContext("ConnectionId", connection.Id); Context = new SmtpContext(connection, new SmtpSession()); Connection.SendLine("220 {0}", NetworkHelper.GetLocalDnsHostName()); }
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"); }
public override void Begin(Connection connection) { Connection = connection; _logger.ForContext("ConnectionId", Connection.Id); Connection.SendLine("PAPERCUT"); }