Skip to content

koenjdejong/LocalMailHandler

Repository files navigation

LocalMailHandler


Created by: Koen de Jong


Description

This is an email handler that can be used by other programs to send emails. Authentication is done using API keys, that can be generated by the user using src/api_key_generator.

Requirements

Install the following tools with pip3:

  1. google-api-python-client
  2. google-auth-httplib2
  3. google-auth-oauthlib
  4. Flask
  5. flask-cors
  6. honeybadger

Usage

Google API Credentials

Before being able to use this tool, you need to have a Gmail or Google Suite account. You can create one by following the instructions:

  1. Go to the API Developer Console
  2. Create a new project
  3. Go to credentials and create new OAuth client credentials
  4. Download the JSON file and save it to your project directory as credentials.json

Honeybadger API Key

You can generate an API key by following the instructions:

  1. Go to the Honeybadger
  2. Sign in or create an account.
  3. Create a project and copy the API key to the clipboard.

Configuration

  1. Rename the example_config.json the file config.json in your project directory
  2. Fill in the fields to your liking and remove the descriptive part.

Running the API

With a working configuration, you can run python with the following argument: run.py This can be done in the terminal in any of the following options, depending on your setup:

python run.py

python3 run.py

source venv/bin/activate
python run.py

Docker

To run docker, you need to create the image yourself with the credentials, config and token.pickle all setup correctly. Map container port 80 to a port of your liking and your good to go!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published