Skip to content

sintax1/o365-email-processor

Repository files navigation

o365 Email Processor

This project provides a service for polling email from Office 365 (via API 1.0) at a regular interval. Each email is stored in a database and sent to user defined actions for processing.

A couple use cases:

  • Preventing malware from running which is embedded within email attachments (pdf, doc, odt) by extracting and forwarding on the text only.
  • Sending email attachments to Cuckoo's scanner via an API before forwarding on the attachment.

Installation

Follow the instructions below to get the Office 365 email processor up and running.

Instructions

  1. Download this project:

    Using git:

    git clone https://github.com/sintax1/o365-email-processor.git
    cd o365-email-processor

    Using wget:

    wget https://github.com/sintax1/o365-email-processor/archive/master.zip
    unzip master.zip
    cd o365-email-processor-master
  2. Install system requirements:

    sudo apt-get install antiword odt2txt libpq-dev python-dev gcc \
        libjpeg-dev libxml2-dev libxslt-dev
  3. Create a virtual environment:

    sudo pip install virtualenv
    virtualenv env
    source env/bin/activate
  4. Install python packages:

    python setup.py build && python setup.py install
  5. Install database backend:

    sudo apt-get install postgresql-9.3
  6. Configure the database. Replace [DB USER] and [DB PASSWORD] with your settings:

    sudo su - postgres
    psql
    postgres=# CREATE DATABASE email_processor;
    postgres=# CREATE USER [DB USER] WITH PASSWORD '[DB PASSWORD]';
    postgres=# GRANT ALL PRIVILEGES ON DATABASE email_processor TO [DB USER];
    postgres=# \q
    exit
  7. Modify config.py for your environment:

    vim config.py # Modify database connection information
  8. Build the database tables:

    fabmanager create-db
  9. Create an admin account:

    fabmanager create-admin
  10. Start the web server:

    python run.py
  11. (Optional, but recommended) Deploy in a production environment: http://flask.pocoo.org/docs/0.10/deploying/

Usage

  1. Login:

    http://<server ip>:8080/login/

image

image

  1. Review/Add any actions for email processing:

    http://<server ip>:8080/actionmodelview/list/

image

image

  1. Configure the system settings:

    http://<server ip>:8080/appsettingsmodelview/list/

image

  1. Query/Analyze emails in the database:

    http://<server ip>:8080/emailmodelview/list/

image

Issues

Please report any bugs or requests that you have using the GitHub issue tracker!

Authors

  • Craig Koroscil

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published