First steps with Mattermost

This section is aimed to be a minimal guide for getting familiar with Mattermost.

The packages provided only set a few common settings by default (more in below chapter)

  • Regardless of using Mattermost Team or Enterprise, there is no pre-configured integration with Kopano.
    • for the Mattermost Enterprise Edition LDAP could be configured as user source.
  • The first user to create an account and login is automatically admin.
    • When installing Mattermost the admin should directly create an account for himself.
  • Communication in Mattermost happens in “Teams” and no default team is created.
    • Create a team for your users. Something simple such as “home” could provide a good start.
    • Be aware that you can change the name of a team, but not the url. So whatever is chosen here will be along as long as the team exists.
  • Configure SMTP integration
    • without SMTP settings Mattermost will not be able to send email invitations and notifications.
  • invite kopano users to Mattermost
    • since there is no direct user integration the platform command could be used to invite your users. e.g. with mattermost-platform user invite user@example.com home.

Interacting with Mattermost from the CLI

Starting with version 4.1.0-RC2+2.1 the packages include a small wrapper utility that makes it easier to work with the platform command of mattermost. All configuration options of the platform command are available via mattermost-platform.

$ mattermost-platform
You need to pass at least one parameter. Try /usr/sbin/mattermost-platform help instead.

$ mattermost-platform help
Mattermost offers workplace messaging across web, PC and phones with archiving, search and integration with your existing systems. Documentation available at https://docs.mattermost.com

Usage:
  platform [flags]
  platform [command]

Available Commands:
  channel     Management of channels
  config      Configuration
  help        Help about any command
  import      Import data.
  jobserver   Start the Mattermost job server
  ldap        LDAP related utilities
  license     Licensing commands
  reset       Reset the database to initial state
  roles       Management of user roles
  server      Run the Mattermost server
  team        Management of teams
  user        Management of users
  version     Display version information

Flags:
  -c, --config string        Configuration file to use. (default "config.json")
      --disableconfigwatch   When set config.json will not be loaded from disk when the file is changed.
  -h, --help                 help for platform

Use "platform [command] --help" for more information about a command.

Configuration for Kopano WebApp/DeskApp

The kopano-webapp-plugin-mattermost package, which is part of the Kopano WebApp download, can be used to integrate Mattermost within Kopano DeskApp and WebApp. The Mattermost plugin can be installed as a package from both the Kopano WebApp and Mattermost package repositories and must be configured as followed:

Please replace the url with the actual url of your Mattermost installation.

For security purposes Mattermost makes use of two response headers which prevent browsers from running the Mattermost web client cross domain or inside an iframe (which the WebApp plugin does). Fortunately those can be replaced/modified by the reverse proxy to still allow embedding for specified domains.

A valid configuration for Nginx has the following values in the Mattermost vHost (the following snippet is already part of the installed vHost and needs to be adapted in regards to the actually used hostname):

add_header X-Frame-Options "ALLOW-FROM 'https://your.kopano.webapp.host.local'";
add_header Content-Security-Policy "frame-ancestors 'self' https://your.kopano.webapp.host.local";
proxy_hide_header X-Frame-Options;
proxy_hide_header Content-Security-Policy;

The example vHosts for Apache and Nginx have the needed additional configuration already included (but commented).

The enable notification when running Mattermost within Kopano WebApp or DeskApp the Notifymatters Plugin needs to be installed as a plugin in Mattermost. The plugin extends Mattermost with a PostMessage API, so that external applications can easily interact with it. Once the plugin has been added to Mattermost make sure to add the URL WebApp is accessed from to the “Trusted Origin” configuration setting of the plugin (accessible from the System Console in Mattermost).

Filesystem locations

The configuration files for Mattermost itself (config.json) is stored below /etc/mattermost. Logfiles for Mattermost are located below /var/log/mattermost.

Automatic configuration that differs from the defaults set by Mattermost

When installing Mattermost from the packages provided by Kopano some (recommended by us) configuration settings are already set for your convenience. Here you can find a list of these settings.

User and server tracking (partly disabled)

Mattermost by default performs client side tracking (via the service segment.io) and server side tracking (once at start and then every 24 hours). More information about this can be obtained from the “Telemetry” chapter. of the Mattermost documentation.

While we do see the value in having this data to make better development statistics, we also recognize that most of our customer do not want automated tracking of all their client sessions, therefore EnableDiagnostics is set to false by default. Additionally EnableSecurityFixAlert could be disable to stop sending server statistics servers 24 hours, but since also suppresses update reminders for admins we decided to leave it at its default value.

Team creation by normal users

In the default configuration any Mattermost user can create new “Teams”, when installing the packages provided by Kopano only administrators can create new teams.

This can be changes by setting EnableTeamCreation back to true.

More information

Posting into channels by bots

In the default configuration configured webhooks will always be displayed as coming from the user who created the webhook. For convenience the packages already set the following two configuration options to allow webhooks to override this behavior:

  • EnablePostUsernameOverride
  • EnablePostIconOverride

More information

Batching of Email notification

Once the admin enabled notifications via Email, a separate Email will be send for each event. with this setting enabled Mattermost will collect and wait (configurable per user) 15 minutes before sending an Email.

´More information <https://docs.mattermost.com/administration/config-settings.html?highlight=emailbatchinginterval#enable-email-batching>´__