Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
Replacing SMTP codes to fit RFC 2821
Browse files Browse the repository at this point in the history
  • Loading branch information
hron84 committed Jan 12, 2013
1 parent 39f4d24 commit a2e1778
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mini-smtp-server/mini-smtp-server.rb
Expand Up @@ -31,16 +31,16 @@ def process_line(line)
# Handle specific messages from the client
case line
when (/^(HELO|EHLO)/)
return "220 go on...\r\n"
return "250 #{Socket.gethostname} go on...\r\n"
when (/^QUIT/)
Thread.current[:connection_active] = false
return ""
when (/^MAIL FROM\:/)
Thread.current[:message][:from] = line.gsub(/^MAIL FROM\:/, '').strip
return "220 OK\r\n"
return "250 OK\r\n"
when (/^RCPT TO\:/)
Thread.current[:message][:to] = line.gsub(/^RCPT TO\:/, '').strip
return "220 OK\r\n"
return "250 OK\r\n"
when (/^DATA/)
Thread.current[:data_mode] = true
return "354 Enter message, ending with \".\" on a line by itself\r\n"
Expand All @@ -52,7 +52,7 @@ def process_line(line)
if((Thread.current[:data_mode]) && (line.chomp =~ /^\.$/))
Thread.current[:message][:data] += line
Thread.current[:data_mode] = false
return "220 OK\r\n"
return "250 OK\r\n"
end

# If we are in date mode then we need to add
Expand All @@ -69,4 +69,4 @@ def process_line(line)

def new_message_event(message_hash)
end
end
end

0 comments on commit a2e1778

Please sign in to comment.