mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-08-13 17:03:45 -04:00
[#4] Allow sending multiple MAIL FROM: commands per RFC2821
This commit is contained in:
parent
0e58ca6887
commit
73562c77be
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user