Skip to content

Commit

Permalink
Set anonymous until proven otherwise
Browse files Browse the repository at this point in the history
Added readme
  • Loading branch information
Lars committed Sep 11, 2023
1 parent 3dc47cd commit 7806c35
Show file tree
Hide file tree
Showing 4 changed files with 445 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
push: true
tags: |
ghcr.io/scheiblingco/smtp-relay:latest
ghcr.io/scheiblingco/smtp-relay:0.5.4
ghcr.io/scheiblingco/smtp-relay:0.6.1
docker.io/scheibling/smtp-relay:latest
docker.io/scheibling/smtp-relay:0.5.4
docker.io/scheibling/smtp-relay:0.6.1
106 changes: 106 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
![](assets/logo.svg)
# Go SMTP Relay
A minimal SMTP-SMTP Relay written in Go. The main purpose is to have a local relay which authenticates and verifies permissions for sending via a remote SMTP server (e.g. Amazon AWS, SMTP2GO).

## Usage
### Go
Compile the go code (e.g. ```go build -o smtp-relay main.go```) and run the binary

### Docker
There are docker images avaiable on GHCR and Docker Hub
- docker.io/scheiblingco/smtp-relay:latest
- ghcr.io/scheiblingco/smtp-relay:latest

### Configuration
```json
{
"server": {
// Hostname for the server
"host": "smtp.example.com",

// Port to listen on for regular/StartTLS
"listen": ":2525",

// Enable separate SMTPS listener
"smtps": true,

// Listen port for SMTPS
"listenSmtps": ":4650",

// Enable STARTTLS (Requires tlsCert and tlsKey)
"startTls": true,

// Path to TLS Certificate
"tlsCert": "tls.crt",

// Path to TLS Private Key
"tlsKey": "tls.key",

// Allow users with insecure connections (no SSL/TLS/StartTLS)
"allowInsecure": true,

// Timeout for read/write operations
"readTimeout": 10,
"writeTimeout": 10,

// Maximum number of recipients per message
"maxRecipients": 100,

// Maximum message size in MB
"maxMessageSizeMb": 30,

// User credentials
"credentials": {
"all": {
"password": "all",

// Allow all domains
"allowedDomains": []
},
"specific": {
"password": "specific",

// Allow user to send only from the specified domains
"allowedDomains": [
"example.com"
]
}
}
},
// Remote SMTP Server Configuration
"remote": {
// Hostname
"host": "mail.provider.com",

// Port
"port": "25",

// Enable StartTLS
"startTls": true,

// Credentials
"username": "",
"password": "",

// Use PLAIN authentication
"authPlain": false,

// Use LOGIN authentication
"authLogin": false
}
}
```

## Functionality
### Authentication
Authentication with username/password (PLAIN/LOGIN) defined in the json configuration.

### Backend
Any SMTP backend can be used

### Authorization
Set allowed sender domains for each individual account to prevent abuse.

### TLS
Support for StartTLS (regular port) and SMTPS (SMTPS Port, optional).

Loading

0 comments on commit 7806c35

Please sign in to comment.