Module: Replyr

Defined in:
lib/replyr.rb,
lib/replyr/email.rb,
lib/replyr/config.rb,
lib/replyr/engine.rb,
lib/replyr/version.rb,
lib/replyr/handle_reply.rb,
lib/replyr/handle_bounce.rb,
lib/replyr/reply_address.rb,
lib/replyr/bounce_address.rb,
lib/replyr/address_builder.rb,
lib/generators/replyr/install_generator.rb

Defined Under Namespace

Modules: AddressBuilder, Generators, HandleBounce, HandleReply Classes: BounceAddress, Config, Email, Engine, ReplyAddress

Constant Summary collapse

VERSION =
"0.0.8"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



20
21
22
# File 'lib/replyr.rb', line 20

def config
  @config
end

.loggerObject

Returns the value of attribute logger.



20
21
22
# File 'lib/replyr.rb', line 20

def logger
  @logger
end

Class Method Details

.bounce_patternObject

Regexp for bounce addresses: bounce-newsletter-12-01ce26dc69094af9246ea7e7ce9970aff2b81cc9@bounce.example.com



40
41
42
# File 'lib/replyr.rb', line 40

def bounce_pattern
  /#{config.bounce_prefix}-(?<model_name>[a-z,#]+)-(?<model_id>\d+)-(?<token>\S+)@#{config.bounce_host}/
end

.process(message) ⇒ Object



52
53
54
# File 'lib/replyr.rb', line 52

def process(message)
  Replyr::Email.process(message)
end

.reply_patternObject

Regexp for reply addresses: reply-comment-12-56-01ce26dc69094af9246ea7e7ce9970aff2b81cc9@reply.example.com



33
34
35
# File 'lib/replyr.rb', line 33

def reply_pattern
  /#{config.reply_prefix}-(?<model_name>[a-z,#]+)-(?<model_id>\d+)-(?<user_id>\d+)-(?<token>\S+)@#{config.reply_host}/
end

.routeObject Also known as: address_pattern

Regexp for bounce and reply addresses. Use this as the Replyr route in your mailman-server.



47
48
49
# File 'lib/replyr.rb', line 47

def route
  /#{reply_pattern}|#{bounce_pattern}/
end

.setup_loggerObject



26
27
28
# File 'lib/replyr.rb', line 26

def setup_logger
  @logger = (defined?(Rails) && Rails.logger) ? Rails.logger : Logger.new(STDOUT)
end