GithubHelp home page GithubHelp logo

harryzcy / mailbox Goto Github PK

View Code? Open in Web Editor NEW
242.0 3.0 15.0 964 KB

Versatile email infrastructure on AWS serverless

License: MIT License

Makefile 0.15% Go 99.20% Shell 0.64%
mailbox aws aws-s3 aws-dynamodb aws-lambda serverless aws-ses go aws-sqs api

mailbox's Introduction

Mailbox

Tests codecov Go Report Card PRs Welcome License: MIT

Docs: English简体中文

Versatile email infrastructure that operates on AWS.

Clients

Web

See mailbox-browser

Dark mode Light mode
Screenshot Dark Mode Screenshot Light Mode

CLI

go install github.com/harryzcy/mailbox-cli

For details, refer to mailbox-cli

Deploy

  1. Clone the repository.

    git clone https://github.com/harryzcy/mailbox
  2. Install serverless.

    npm install -g serverless
  3. Create an IAM user.

    Create an IAM user with AdministratorAccess and export the access key as environment variables.

    export AWS_ACCESS_KEY_ID=<your-key-here>
    export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

    In production, setup the IAM user following this guide from serverless.

  4. Setup AWS services.

    Manually create S3 buckets, and setup SES and SQS (optional) from AWS console.

  5. Copy over example configurations and fill in correct fields.

    cp serverless.yml.example serverless.yml

    Under provider.environment section, modify REGION, S3_BUCKET, SQS_QUEUE (optional, only if SQS should be enabled).

  6. Deploy the app.

    make deploy
  7. Configure email receiving.

    From AWS console -> Configuration -> Email receiving -> Create rule set -> Create rule, add two actions:

    1. Deliver to Amazon S3 bucket, then enter your bucket name.
    2. Invoke AWS Lambda function, and select mailbox-dev-emailReceive or mailbox-prod-emailReceive.
  8. Deploy mailbox-browser or use mailbox-cli.

API

See doc/API.md

Architecture

It runs on AWS services, including SES, Lambda, API Gateway, DynamoDB, and SQS.

Architecture

Contributing

Development environment

  • Go >= 1.21

Note that only the two most recent minor versions of Go are officially supported.

mailbox's People

Contributors

dependabot[bot] avatar harryzcy avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mailbox's Issues

Push new email activities to SQS

Newly received emails may need to be access by on-premise applications. SQS could provide such a record, avoiding scanning the DynamoDB table.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/go.yml
  • actions/checkout v3
  • actions/setup-go v3
  • codecov/codecov-action v3
.github/workflows/golangci-lint.yml
  • actions/setup-go v3
  • actions/checkout v3
  • golangci/golangci-lint-action v3
.github/workflows/linter.yml
  • actions/checkout v3
  • github/super-linter v4
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v5
.github/workflows/release.yml
  • actions/checkout v3
  • release-drafter/release-drafter v5
  • actions/github-script v6
.github/workflows/script.yml
  • actions/checkout v3
  • actions/setup-node v3
gomod
go.mod
  • github.com/aws/aws-lambda-go v1.35.0
  • github.com/aws/aws-sdk-go-v2 v1.17.1
  • github.com/aws/aws-sdk-go-v2/config v1.18.2
  • github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.5
  • github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.6
  • github.com/aws/aws-sdk-go-v2/service/s3 v1.29.3
  • github.com/aws/aws-sdk-go-v2/service/sesv2 v1.15.1
  • github.com/aws/aws-sdk-go-v2/service/sqs v1.19.14
  • github.com/google/uuid v1.3.0
  • github.com/jaytaylor/html2text v0.0.0-20211105163654-bc68cce691ba@bc68cce691ba
  • github.com/jhillyerd/enmime v0.10.1
  • github.com/pkg/errors v0.9.1
  • github.com/stretchr/testify v1.8.1

  • Check this box to trigger a request for Renovate to run again on this repository

manually create the IAM user with least-privilege permissions instead of AdministratorAccess

https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege

What I need to do is just applying these "Actions" right?

iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:BatchGetItem
- dynamodb:BatchWriteItem
Resource: "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
Resource: "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}/index/${self:provider.environment.DYNAMODB_TIME_INDEX}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
Resource: "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}/index/${self:provider.environment.DYNAMODB_ORIGINAL_INDEX}"
- Effect: Allow
Action:
- s3:GetObject
- s3:DeleteObject
Resource: "arn:aws:s3::*:${self:provider.environment.S3_BUCKET}/*"
- Effect: Allow
Action:
- sqs:GetQueueUrl
- sqs:SendMessage
Resource: "arn:aws:sqs:${self:provider.region}:*:${self:provider.environment.SQS_QUEUE}"
- Effect: Allow
Action:
- ses:SendEmail
- ses:SendRawEmail
Resource: "arn:aws:ses:${self:provider.region}:*:identity/*"

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.