Skip to content

sendanor/imaphub

Repository files navigation

imaphub

IMAP to REST API microservice

Run the server

docker-compose up --build

Run unit tests

docker-compose -f docker-compose.test.yml up --build --abort-on-container-exit

Run system tests

docker-compose -f docker-compose.systemtest.yml up --build --abort-on-container-exit

Running in development mode (and reload on changes)

docker-compose -f docker-compose.dev.yml up --build

Testing the API manually

Sending a message as JSON

curl -i -X POST -H 'Content-Type: application/json' -d '{"subject": "Test email", "from": "[email protected]", "to": "[email protected]", "body": "Hello world"}' http://localhost:4001/v1/messages 

Sending a message as rfc822

curl -i -X POST -H "Content-Type: message/rfc822" --data-binary "@samples/email.eml" http://localhost:4001/v1/messages

Listing messages

curl -i http://localhost:4001/v1/messages

Using Virtual ENV

Opening Python venv on Linux/Mac

python -m venv venv
source venv/bin/activate

Installing new requirements

pip install imaplib

Freeze requirements

pip freeze > requirements.txt

Running Flask in development mode

flask --app app.py --debug run --reload --host=0.0.0.0 --port=4001

Releases

No releases published

Packages

No packages published