https://github.com/hyper-prog/restgomail
HTTP-REST Mail gateway written in Go
https://github.com/hyper-prog/restgomail
daemon json mail-agent smtp
Last synced: about 2 months ago
JSON representation
HTTP-REST Mail gateway written in Go
- Host: GitHub
- URL: https://github.com/hyper-prog/restgomail
- Owner: hyper-prog
- License: gpl-2.0
- Created: 2021-02-18T17:27:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-07-04T11:32:57.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T14:24:01.067Z (about 1 year ago)
- Topics: daemon, json, mail-agent, smtp
- Language: Go
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

RestGoMail - HTTP-REST Mail gateway in Go
==========================================
RestGoMail is a small daemon/container which able to receive HTML e-mail forward requests
as HTTP POST in a JSON data, queue the requests, and sends the specified
mails to a SMTP server according to the settings.
Docker images
-------------
Available a docker container with a compiled restgomail daemon:
Docker hub:
- https://hub.docker.com/r/hyperprog/restgomail
Downloadable (pullable) image name:
hyperprog/restgomail
Check the docker-compose.yml file under the EXAMPLES directory to learn how to configure it.
Config file sample (JSON)
-------------------------
You need to give a JSON file as a command line argument to specify
SMTP host and port, the authentications, allowed client certificates and so on...
{
"restgomail": {
"httpsListenPort": "443",
"smtpHost": "smtp.gmail.com",
"smtpPort": "587",
"smtpAuthRequired": true,
"smtpAuthPassword": "gmailpasswordsample",
"smtpAllowedFromAddressOnly": "sampleuser@gmail.com",
"tlsKeyFile": "restgomail.key",
"tlsCertFile": "restgomail.crt",
"allowOnlyKnownCertificates": true,
"knownCertificates": {
"clientOneContainer": "@one_client.crt",
"clientTwoContainer": "MIdjr6RfjfuESwekjEDffg..."
},
"waitSecondsAfterSmtpReq": 10,
"debugMode": false
}
}
E-mail send request sample (JSON)
---------------------------------
This is a sample JSON passed as HTTP-POST request to the 443 port (configured above)
{
"sendmail": {
"from": "sampleuser@gmail.com",
"to": "tomyfriend@postmail.com",
"subject": "This is a test message",
"bodyhtml": "Probably I can say this thing is
WORK'S FLAWLESS!
!"
}
}
You can encode subject and bodyhtml in base64 if the data contains special characters
{
"sendmail": {
"from": "sampleuser@gmail.com",
"to": "tomyfriend@postmail.com",
"subject": "VGVzdCBmcm9tIFBIUA==",
"subjectEncoding": "base64",
"bodyhtml": "VGhpcyBpcyByZWNlaXZlZCB0aHJvdWdoIDxoMT5SZXN0R29NYWlsPC9oMT4=",
"bodyhtmlEncoding": "base64"
}
}