Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vodolaz095/msmtpd
Modular SMTP Daemon Framework - toolkit for building email servers
https://github.com/vodolaz095/msmtpd
email-server esmtp-server go golang lmtp rspamd smtp-server starttls
Last synced: about 4 hours ago
JSON representation
Modular SMTP Daemon Framework - toolkit for building email servers
- Host: GitHub
- URL: https://github.com/vodolaz095/msmtpd
- Owner: vodolaz095
- License: mit
- Created: 2023-07-28T20:31:58.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-27T10:54:45.000Z (10 months ago)
- Last Synced: 2024-04-09T23:07:24.638Z (7 months ago)
- Topics: email-server, esmtp-server, go, golang, lmtp, rspamd, smtp-server, starttls
- Language: Go
- Homepage:
- Size: 362 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
msmtpd
=======================[![PkgGoDev](https://pkg.go.dev/badge/github.com/vodolaz095/msmtpd)](https://pkg.go.dev/github.com/vodolaz095/msmtpd?tab=doc)
[![Go Report Card](https://goreportcard.com/badge/github.com/vodolaz095/msmtpd)](https://goreportcard.com/report/github.com/vodolaz095/msmtpd)
[![Go](https://github.com/vodolaz095/msmtpd/actions/workflows/go.yml/badge.svg)](https://github.com/vodolaz095/msmtpd/actions/workflows/go.yml)Golang framework for building Simple Mail Transfer Protocol Daemons.
Фреймворк для создания почтовых серверов, написанный на Go.
Mirrors
=================
- https://gitflic.ru/project/vodolaz095/msmtpd
- https://github.com/vodolaz095/msmtpdMain features
================================1. [Haraka hooks](https://haraka.github.io/core/Plugins#available-hooks) inspired CheckerFunc's being called
on different actions of client (connection, HELO/EHLO command, StartTLS)
2. `StartTLS`, `XClient`, `Proxy` command support
3. Easy to implement logger interface
4. Build-in [OpenTelemetry](https://opentelemetry.io/) support - see [dovecot_inbound](example%2Fdovecot_inbound)
and [dovecot_outbound](example%2Fdovecot_outbound) examples
5. Lot of [plugins](plugins), including:
6. [Dovecot](plugins%2Fdovecot) plugin for authentication and LMTP mail delivery
7. [Rspamd](plugins%2Frspamd) plugin for blocking spam
8. Plugins to deliver via 3rd party [SMTP proxy](plugins%2Fdeliver%2Fsmtp_proxy.go),
[LMTP](plugins%2Fdeliver%2Flmtp.go) and [SendMail](plugins%2Fdeliver%2Fsendmail.go).
9. Experimental [Karma](plugins%2Fkarma) plugin to implement connection scoring (IP addresses making failed SMTP transactions will be blacklisted)
10. HELO/EHLO checkers, including complicated [ones](plugins%2Fhelo)
11. [Sender resolvable](plugins%2Fsender%2Fsender_resolvable.go) checker plugin to ensure sender's domain can accept our repliesExamples / Примеры
================================- [custom_logger](example%2Fcustom_logger)
- [dovecot_inbound](example%2Fdovecot_inbound)
- [dovecot_outbound](example%2Fdovecot_outbound)
- [metrics](example%2Fmetrics)
- [minimal](example%2Fminimal)
- [simple](example%2Fsimple)
- [smtp_proxy](example%2Fsmtp_proxy)Inspiration / Источники вдохновения
=================================- https://github.com/chrj/smtpd (часть кода)
- https://haraka.github.io/ (реализация функционала плагинов, общая идеология)
- https://github.com/albertito/chasquid/ (реализация проверки получателей и авторизации через сокеты Dovecot)Minimal example / Минимальный пример
==================================```go
package main
import (
"log""github.com/vodolaz095/msmtpd"
)func main() {
server := msmtpd.Server{
Hostname: "localhost",
WelcomeMessage: "Do you believe in our God?",
}err := server.ListenAndServe(":1025")
if err != nil {
log.Fatalf("%s : while starting server on 0.0.0.0:1025", err)
}
}```
Server log / Протокол работы сервера
=====================
```
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: Accepting connection from [::1]:34142...
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: EHLO is accepted!
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: MAIL FROM is checked by 0
SenderCheckers and accepted!
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: Recipient will be 1st one in
transaction!
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: Subject: test Wed, 02 Aug 2023 16:30:11 +0300
2023/08/02 16:30:11 INFO [1cca484c18ebe494240b196bc60ee39c]: Body (264 bytes) checked by 0 DataCheckers successfully!
2023/08/02 16:30:11 WARN [1cca484c18ebe494240b196bc60ee39c]: Message silently discarded - no DataHandlers set...
2023/08/02 16:30:12 INFO [1cca484c18ebe494240b196bc60ee39c]: Closing transaction.
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Accepting connection from [::1]:50596...
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: EHLO is accepted!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: MAIL FROM is checked by 0
SenderCheckers and accepted!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Recipient will be 1st one in
transaction!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Recipient will be 2nd one in
transaction!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Recipient will be 2nd one in
transaction!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Recipient will be 4th one in
transaction!
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Subject: test Wed, 02 Aug 2023 16:30:31 +0300
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Body (334 bytes) checked by 0 DataCheckers successfully!
2023/08/02 16:30:31 WARN [4dfe768e04186309306b1af3194b05c4]: Message silently discarded - no DataHandlers set...
2023/08/02 16:30:31 INFO [4dfe768e04186309306b1af3194b05c4]: Closing transaction.
```Client log while testing smtp server / Вывод клиента при тестировании почтового сервера
=====================```shell
$ swaks --to [email protected],[email protected],[email protected],[email protected] \
--from [email protected] \
--server localhost --port 1025 \
--timeout 600
``````
=== Trying localhost:1025...
=== Connected to localhost.
<- 220 Do you believe in our God?
-> EHLO localhost
<- 250-localhost
<- 250-SIZE 10240000
<- 250-8BITMIME
<- 250 PIPELINING
-> MAIL FROM:
<- 250 Ok, it makes sense, go ahead please!
-> RCPT TO:
<- 250 It seems i can handle delivery for this recipient, i'll do my best!
-> RCPT TO:
<- 250 It seems i can handle delivery for this recipient, i'll do my best!
-> RCPT TO:
<- 250 It seems i can handle delivery for this recipient, i'll do my best!
-> RCPT TO:
<- 250 It seems i can handle delivery for this recipient, i'll do my best!
-> DATA
<- 354 Ok, you managed to talk me into accepting your message. Go on, end your data with .
-> Date: Wed, 02 Aug 2023 16:30:31 +0300
-> To: [email protected],[email protected],[email protected],[email protected]
-> From: [email protected]
-> Subject: test Wed, 02 Aug 2023 16:30:31 +0300
-> Message-Id: <20230802163031.059039@localhost>
-> X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/
->
-> This is a test mailing
->
->
-> .
<- 250 Thank you.
-> QUIT
<- 221 Farewell, my friend! Transaction 4dfe768e04186309306b1af3194b05c4 is finished
```Support development / Поддержать разработку
====================
https://www.tinkoff.ru/rm/ostroumov.anatoliy2/4HFzm76801/