class SMTPSession

Defined in:

devmail/smtp_session.cr

Constant Summary

RESPONSES = {211 => "System status, or system help respond", 214 => "Help message", 220 => "Post Office Service ready", 221 => "Post Office Service closing transmission channel", 250 => "Requested mail action okay, completed", 251 => "User not local; will forward to <forward-path>", 354 => "Start mail input; end with <CRLF>.<CRLF>", 421 => "Post Office Service not available,", 450 => "Requested mail action not taken: mailbox unavailable", 451 => "Requested action aborted: error in processing", 452 => "Requested action not taken: insufficient system storage", 500 => "Syntax error, command unrecognized", 501 => "Syntax error in parameters or arguments", 502 => "Command not implemented", 503 => "Bad sequence of commands", 504 => "Command parameter not implemented", 550 => "Requested action not taken: mailbox unavailable", 551 => "User not local; please try <forward-path>", 552 => "Requested mail action aborted: exceeded storage allocation", 553 => "Requested action not taken: mailbox name not allowed", 554 => "Transaction failed"}

Standard SMTP response codes

Constructors

Instance Method Summary

Instance methods inherited from class Session

greet greet, process_command(command : String, full_data : String) process_command, respond(text : String) respond

Constructor methods inherited from class Session

new(client : TCPSocket) new

Constructor Detail

def self.new(client : TCPSocket, store : Store) #

[View source]

Instance Method Detail

def append_data(full_data : String) #

Append data to incoming mail message

full_data == "." indicates the end of the message


[View source]
def data #

Mark client sending data


[View source]
def greet #

Send a greeting to client


[View source]
def mail_from(full_data) #

Store sender address


[View source]
def process_command(command : String, full_data : String) #

[View source]
def quit #

Close connection


[View source]
def rcpt_to(full_data) #

Store recepient address


[View source]
def respond(code : Int) #

Respond with a standard SMTP response code


[View source]
def rset #

Reset current session


[View source]