Skip to content
This repository was archived by the owner on Aug 13, 2018. It is now read-only.

CCI-MIT/Mailhandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailhandler

Build Status

This script allows you to set up a simple email forwarding server using SendGrid's Inbound Parse. You can configure several domains and user names, each forwarding to several emails addresses.

Usage

You can configure the mailhandler by placing a application.yml file in the same directory as your mailhandler.jar.

Configure SMTP server

Mailhandler uses an SMTP server of your choice to send the messages. The default is localhost:8025. You can configure it as follows:

mail:
  smtp:
    host: localhost
    post: 8025
    user: myuser
    pass: mypass
    transport: TLS

You domains can also be configured in the same file. To forward emails received at [email protected] to [email protected] and [email protected], you can use the following configuration:

mail:
  domains:
    - domain: example.com
      mappings: 
        - admin:
          - [email protected]
          - [email protected]

Testing

You can test the application by creating a local tunning using ngrok.

  1. Install ngrok - on macOS with homebrew:
brew cask install ngrok
  1. Create a tunnel to your local instance (by default it's on port 8181):
ngrok http 8181
  1. In the SendGrid dashboard, go to Settings -> Inbound Parse and configure your domain to point the url you received from ngrok, e.g. https://a93b4408.ngrok.io. Make sure you check "Spam check" but not "Send raw". Make sure your domain has the MX record configured to point to SendGrid's servers.

  2. Configure your domain in src/main/resources/application.yml

  3. Send an email to the email you configured, ngrok will allow you to replay the request as often as you want through the web interface running on port 4040.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published