Skip to content

Mail Server Template is a generic open-source mail server that has a simple yet powerful design to connect your business with third-party email service providers (like Gmail, Yahoo, or Outlook).

License

Notifications You must be signed in to change notification settings

open-template-hub/mail-server-template

Repository files navigation

Logo

Open Template Hub - Mail Server Template v5

License Issues PRCLosed LastCommit Release SonarCloud

Mail Server Template is a generic open-source mail server that has a simple yet powerful design to connect your business with third-party email service providers (like Gmail, Yahoo, or Outlook).

Ways to Begin

1. Express Deploy

Deploy this template to Heroku

Deploy

2. Start with Server Generator

Create your server with Server Generator Package

NPM

3. GitHub Template

Use this repository as a Template

GitHubTemplate

Installations

Install nodejs and npm via nodejs.org.

Check installed versions of nodejs and npm via running following commands:

node -v
npm -v

Check project's current nodejs and npm version from package.json.

Environment Variables

If you don't give RESPONSE_ENCRYPTION_SECRET, response encryption mechanism will be disabled automatically.

PORT=4006

PROJECT=OTH
MODULE=MailServer
ENVIRONMENT=Local

CLOUDAMQP_APIKEY={MQ Api Key}
CLOUDAMQP_URL={MQ Connection Url}

MAIL_SERVER_QUEUE_CHANNEL=oth_mail_queue
ORCHESTRATION_SERVER_QUEUE_CHANNEL=oth_orchestration_queue

REDISCLOUD_URL={Redis Connection Url}
REDIS_CONNECTION_LIMIT={Redis Connection Limit}

MONGODB_URI={MongoDB Connection Url}
MONGODB_CONNECTION_LIMIT={MongoDB Connection Limit}
    
ACCESS_TOKEN_SECRET={Access Token Secret}
RESPONSE_ENCRYPTION_SECRET={Response Encryption Secret}

DEFAULT_LANGUAGE={LANGUAGE CODE}

Configurations

Example Preconfigured Mail:

{
  "key" : "verifyAccount",
  "from" : "info@opentemplatehub.com",
  "mails" : [ 
      {
        "language" : "en",
        "subject" : "Verify Account",
        "body": "{Verify Account Mail Body}"
      }
  ]
}

If you provide 'to' value to this configuration, POST /sms/me 'to' value will be overwritten.

Mail Service Configurations

This is the list of supported mail providers. Configuring only what you need to use is enough.

  1. Gmail
  2. Outlook
  3. Yahoo

1. GMAIL

Service Configuration

{
    "key" : "GMAIL",
    "payload" : {
        "host" : "{ smtp.gmail.com }",
        "port" : "{ 465 }"
    }
}

Mail Configuration

{
    "provider" : "GMAIL",
    "username" : "{ Username }",
    "password" : "{ Password }"
}

2. OUTLOOK

Service Configuration

{
    "key" : "OUTLOOK",
    "payload" : {
        "host" : "{ smtp-mail.outlook.com }",
        "port" : "{ 587 }",
        "sslV3": true
    }
}

Mail Configuration

{
    "provider" : "OUTLOOK",
    "username" : "{ Username }",
    "password" : "{ Password }"
}

3. YAHOO

Service Configuration

{
    "key" : "YAHOO",
    "payload" : {
        "host" : "{ smtp.mail.yahoo.com }",
        "port" : "{ 465 }"
    }
}

Mail Configuration

{
    "provider" : "YAHOO",
    "username" : "{ Username }",
    "password" : "{ Password }"
}

Custom Mail Service Configurations

For the custom mail service configurations, you can build similar configuration below.

Service Configuration

{
    "key" : "{ Provider Key }",
    "payload" : {
        "host" : "{ smtp.host }",
        "port" : "{ port }"
    }
}

Mail Configuration

{
    "provider" : "{ Provider Key }",
    "username" : "{ Username }",
    "password" : "{ Password }"
}

Contributors


Furkan Yavuz

πŸ’¬ πŸ“– πŸ‘€

Fatih Turker

πŸ’¬ πŸ“– πŸ‘€

Mert Sarac

πŸ’¬ πŸ“– πŸ‘€

Contributing

Refer to CONTRIBUTING.md to see how to contribute to Open Template Hub.


Code of Conduct

Refer to CODE_OF_CONDUCT.md to see contributor covenant code of conduct.


LICENSE

The source code for this project is released under the MIT License.

About

Mail Server Template is a generic open-source mail server that has a simple yet powerful design to connect your business with third-party email service providers (like Gmail, Yahoo, or Outlook).

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published