Class: Remailer::SMTP::Server::Interpreter
Instance Attribute Summary
Attributes inherited from Interpreter
#delegate, #error, #state
Instance Method Summary
collapse
Methods inherited from Interpreter
config, create_parser_for_spec, default, default_interpreter, default_parser, #error?, #finished?, initial_state, initial_state=, #initialize, #interpret, on_error, on_error_handler, parse, #parse, #parser, #process, state, state_defined?, states, states_default, states_defined, states_empty?, #will_interpret?
Instance Method Details
#check_for_timeout! ⇒ Object
221
222
223
224
225
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 221
def check_for_timeout!
if (self.ttl_expired?)
enter_state(:timeout)
end
end
|
#connection_ttl ⇒ Object
213
214
215
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 213
def connection_ttl
10
end
|
#enter_state(state) ⇒ Object
207
208
209
210
211
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 207
def enter_state(state)
self.reset_ttl!
super(state)
end
|
#reset_transaction! ⇒ Object
Instance Methods =====================================================
#reset_ttl! ⇒ Object
203
204
205
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 203
def reset_ttl!
@timeout_at = Time.now + self.connection_ttl
end
|
#send_banner ⇒ Object
199
200
201
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 199
def send_banner
delegate.send_line("220 #{delegate.server_name} Remailer ESMTP Server Ready")
end
|
#ttl_expired? ⇒ Boolean
217
218
219
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 217
def ttl_expired?
@timeout_at ? (Time.now > @timeout_at) : false
end
|
#will_accept_recipient(recipient) ⇒ Object
231
232
233
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 231
def will_accept_recipient(recipient)
[ true, "250 Accepted" ]
end
|
#will_accept_sender(sender) ⇒ Object
227
228
229
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 227
def will_accept_sender(sender)
[ true, "250 Accepted" ]
end
|
#will_accept_transaction(transaction) ⇒ Object
235
236
237
|
# File 'lib/remailer/smtp/server/interpreter.rb', line 235
def will_accept_transaction(transaction)
[ true, "250 Accepted" ]
end
|