Giter Site home page Giter Site logo

drqc / email Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moogle-cc/email

0.0 0.0 0.0 3.29 MB

Web based email client for AWS SES for your domain. It can be used to send emails from any [email protected]. You can also receive emails sent to [email protected]. Use this client to de-google your life or as a personal mailinator

License: MIT License

JavaScript 84.92% CSS 12.06% HTML 3.02%

email's Introduction

Overview

The tool acts as a domain level email client for AWS SES and can be used to send and receive emails just like you would with Gmail or Outlook. The app is built using React and styles using custom, handwritten css.

Here's what the inbox looks like live. Moogle Inbox Screenshot

Full Disclosure - the search function does not work at all. The search box is just for decorative purposes for now. To be fait, I haven't missed it all that much since I've been using my own inbox. The comments function is also broken right now but I will be fixing it soon.

To function correctly, the client relies on three APIs. The APIs are covered in more detail later.

  1. LIST [GET] - returns a list of the most recent N emails (newest first) received by AWS SES on your domain
  2. EMAIL [GET] - returns the contents of the eml file received by AWS in JSON format
  3. SEND [POST] - POSTs a JSON object containing all the details necessary to send a raw email via SES

If you want to build a read-only inbox, remove support for the last API

Security

This client is secured using AWS Cognito

Flow

Logging in

  1. User visits the url on which this email client is running
  2. User is redirected to AWS Cognito to login
  3. Cognito redirects the user back to the url in step 1 along with id_token and access_token
  4. App extracts id_token and access_token and saves it in localstorage (not ideal, TO-DO: needs to be stored somewhere safer)

Reading emails

  1. Using the id_token as the Authorization: header, the app queries the LIST api to download the most recent emails
  2. Then, using the EMAIL api, it downloads the contents of each email to determine which email address the email was sent to
  3. Then, it creates BUCKETS on the client side. The name of each bucket is the unique email address on which you received emails. Recall that this is a domain level inbox client so if you received emails send to [email protected] and [email protected], the client will show you two buckets - Gym and Shopping
  4. There are three default buckets called ALL, SPAM, and SENT - ALL shows all emails, SPAM shows emails suspected to be spam, and SENT shows emails sent by you or anyone else using your domain's email client

Sending emails

  1. The client comes with a built-in email composer built using jodit-react
  2. Emails are dispatched using the SEND api using AWS SES's send-raw-email endpoint
  3. If you are replying to a received email, the client calls the SEND api with an extra value - References <mesage-id> where <message-id> is the id of the message to which you are replying. The API uses this value to include the References and In-Reply-To headers while calling send-raw-email
  4. By default, each email is also BCC-ed to a secret inbox so that you can review your SENT emails later

APIs

  1. LIST - this GET API returns a list of most recently received emails. API endpoint is EMAILS_LIST_URL in constants.js. @domain: domain name on which emails are received E.g., ramachandr.in @folderpath: /path/to/folder containing the raw eml files Returns list of eml file ids

  2. EMAIL - this GET API returns the content of a single eml file. API endpoint is EMAILS_CONTENT_URL in constants.js. @domain: domain name on which emails are received E.g., ramachandr.in @id: path/to/emlfiles/abcdefghi1234567890 Returns the contents of the email file as a JSON object as parsed by nodemailer

  3. SEND - this POST API calls the lambda which sends raw emails on our behalf. API endpoint is EMAILS_CONTENT_URL in constants.js. @domain: domain name on which emails are received E.g., ramachandr.in Returns success or failure status of request to send email. Email sending happens synchronously.

email's People

Contributors

neelesh17 avatar saiorama 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.