Sign inSign up

valuabletouch/smtp-relay

By valuabletouch

•Updated about 5 years ago

A simple SMTP server which works as a relay.

Image
0

634

valuabletouch/smtp-relay repository overview

⁠SMTP Relay

A simple SMTP server which works as a relay.

⁠Usage

Install dependencies:

yarn install

Start server:

yarn start

You need to set required environment variables before starting server or set the variables on src/index.js⁠ directly.

⁠Docker Build Status

You can use this sample docker-compose file:

version: '3.5'

services:
  smtp-relay:
    image: valuabletouch/smtp-relay
    environment:
      - LISTEN_PORT=465
      - LISTEN_AUTH_REQUIRED=1
      - LISTEN_USER=smtp
      - LISTEN_PASS=smtp
      - LISTEN_SERVER_NAME=my-smtp-server
      - [email protected]
      - SEND_HOST=smtp.example.com
      - SEND_PORT=465
      - SEND_AUTH_TYPE=login
      - SEND_USER=usename
      - SEND_PASS=password
      - SEND_POOLING=1
    ports:
      - 465:465

⁠All Environment Variables
VariableDefault ValueDescription
LISTEN_HOST0.0.0.0Relay server host to listen
LISTEN_PORT25Relay server port to listen
LISTEN_SECURED0If set to 1 then relay server will use TLS. A volume must be mounted containing key and certificate files, also LISTEN_KEY_PATH and LISTEN_CERT_PATH values must be supported
LISTEN_KEY_PATHnullFile path for key file
LISTEN_CERT_PATHnullFile path for certificate file
LISTEN_AUTH_REQUIRED0If set to 1 then relay server will require authentication. LISTEN_USER and LISTEN_PASS values must be supported
LISTEN_USERnullRelay server authentication username
LISTEN_PASSnullRelay server authentication password
LISTEN_SERVER_NAMEos.hostname()Relay server hostname, used for identifying to the client
LISTEN_BANNERnullRelay server greeting message. This message is appended to the default ESMTP response.
LISTEN_MAX_SIZEInfinityRelay server maximum allowed message size in bytes
LISTEN_SIZE_HIDDEN0If set to 0 then does not expose the max allowed size to the client but keeps size related values like stream.sizeExceeded
LISTEN_MAX_CLIENTS50Relay server maximum number of concurrently connected clients
LISTEN_SOCKET_TIMEOUT60000How many milliseconds of inactivity to allow before disconnecting the client on relay server
LISTEN_CLOSE_TIMEOUT30000How many millisceonds to wait before disconnecting pending connections once relay server close has been called
SEND_FROMnullSend e-mail from address
SEND_AUTH_TYPEloginSend e-mail authetication type
SEND_HOSTnullSend e-mail SMTP host
SEND_PORT25Send e-mail SMTP port
SEND_USERnullSend e-mail authentication username
SEND_PASSnullSend e-mail authentication password
SEND_CLIENT_IDnullSend e-mail authentication client_id, usually required when authetication type is oauth2
SEND_CLIENT_SECRETnullSend e-mail authentication client_secret, usually required when authetication type is oauth2
SEND_REFRESH_TOKENnullSend e-mail authentication refresh_token, used when authetication type is oauth2
SEND_ACCESS_URLnullSend e-mail HTTP endpoint for requesting new access tokens, used when authetication type is oauth2
SEND_POOLING0If set to 1 then use pooled connections instead of creating a new connection for every email when sending e-mail
SEND_RATE_DELTA60000Defines the time measuring period in milliseconds for rate limiting
SEND_RATE_LIMIT75Limits the message count to be sent in SEND_RATE_DELTA time. Once SEND_RATE_LIMIT is reached, sending is paused until the end of the measuring period. This limit is shared between connections, so if one connection uses up the limit, then other connections are paused as well. If SEND_RATE_LIMIT is not set then sending rate is not limited
SEND_MAX_CONNECTIONS5The count of maximum simultaneous connections to make against the SMTP server when sending e-mail
SEND_MAX_MESSAGES_PER_CONNECTION100Limits the message count to be sent using a single connection when sending e-mail. After maxMessages is reached the connection is dropped and a new one is created for the following messages

⁠License

MIT⁠

Tag summary

Content type

Image

Digest

Size

336.7 MB

Last updated

about 5 years ago

docker pull valuabletouch/smtp-relay