From 90d25bccd274b2edb89876da7ec090730f9441a9 Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Mon, 29 May 2023 03:10:07 -0600 Subject: [PATCH 1/3] Update prerequisites.md These ports need to be open in order to receive emails to the Postmoogle bridge --- docs/prerequisites.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/prerequisites.md b/docs/prerequisites.md index be60a5f45..5fa2b1d2a 100644 --- a/docs/prerequisites.md +++ b/docs/prerequisites.md @@ -40,6 +40,8 @@ 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). From 67bcf4bc8ae93796831898ff99fc1c58689036ea Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Mon, 29 May 2023 04:03:31 -0600 Subject: [PATCH 2/3] 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 From 127b60a1cec2c12623ce7637c2f18ab123a2af0b Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 30 May 2023 09:09:24 +0300 Subject: [PATCH 3/3] Fixing typos and rewording --- docs/configuring-playbook-bot-postmoogle.md | 40 +++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/docs/configuring-playbook-bot-postmoogle.md b/docs/configuring-playbook-bot-postmoogle.md index 4d4ba520e..b66285a51 100644 --- a/docs/configuring-playbook-bot-postmoogle.md +++ b/docs/configuring-playbook-bot-postmoogle.md @@ -5,25 +5,22 @@ 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. -Postmoogle runs an email server through SMTP and allaws you to create mailboxes to the domain you define in the DNS settings. +Postmoogle runs an SMTP email server and allows you to assign mailbox addresses to Matrix rooms. 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 -### Ports +### Networking + +Open the following ports on your server to be able to receive incoming emails: -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 + - `587/tcp`: Submission (TLS-encrypted SMTP) -You can change the above default ports through the following variables in the playbook: +If you don't open these ports, you will still be able to send emails, but not receive any. -```yaml -# on-host ports -matrix_bot_postmoogle_smtp_host_bind_port: '25' -matrix_bot_postmoogle_submission_host_bind_port: '587' -``` +These port numbers are configurable via the `matrix_bot_postmoogle_smtp_host_bind_port` and `matrix_bot_postmoogle_submission_host_bind_port` variables, but other email servers will try to deliver on these default (standard) ports, so changing them is of little use. ### Adjusting the playbook configuration @@ -38,16 +35,20 @@ matrix_bot_postmoogle_enabled: true # Generate a strong password here. Consider generating it with `pwgen -s 64 1` matrix_bot_postmoogle_password: PASSWORD_FOR_THE_BOT -``` -Add an admin to Postmoogle with: -```yaml -matrix_bot_postmoogle_admins: - - '@yourAdminAccount:domain.com' +# Uncomment to add one or more admins to this bridge: +# +# matrix_bot_postmoogle_admins: +# - '@yourAdminAccount:domain.com' +# +# .. unless you've made yourself an admin of all bridges like this: +# +# matrix_admin: '@yourAdminAccount:domain.com' ``` ### DNS -You will also need to add several DNS records so that postmoogle can send emails. + +You will also need to add several DNS records so that Postmoogle can send emails. See [Configuring DNS](configuring-dns.md). @@ -77,10 +78,11 @@ 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: + +As with all other services, you can find their logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by running something like `journalctl -fu matrix-bot-postmoogle` + +The default logging level for this bridge is `INFO`, but you can increase it to `DEBUG` with the following additional configuration: ```yaml matrix_bot_postmoogle_loglevel: 'DEBUG' ``` - -And access it through `journalctl -fu matrix-bot-postmoogle` \ No newline at end of file