SMTP relay for sending emails via the Microsoft Graph API
1.2K
SMTP relay for sending emails via the Microsoft Graph API
Microsoft has, for years, been trying to push everyone away from using SMTP with baisc authentication (username + password), which I completely support. However, not a lot of the open source projects I use have caught on to adding OAuth2 based authentication for sending out email. Heck, even many enterprise level products still require using basic authentication. There are some official work arounds, but all of them involve identity authentication methods that either don't work in many cases (where an IP addess may change frequently) or require disabling certain security policies that can be dangerous.
This service is ideal for developers and organizations looking to integrate email functionalities within their applications hosted on cloud platforms, microservices architectures, or any situation where traditional SMTP access poses challenges. With easy setup, comprehensive documentation, and Docker support, it streamlines the process of sending emails through Microsoft's secure and reliable Graph API, thereby enhancing application communication strategies with minimal overhead.
.env.sample to .env and fill in the necessary environment variables.docker build -t microsoft-graph-smtp-relay.docker run -d --name smtp-relay microsoft-graph-smtp-relayThe .env.sample file contains all necessary used configuration keys with partial examples.
https://login.microsoftonline.com/ to be the AUTHORITY environmental variable.This service can be deployed in container orchestration environments using Docker Compose or Kubernetes. Examples provided in the examples directory demonstrate the configuration needed for each method.
The docker-compose.yaml file in the examples directory provides a template for deploying the SMTP Relay Service as a container. To use it:
examples directory.docker-compose.yaml file as necessary, ensuring environment variables are set according to your specific requirements.docker-compose upThis will pull the necessary image and start the SMTP Relay Service as defined in the Docker Compose configuration.
For deployment in a Kubernetes cluster, the k8s.yaml file offers a detailed manifest for setting up the service. To deploy:
examples directory.k8s.yaml file, adjusting the deployment specifications and environment variables to fit your environment.kubectl apply -f k8s.yamlThis will create the necessary Kubernetes resources (e.g., Deployment, Service) to run the SMTP Relay Service within your cluster.
Both methods provide a scalable and manageable way to incorporate email functionality into your applications, leveraging the power of Microsoft Graph API through the SMTP Relay Service.
The .devcontainer directory contains VS Code and Docker configuration files for setting up a development environment inside a container.
The app directory contains the source code of the service.
Use the provided dockerfile for development and testing.
The test directory includes a basic client script that can be used to test the relay service.
We welcome contributions to this project! Please refer to the LICENSE for more details on contributing and the terms of use.
This project is licensed under the terms of the MIT License. See the LICENSE file for more details.
For support and feature requests, please open an issue in the repository's issue tracker.
Content type
Image
Digest
sha256:41dca1239…
Size
112 MB
Last updated
almost 2 years ago
docker pull pantigon/microsoft-graph-smtp-relay