Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supme/smtprelay
small SMTP relay
https://github.com/supme/smtprelay
email go golang relay smtp
Last synced: 11 days ago
JSON representation
small SMTP relay
- Host: GitHub
- URL: https://github.com/supme/smtprelay
- Owner: Supme
- License: mit
- Created: 2017-12-01T13:05:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T07:47:29.000Z (almost 6 years ago)
- Last Synced: 2024-06-21T20:52:19.504Z (5 months ago)
- Topics: email, go, golang, relay, smtp
- Language: Go
- Homepage:
- Size: 22.6 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smtpRelay
small SMTP relay[![Go Report Card](https://goreportcard.com/badge/github.com/Supme/smtpRelay)](https://goreportcard.com/report/github.com/Supme/smtpRelay)
[Download binary](https://github.com/Supme/smtpRelay/releases)
example config.ini
``` $ini
# Db for queue emails
QueueDbDialect = "mssql"
QueueDbConnect = "server=127.0.0.1;user id=SmtpRelayLog;password=pa55w0rd;database=SmtpRelayLog;connection timeout=300"# Db for log
StatusDbDialect = "mssql"
StatusDbConnect = "server=127.0.0.1;user id=SmtpRelayLog;password=pa55w0rd;database=SmtpRelayLog;connection timeout=300"Hostname = "localhost" # hostname for HELO, if blank, then get mashine hostname
AllowIP = ["127.0.0.1", "192.168.1.20"] # allow sender IP
AllowDomains = ["dmbasis.ru"] # allow send email domain
SMTPListenAddr = ":2500" # SMTP server listen on (example: "127.0.0.1:2500")
SendStream = 10
ResendStream = 2MaxRepeatSend = 2
RepeatIntervalMinutes = 5Debug = false
```execute with default config file ./config ini
```
./smtpRelay
```or change config file path
```
./smtpRelay -c /path/to/youconfig.ini
```For run as service in Windows use [NSSM](http://nssm.cc/download)
in log database create table "statuses" structure
| id | queued_at | sending_at | from | rcpt | message_type | message_id | status |
|----|:-----------:|:------------:|:------:|:------:|:------------:|:------------:|--------:|message_type is string from "X-Postmaster-Msgtype" header
message_id is string from "Message-Id" header
in queue database create table "queues" structure
| id | created_at | updated_at | message_type | message_id | from | from_hostname | rcpt | rcpt_hostname | data | repeat | later_status|
|----|:-----------:|:------------:|:------:|:------:|:------:|:------------:|:------------:|:------------:|:------------:|:------------:|--------:|