Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kannon-email/kannon
✉️ Cloud-Native massive mail sender for Kubernetes!
https://github.com/kannon-email/kannon
email hacktoberfest open-source-saturday smtp
Last synced: 4 days ago
JSON representation
✉️ Cloud-Native massive mail sender for Kubernetes!
- Host: GitHub
- URL: https://github.com/kannon-email/kannon
- Owner: kannon-email
- License: apache-2.0
- Created: 2021-01-03T09:01:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-12T14:01:26.000Z (4 months ago)
- Last Synced: 2024-08-01T13:30:12.429Z (3 months ago)
- Topics: email, hacktoberfest, open-source-saturday, smtp
- Language: Go
- Homepage:
- Size: 4.26 MB
- Stars: 65
- Watchers: 5
- Forks: 10
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - kannon-email/kannon - ✉️ Cloud-Native massive mail sender for Kubernetes! (Go)
README
# Kannon 💥
[![CI](https://github.com/gyozatech/kannon/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/gyozatech/kannon/actions/workflows/ci.yaml)
![alt text](assets/kannonlogo.png?raw=true)
A Cloud Native SMTP mail sender
> Due to limitations of AWS, GCP etc. on port 25 this project will not work on cloud providers that block port 25.
Tested on kubernello
## TODO
- Add GUI and User in React
- Manage Statistics
- Manage Templates
- Enable Templating
- Enable multiple node sending## Deplyoment with Kubernetes
You can deploy the project using the kubernetes manifests in the [k8s](./k8s/deployment.yaml) folder.
Example config:
```yaml
nats_url: nats://nats:4222
debug: truedatabase_url: postgres://postgres:password@postgres:5432/kannon?sslmode=disable
api:
port: 50051sender:
hostname: your-hostname
max_jobs: 100
```## Server Configuration
The SMTP server need to be configured in order to work properly.
1. Choose a SENDER_NAME setting an env variable in [./k8s/sender.yaml](./k8s/sender.yaml). In my example, this is `mailer.gyozatech.space`. This should be a subdomain in your posses (you need to set some DNS records).
2. Set a reverse DNS record FROM your server IP -> TO SERVER_NAME
3. Set a A record FROM your SENDER_NAME domaint -> TO your server IP
4. Set a TXT record from your SENDER_NAME -> `v=spf1 ip4: -all`## Create a New Sender Domain
Using `api` service and [api.proto](./proto/api.proto) you can create a New Domain in the system.
A domain should be a subdomain of the main domain you want to send the emails.
E.g., if you want to send email form `[email protected]` you can choose a subdomain of `test.space`, e.g. `mail.test.space`.Create the domain using the `createDomain` method
```
# Request
{
"domain": "sending.gyozatech.space"
}# Response
{
"domain": "sending.gyozatech.space",
"key": "xxxxxxxxxx",
"dkimPubKey": "xxxxxxx"
}
```This will generate a domain, with an api access key and a dkimPublicKey.
DNS record:
- TXT record for DKIM `smtp._domainkey.` -> `k=rsa; p=`
- TXT record for SPF `` -> `v=spf1 include: ~all`When DNS record will be propagated, you are ready to start sending emails.
## Sending Mail
You can send emails using the mailer api and the [mailer.proto](./proto/mailer.proto) file.
You need to authenticate to this api using Basic authentication.Create token for authentication:
`token = base64(:)`
Then, in the `SendHTML` endpoint, pass a Metadata with
```json
{
"Authorization": "Basic "
}
```Example CALL
```
# Request
{
"sender": {
"email": "[email protected]",
"alias": "Ludovico"
},
"to": [
"[email protected]",
"[email protected]"
],
"subject": "Test",
"html": "ciao
prova
"
}# Reponse
{
"messageID": "message/[email protected]",
"templateID": "tmp-template/[email protected]",
"scheduled_time": {
"seconds": "1609668627",
"nanos": 905726068
}
}
```You should receive a mail that passes DKIM and SPF check.
![Signed Email](assets/email-sign.png)