module Roda::RodaPlugins::MailProcessor::ClassMethods
def rcpt(*addresses, &block)
Any messages matching the given recipient address will use these routing trees instead
Setup a routing tree for the given recipient addresses, which can be strings or regexps.
def rcpt(*addresses, &block) opts[:mail_processor_string_routes] ||= {} opts[:mail_processor_regexp_routes] ||= {} string_meth = nil regexp_meth = nil addresses.each do |address| case address when String unless string_meth string_meth = define_roda_method("mail_processor_string_route_#{address}", 1, &convert_route_block(block)) end opts[:mail_processor_string_routes][address] = string_meth when Regexp unless regexp_meth regexp_meth = define_roda_method("mail_processor_regexp_route_#{address}", :any, &convert_route_block(block)) end opts[:mail_processor_regexp_routes][address] = regexp_meth else raise RodaError, "invalid address format passed to rcpt, should be Array or String" end end nil end