Update Email2Matrix documentation and its default configuration file

- Sync list of mailbox to Matrix mappings
- Add explanation for each variable

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
This commit is contained in:
Suguru Hirahara 2024-10-17 14:20:26 +09:00
parent b9ba9a8ba3
commit e961e1b43d
No known key found for this signature in database
GPG Key ID: E4F9743DAB4B7B75
2 changed files with 33 additions and 18 deletions

View File

@ -49,29 +49,40 @@ After doing the preparation steps above, add the following configuration to your
matrix_email2matrix_enabled: true matrix_email2matrix_enabled: true
matrix_email2matrix_matrix_mappings: matrix_email2matrix_matrix_mappings:
- MailboxName: "my-mailbox" - MailboxName: "mailbox1"
MatrixRoomId: "!someRoom:DOMAIN" MatrixRoomId: "!someRoom:{{ matrix_domain }}"
MatrixHomeserverUrl: "https://matrix.DOMAIN" MatrixHomeserverUrl: "{{ matrix_homeserver_url }}"
MatrixUserId: "@email2matrix:DOMAIN" MatrixUserId: "@email2matrix:{{ matrix_domain }}"
MatrixAccessToken: "ACCESS_TOKEN_GOES_HERE" MatrixAccessToken: "MATRIX_ACCESS_TOKEN_HERE"
IgnoreSubject: false IgnoreSubject: false
IgnoreBody: false IgnoreBody: false
SkipMarkdown: false SkipMarkdown: false
- MailboxName: "my-mailbox2" - MailboxName: "mailbox2"
MatrixRoomId: "!anotherRoom:DOMAIN" MatrixRoomId: "!anotherRoom:{{ matrix_domain }}"
MatrixHomeserverUrl: "https://matrix.DOMAIN" MatrixHomeserverUrl: "{{ matrix_homeserver_url }}"
MatrixUserId: "@email2matrix:DOMAIN" MatrixUserId: "@email2matrix:{{ matrix_domain }}"
MatrixAccessToken: "ACCESS_TOKEN_GOES_HERE" MatrixAccessToken: "MATRIX_ACCESS_TOKEN_HERE"
IgnoreSubject: true IgnoreSubject: true
IgnoreBody: false IgnoreBody: false
SkipMarkdown: true SkipMarkdown: true
``` ```
You can also set `MatrixHomeserverUrl` to the container URL where your homeserver's Client-Server API lives by using the `{{ matrix_addons_homeserver_client_api_url }}` variable, instead of the public `https://matrix.DOMAIN` endpoint. where:
* MailboxName - local-part of the email address, through which emails are bridged to the room whose ID is defined with MatrixRoomId
* MatrixRoomId - internal ID of the room, to which received emails are sent as Matrix message
* MatrixHomeserverUrl - URL of your Matrix homeserver, through which to send Matrix messages. You can also set `MatrixHomeserverUrl` to the container URL where your homeserver's Client-Server API lives by using the `{{ matrix_addons_homeserver_client_api_url }}` variable
* MatrixUserId - the full ID of the sender user which sends bridged messages to the room
* MatrixAccessToken - sender user's access token
* IgnoreSubject - if set to "true", the subject is not bridged to Matrix
* IgnoreBody - if set to "true", the message body is not bridged to Matrix
* SkipMarkdown - if set to "true", emails are bridged as plain text Matrix message instead of Markdown (actually HTML)
Refer to the official documentation [here](https://github.com/devture/email2matrix/blob/master/docs/configuration.md).
## Installing ## Installing
To enable Email2Matrix, run the [installation](installing.md) command (`--tags=setup-email2matrix,start`). To enable Email2Matrix, run the [installation](installing.md) command (`--tags=setup-email2matrix,start`).
After installation, you may wish to send a test email to `my-mailbox@matrix.DOMAIN` to make sure that Email2Matrix works as expected. After installation, you may wish to send a test email to the email address assigned to `mailbox1` (default: `mailbox1@matrix.DOMAIN`) to make sure that Email2Matrix works as expected.

View File

@ -46,18 +46,22 @@ matrix_email2matrix_smtp_hostname: "{{ matrix_server_fqn_matrix }}"
# Example: # Example:
# matrix_email2matrix_matrix_mappings: # matrix_email2matrix_matrix_mappings:
# - MailboxName: "mailbox1" # - MailboxName: "mailbox1"
# MatrixRoomId: "!bpcwlxIUxVvvgXcbjy:example.com" # MatrixRoomId: "!someRoom:{{ matrix_domain }}"
# MatrixHomeserverUrl: "{{ matrix_homeserver_url }}" # MatrixHomeserverUrl: "{{ matrix_homeserver_url }}"
# MatrixUserId": "@email2matrix:{{ matrix_domain }}" # MatrixUserId: "@email2matrix:{{ matrix_domain }}"
# MatrixAccessToken": "TOKEN_HERE" # MatrixAccessToken: "MATRIX_ACCESS_TOKEN_HERE"
# IgnoreSubject: false # IgnoreSubject: false
# IgnoreBody: false
# SkipMarkdown: false
# #
# - MailboxName: "mailbox2" # - MailboxName: "mailbox2"
# MatrixRoomId: "!another:example.com" # MatrixRoomId: "!anotherRoom:{{ matrix_domain }}"
# MatrixHomeserverUrl: "{{ matrix_homeserver_url }}" # MatrixHomeserverUrl: "{{ matrix_homeserver_url }}"
# MatrixUserId": "@email2matrix:{{ matrix_domain }}" # MatrixUserId: "@email2matrix:{{ matrix_domain }}"
# MatrixAccessToken": "TOKEN_HERE" # MatrixAccessToken: "MATRIX_ACCESS_TOKEN_HERE"
# IgnoreSubject: true # IgnoreSubject: true
# IgnoreBody: false
# SkipMarkdown: true
matrix_email2matrix_matrix_mappings: [] matrix_email2matrix_matrix_mappings: []
matrix_email2matrix_misc_debug: false matrix_email2matrix_misc_debug: false