This does not do anything useful just yet. It will be hooked to access control checks later on. Wildcards are converted to regular expressions, because it was simpler to do that than to write (or include) some ugly wildcard matcher library. It also provides more flexibility, should we wish to use it later. Regular expressions should also work well performance-wise. We compile wildcards to regexes early on (during configuration processing) and fail if we detect a bad pattern. This is meant to catch various problems (typos or other mistakes) that could happen. For this to work, configuration building had to be redone, since it can now return an error. This may be useful in the future for validating other configuration settings. Related to https://gitlab.com/etke.cc/postmoogle/-/issues/1
54 lines
2.4 KiB
Markdown
54 lines
2.4 KiB
Markdown
# Postmoogle [](https://matrix.to/#/#postmoogle:etke.cc)[](https://ko-fi.com/etkecc) [](https://gitlab.com/etke.cc/postmoogle/-/commits/main) [](https://goreportcard.com/report/gitlab.com/etke.cc/postmoogle) [](https://pkg.go.dev/gitlab.com/etke.cc/postmoogle)
|
|
|
|
> [more about that name](https://finalfantasy.fandom.com/wiki/The_Little_Postmoogle_That_Could)
|
|
|
|
An Email to Matrix bridge
|
|
|
|
## Roadmap
|
|
|
|
### Receive
|
|
|
|
- [x] SMTP server
|
|
- [x] Matrix bot
|
|
- [x] Configuration in room's account data
|
|
- [x] Receive emails to matrix rooms
|
|
- [x] Receive attachments
|
|
- [x] Map email threads to matrix threads
|
|
|
|
### Send
|
|
|
|
- [ ] SMTP client
|
|
- [ ] Reply to matrix thread sends reply into email thread
|
|
- [ ] Send a message to matrix room with special format to send a new email
|
|
|
|
## Configuration
|
|
|
|
env vars
|
|
|
|
### mandatory
|
|
|
|
* **POSTMOOGLE_HOMESERVER** - homeserver url, eg: `https://matrix.example.com`
|
|
* **POSTMOOGLE_LOGIN** - user login/localpart, eg: `moogle`
|
|
* **POSTMOOGLE_PASSWORD** - user password
|
|
* **POSTMOOGLE_DOMAIN** - SMTP domain to listen for new emails
|
|
* **POSTMOOGLE_PORT** - SMTP port to listen for new emails
|
|
|
|
### optional
|
|
|
|
* **POSTMOOGLE_NOOWNER** - allow change room settings by any room partisipant
|
|
* **POSTMOOGLE_FEDERATION** - allow usage of Postmoogle by users from others homeservers
|
|
* **POSTMOOGLE_NOENCRYPTION** - disable encryption support
|
|
* **POSTMOOGLE_STATUSMSG** - presence status message
|
|
* **POSTMOOGLE_SENTRY_DSN** - sentry DSN
|
|
* **POSTMOOGLE_LOGLEVEL** - log level
|
|
* **POSTMOOGLE_DB_DSN** - database connection string
|
|
* **POSTMOOGLE_DB_DIALECT** - database dialect (postgres, sqlite3)
|
|
* **POSTMOOGLE_MAXSIZE** - max email size (including attachments) in megabytes
|
|
* **POSTMOOGLE_USERS** - a space-separated list of whitelisted users allowed to use the bridge. If not defined, everyone is allowed. Example rule: `@someone:example.com @another:example.com @bot.*:example.com @*:another.com`
|
|
|
|
You can find default values in [config/defaults.go](config/defaults.go)
|
|
|
|
## Where to get
|
|
|
|
[docker registry](https://gitlab.com/etke.cc/postmoogle/container_registry), [etke.cc](https://etke.cc)
|