[#4] Allow sending multiple MAIL FROM: commands per RFC2821

This commit is contained in:
Samuel Cochran 2012-04-06 13:37:13 +08:00
parent 0e58ca6887
commit 73562c77be

View File

@ -1,6 +1,17 @@
require 'eventmachine'
class MailCatcher::Smtp < EventMachine::Protocols::SmtpServer
# We override EM's mail from processing to allow multiple mail-from commands
# per [RFC 2821](http://tools.ietf.org/html/rfc2821#section-4.1.1.2)
def process_mail_from sender
if @state.include? :mail_from
@state -= [:mail_from, :rcpt, :data]
receive_reset
end
super
end
def current_message
@current_message ||= {}
end