Class: Received::LMTP

Inherits:
Object
  • Object
show all
Defined in:
lib/received/lmtp.rb

Overview

RFC2033

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ LMTP

Returns a new instance of LMTP.



5
6
7
8
9
# File 'lib/received/lmtp.rb', line 5

def initialize(conn)
  @conn = conn
  @state = :start
  @buf = ''
end

Instance Method Details

#on_data(data) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/received/lmtp.rb', line 11

def on_data(data)
  @buf += data
  while line = @buf.slice!(/.*\r\n/)
    line.chomp! unless @state == :data
    event(line)
  end
end

#start!Object



19
20
21
# File 'lib/received/lmtp.rb', line 19

def start!
  event(nil)
end