Aplicacion que monitorea una inbox de outlook/hotmail a traves de IMAP y cuando detecta un email con cierto subject y viniendo de una coleccion de direcciones de email conocidas, ejecuta una accion, por ejemplo: encender el server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
681 B

namespace :monitor do
desc "executes the monitoring logic"
task :run => :environment do
Rails.logger = Logger.new(STDOUT)
Rails.logger.level = Logger::INFO
Rails.logger.info "About to check #{ENV["EMAIL"]} inbox..."
res = MonitorInbox.call!
Rails.logger.info "A total of #{res.analyzed_emails_count} new emails were analyzed"
Rails.logger.info "A total of #{res.actions_executed_count} actions were triggered"
end
desc "deletes all log entries"
task :clear_log => :environment do
Rails.logger = Logger.new(STDOUT)
Rails.logger.level = Logger::INFO
Rails.logger.info "About to clear all log entries"
ActionLog.delete_all
end
end