Class: RecipientCommand
- Inherits:
-
Struct
- Object
- Struct
- RecipientCommand
- Defined in:
- lib/drillmail/commands/recipient.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/recipient.rb', line 1 def body @body end |
#session ⇒ Object
Returns the value of attribute session
1 2 3 |
# File 'lib/drillmail/commands/recipient.rb', line 1 def session @session end |
Instance Method Details
#call ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/drillmail/commands/recipient.rb', line 2 def call # RCPT <SP> TO:<forward-path> <CRLF> return session.reply(451) unless session.reverse_path forward_path = /TO:<(.+)>/.match(body)[1] return session.reply(501) unless forward_path return session.reply(551, forward_path) unless Dir. exists?("./#{forward_path}") session.forward_path = forward_path session.reply(250, 'added recipient') end |