From 67bcf4bc8ae93796831898ff99fc1c58689036ea Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Mon, 29 May 2023 04:03:31 -0600 Subject: [PATCH] Updates to the Postmoogle documentation --- docs/configuring-playbook-bot-postmoogle.md | 37 ++++++++++++++++++- docs/prerequisites.md | 2 - .../matrix-bot-postmoogle/defaults/main.yml | 8 ++-- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/docs/configuring-playbook-bot-postmoogle.md b/docs/configuring-playbook-bot-postmoogle.md index 0fa366935..4d4ba520e 100644 --- a/docs/configuring-playbook-bot-postmoogle.md +++ b/docs/configuring-playbook-bot-postmoogle.md @@ -4,12 +4,29 @@ The playbook can install and configure [Postmoogle](https://gitlab.com/etke.cc/postmoogle) for you. -It's a bot/bridge you can use to forward emails to Matrix rooms +It's a bot/bridge you can use to forward emails to Matrix rooms. +Postmoogle runs an email server through SMTP and allaws you to create mailboxes to the domain you define in the DNS settings. See the project's [documentation](https://gitlab.com/etke.cc/postmoogle) to learn what it does and why it might be useful to you. +## Prerequisites -## Adjusting the playbook configuration +### Ports + +Open the following ports to your server (without it you will not recive email, but you can still send): + - `25/tcp`: SMTP + - `587/tcp`: TLS-encrypted SMTP + +You can change the above default ports through the following variables in the playbook: + +```yaml +# on-host ports +matrix_bot_postmoogle_smtp_host_bind_port: '25' +matrix_bot_postmoogle_submission_host_bind_port: '587' +``` + + +### Adjusting the playbook configuration Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file: @@ -23,6 +40,13 @@ matrix_bot_postmoogle_enabled: true matrix_bot_postmoogle_password: PASSWORD_FOR_THE_BOT ``` +Add an admin to Postmoogle with: +```yaml +matrix_bot_postmoogle_admins: + - '@yourAdminAccount:domain.com' +``` + +### DNS You will also need to add several DNS records so that postmoogle can send emails. See [Configuring DNS](configuring-dns.md). @@ -51,3 +75,12 @@ Then send `!pm mailbox NAME` to expose this Matrix room as an inbox with the ema Send `!pm help` to the room to see the bot's help menu for additional commands. You can also refer to the upstream [documentation](https://gitlab.com/etke.cc/postmoogle). + +### Debug/Logs +In case you need to debug declare: + +```yaml +matrix_bot_postmoogle_loglevel: 'DEBUG' +``` + +And access it through `journalctl -fu matrix-bot-postmoogle` \ No newline at end of file diff --git a/docs/prerequisites.md b/docs/prerequisites.md index 5fa2b1d2a..be60a5f45 100644 --- a/docs/prerequisites.md +++ b/docs/prerequisites.md @@ -40,8 +40,6 @@ If your distro runs within an [LXC container](https://linuxcontainers.org/), you - `5349/udp`: TURN over UDP (used by Coturn) - `8448/tcp`: Matrix Federation API HTTPS webserver. In some cases, this **may necessary even with federation disabled**. Integration Servers (like Dimension) and Identity Servers (like ma1sd) may need to access `openid` APIs on the federation port. - the range `49152-49172/udp`: TURN over UDP - - `25/tcp`: SMTP over TCP (used by Postmoogle) - - `587/tcp`: TLS over TCP (used by Postmoogle) - potentially some other ports, depending on the additional (non-default) services that you enable in the **configuring the playbook** step (later on). Consult each service's documentation page in `docs/` for that. When ready to proceed, continue with [Configuring DNS](configuring-dns.md). diff --git a/roles/custom/matrix-bot-postmoogle/defaults/main.yml b/roles/custom/matrix-bot-postmoogle/defaults/main.yml index 4eeb835be..0c9db2d70 100644 --- a/roles/custom/matrix-bot-postmoogle/defaults/main.yml +++ b/roles/custom/matrix-bot-postmoogle/defaults/main.yml @@ -81,10 +81,10 @@ matrix_bot_postmoogle_maxsize: '1024' # A list of admins # Example set of rules: # matrix_bot_postmoogle_admins: -# - @someone:example.com -# - @another:example.com -# - @bot.*:example.com -# - @*:another.com +# - '@someone:example.com' +# - '@another:example.com' +# - '@bot.*:example.com' +# - '@*:another.com' matrix_bot_postmoogle_admins: "{{ [matrix_admin] if matrix_admin else [] }}" # Sentry DSN. Deprecated, use matrix_bot_postmoogle_monitoring_sentry_dsn