An EventMachine daemon for rotating and submitting mail spools to an application for processing.
Calling:
mailroomd start
Configuring:
Configuration is loaded from config.yml in the project directory.
Possible configuration keys:
- mail_spools -- a list of the mail spools to process
- s3 -- a hash of details for the s3 connection
- api -- a hash of details for the api to which the snapshots will be posted
- url -- where to post the snapshot
- username -- basic auth username
- password -- basic auth password
- airbrake_key -- The API key for Airbrake/Hoptoad. Leave out to not report errors
- log_level -- specify the verboseness of the log. Default: INFO
Events:
- Timer tick -> acquire lock
- Lock acquired -> move file
- File moved -> transfer to s3, restart timer
- Transfered to s3 -> Post to API
- Posted to API -> log
Signals:
INT - Immediate stop
TERM - Graceful exit. Finish created snapshots and exit
To Do:
- Make sure locking/moving is enough to safely move files
- Make sure file is not cut in mid-message
- Make sure postfix does not continue to write to the moved file
- Allow config location to passed as an argument
- Don't take new snapshots after TERM (Will currently take one last snapshot)
- Environments?
- Make Hoptoad automatically not send in development
- Change default log level?
- Make Hoptoad dependency optional