Project

rockdove

0.0
No commit activity in last 3 years
No release in over 3 years
Incoming mail processing daemon for Exchange Web Services (EWS). This is the Ruby Gem that does fetching, parsing and watching the exchange mail box for further processing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.2.2
>= 0

Runtime

 Project Readme

rockdove rockdove Code Climate

Incoming mail processing daemon for Exchange Web Services 1.0 (EWS). This Ruby Gem connects to the EWS mailbox, fetches the mail items, parses each mail item (Signatures, Replies, Forward), handles bounce types (Undeliverable,AutoReply) and polls the mailbox for every interval specified.

It provides a template of the rockdove server which is a simple plug and play daemon.

Installation

#Under Gemfile
gem "rockdove", "~> 0.3.1", :require => false

#After bundle install, run this command below
bundle exec rails g rockdove:install

It copies a template of rockdove server under you script folder which contains the following snippet:

# ...

Rockdove::Config.configure do |config| 
  config.ews_url 'https://ewsdomain.com/ews/exchange.asmx'
  config.ews_username 'ews_username'
  config.ews_password 'ews_password'
  config.ews_folder 'Inbox' # ews_folder is Inbox by default
  # by default, it deletes the mail after processing, 
  # mention ews_archive_folder if it has to be archived to a different folder
  config.ews_archive_folder 'Archive'
  config.ews_watch_interval 60 # by default, the polling interval is 60
end

# ...

Rockdove::CollectMail.watch do |rockdove_parsed_mail|
  begin
    Model.method(rockdove_parsed_mail)
    # As per your application requirements, refer the options that you can play with here,
    # http://rdoc.info/github/kiranh/rockdove/Rockdove/ExchangeMail
  rescue Exception => e
    Rockdove.logger.error "Exception occurred while receiving message:#{rockdove_parsed_mail}"
    Rockdove.logger.error [e, *e.backtrace].join("\n")
  end
end

You need to change the Model into the one being used in your project that would require this behavior of Mail Processing for Exchange Web Services 1.0 and further process the mail as per the requirements in your project.

  • And then you can run the script in console mode, ^C will stop it, calling the stop method
$ ruby ./script/rockdove_server.rb start #from your project root
  • or run it daemonized, by default ./rockdove_server.log and ./rockdove_server.pid will be created
$ ruby ./script/rockdove_server.rb  -d start
  • you can stop the daemon, removing ./rockdove_server.pid or
$ ruby ./script/rockdove_server.rb stop

Compatibility

Tested on all Ruby versions (1.8.7, 1.9.2, 1.9.3) with Travis CI.

Contributors

Welcome for any code optmizations or issue fixes or enhancements

Setup:

  git clone git@github.com:kiranh/rockdove.git
  cd rockdove
  bundle exec rake # to run tests or bundle exec guard

Copyright

Copyright (c) 2012-2015 Kiran Soumya Bosetti. See LICENSE for details.