Class: DoroParser::Parser::SMTP
- Inherits:
-
Object
- Object
- DoroParser::Parser::SMTP
- Defined in:
- lib/dorothy2/DEM.rb
Overview
todo to redo
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#hcmd ⇒ Object
readonly
Returns the value of attribute hcmd.
-
#hcont ⇒ Object
readonly
Returns the value of attribute hcont.
-
#rdata ⇒ Object
Returns the value of attribute rdata.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(a) ⇒ SMTP
constructor
A new instance of SMTP.
Constructor Details
#initialize(a) ⇒ SMTP
Returns a new instance of SMTP.
88 89 90 91 92 93 |
# File 'lib/dorothy2/DEM.rb', line 88 def initialize a if a =~ /(MAIL FROM: |EHLO |HELO |TO: |RSET)(.*)\n/ @hcmd = $1 @hcont = $2 end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
60 61 62 |
# File 'lib/dorothy2/DEM.rb', line 60 def body @body end |
#hcmd ⇒ Object (readonly)
Returns the value of attribute hcmd.
58 59 60 |
# File 'lib/dorothy2/DEM.rb', line 58 def hcmd @hcmd end |
#hcont ⇒ Object (readonly)
Returns the value of attribute hcont.
59 60 61 |
# File 'lib/dorothy2/DEM.rb', line 59 def hcont @hcont end |
#rdata ⇒ Object
Returns the value of attribute rdata.
61 62 63 |
# File 'lib/dorothy2/DEM.rb', line 61 def rdata @rdata end |
Class Method Details
.body(data) ⇒ Object
63 64 65 66 |
# File 'lib/dorothy2/DEM.rb', line 63 def self.body(data) email = TMail::Mail.parse(data) return email end |
.hasbody?(data) ⇒ Boolean
74 75 76 77 78 |
# File 'lib/dorothy2/DEM.rb', line 74 def self.hasbody?(data) if data =~ /from(.*)From(.*)Subject/m return true end end |
.header?(data) ⇒ Boolean
68 69 70 71 72 |
# File 'lib/dorothy2/DEM.rb', line 68 def self.header?(data) if data =~ /(MAIL FROM: |EHLO |HELO |TO: |RSET)(.*)\n/ return true end end |
.response(data) ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/dorothy2/DEM.rb', line 80 def self.response(data) if data =~ /(\d*)(.*)\n/ rcode = $1 rcont = $2 return rcode, rcont end end |