Class: MailCommand
- Inherits:
-
Struct
- Object
- Struct
- MailCommand
- Defined in:
- lib/drillmail/commands/mail.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
1 2 3 |
# File 'lib/drillmail/commands/mail.rb', line 1 def body @body end |
#session ⇒ Object
Returns the value of attribute session
1 2 3 |
# File 'lib/drillmail/commands/mail.rb', line 1 def session @session end |
Instance Method Details
#call ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/drillmail/commands/mail.rb', line 2 def call # MAIL <SP> FROM:<reverse-path> <CLRF> if session.domain if reverse_path_match = /FROM:<(.+)>/.match(body) session.reverse_path = reverse_path_match[1] session.reply(250) else session.reply(501) end else session.reply(451) end end |