Coder Social home page Coder Social logo

smtp-email-forward's Introduction

smtp-email-forward

This is a simple smtp server that can be hosted in a docker container and be used to forward the email to another address. This project is part of the blog post Simple SMTP server to forward your emails.

Features

  • receive email multiple domains
  • save emails to GCP bucket
  • forward the emails to another address using mailgun

Build and run

# clone the repository
git clone https://github.com/gabihodoroaga/smtp-email-forward.git
# build
cd cmd
go build

In order to run the project you need to create also a GCP bucket

GCP_BUCKET=smtpd-email-forward-123
gsutil mb -c nearline gs://$GCP_BUCKET

and a service account

# create the service account
gcloud iam service-accounts create smtpd-email-forward-123 \
    --description="A service account to write to the bucker" \
    --display-name="smtpd-email-forward-123"
# grab the email
GCP_SERVICE_ACCOUNT=$(gcloud iam service-accounts list --format="value(email)" --filter="displayName=smtpd-email-forward-123")
# give the service account the permission to create objects
gsutil iam ch serviceAccount:$GCP_SERVICE_ACCOUNT:objectCreator gs://$GCP_BUCKET
# create and save the service account key
mkdir certs
gcloud iam service-accounts keys create certs/gcpServiceAccount.json \
  --iam-account $GCP_SERVICE_ACCOUNT

and the service certificates

openssl req -x509 -newkey rsa:4096 -keyout ./certs/server.key -out ./certs/server.crt -days 365 -nodes

In order to test he mailgun integration you need to create a new mailgun account and to setup MAILGUN_DOMAIN and MAILGUN_API_KEY environment variables

Authors

Gabriel Hodoroaga hodo.dev

Referenced projects

TODO

  • add support for SPF validation
  • add support for DKIM validation
  • add options to filter the emails addresses
  • add support for Let's encrypt

smtp-email-forward's People

Contributors

gabihodoroaga avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.