It seems EventMachine already does this for us

This commit is contained in:
Samuel Cochran 2013-05-05 15:27:41 +10:00
parent 1241446fa0
commit 808ada7a3b

View File

@ -34,10 +34,7 @@ class MailCatcher::Smtp < EventMachine::Protocols::SmtpServer
def receive_data_chunk(lines)
current_message[:source] ||= ""
lines.each do |line|
# RFC821 4.5.2 says leading periods should be stripped from the body data.
current_message[:source] << line.sub(/\A\./, "") << "\n"
end
current_message[:source] << lines.join("\n")
true
end