a0576549625232fda33bbeea95be0aa4ee3880eb
Checking using `settings.Allowed` is odd. Not all commands are related to setting configuration settings. Admin commands are coming in the future, for which this is certainly not the case. We now do access checks early on (during command processing), so command handlers can be clean of access checks. If we're inside of a command handler, the user is privileged to run it.
Postmoogle 

An Email to Matrix bridge
Roadmap
Receive
- SMTP server
- Matrix bot
- Configuration in room's account data
- Receive emails to matrix rooms
- Receive attachments
- 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
- 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
other optional config parameters
- 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 - POSTMOOGLE_ADMINS - a space-separated list of admin users. See
POSTMOOGLE_USERSfor syntax examples
You can find default values in config/defaults.go
Usage
How to start
- Invite the bot into a room you want to use as mailbox
- Read the bot's introduction
- Set mailbox using
!pm mailbox NAMEwhereNAMEis part of email (e.g.NAME@example.com) - Done. Mailbox owner and other options will be set automatically when you configure mailbox.
If you want to change them - check available options in the help message (
!pm help)
Full list of available commands
- !pm help - Show help message
- !pm stop - Disable bridge for the room and clear all configuration
- !pm mailbox - Get or set mailbox of the room
- !pm owner - Get or set owner of the room
- !pm nosender - Get or set
nosenderof the room (true- hide email sender;false- show email sender) - !pm nosubject - Get or set
nosubjectof the room (true- hide email subject;false- show email subject) - !pm nohtml - Get or set
nohtmlof the room (true- ignore HTML in email;false- parse HTML in emails) - !pm nothreads - Get or set
nothreadsof the room (true- ignore email threads;false- convert email threads into matrix threads) - !pm nofiles - Get or set
nofilesof the room (true- ignore email attachments;false- upload email attachments)
Where to get
Description
Languages
Go
98.6%
Just
1.1%
Dockerfile
0.2%