Compliance configuration settings

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Review and manage the following compliance configuration options in the System Console by selecting the Product Navigate between Channels, collaborative playbooks, and boards using the product menu icon. menu, selecting System Console, and then selecting Compliance:

Tip

System admins managing a self-hosted Mattermost deployment can edit the config.json file as described in the following tables. Each configuration value below includes a JSON path to access the value programmatically in the config.json file using a JSON-aware tool. For example, the MessageRetentionHours value is under DataRetentionSettings.

  • If using a tool such as jq, you’d enter: cat config/config.json | jq '.DataRetentionSettings.MessageRetentionHours'

  • When working with the config.json file manually, look for an object such as DataRetentionSettings, then within that object, find the key MessageRetentionHours.


Data retention policies

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Changes to properties in this section require a server restart before taking effect.

Warning

  • Once a message or a file is deleted, the action is irreversible. Please set up a custom data retention policy with care.

  • From Mattermost v9.5, data retention removes Elasticsearch indexes based on the day of the retention cut-off time.

Access the following configuration settings in the System Console by going to Compliance > Data Retention Policies.

Global retention policy for messages

Set how long Mattermost keeps messages across all teams and channels. This setting doesn’t apply to custom retention policies.

By default, messages are kept forever. If Hours, Days, or Years is chosen, set how many hours, days, or years messages are kept in Mattermost. Messages older than the duration you set will be deleted nightly.

The default is 0 (messages are kept forever). The minimum message retention is 1 hour.

  • System Config path: Compliance > Data Retention Policies

  • config.json setting: DataRetentionSettings > MessageRetentionHours > 0

  • Environment variable: MM_DATARETENTIONSETTINGS_MESSAGERETENTIONHOURS

Note

From Mattermost v9.5, MessageRetentionDays has been deprecated in favor of MessageRetentionHours. See deprecated configuration settings for details.

Global retention policy for files

Set how long Mattermost keeps files across all teams and channels. This setting doesn’t apply to custom retention policies.

By default, files are kept forever. If Hours, Days, or Years is chosen, set how many hours, days, or years files are kept in Mattermost. Files older than the duration you set will be deleted nightly.

The default is 0 (files kept forever). The minimum file retention time is 1 hour.

  • System Config path: Compliance > Data Retention Policies

  • config.json setting: DataRetentionSettings > FileRetentionHours > 0

  • Environment variable: MM_DATARETENTIONSETTINGS_FILERETENTIONHOURS

Note

From Mattermost v9.5, FileRetentionDays has been deprecated in favor of FileRetentionHours. See deprecated configuration settings for details.

Preserve pinned posts

From Mattermost v10.10, controls whether pinned posts are preserved when data retention policies delete messages. When enabled, pinned posts won’t be deleted by data retention policies, even if they exceed the configured retention period.

True: Pinned posts are preserved and won’t be deleted by data retention policies.

False: (Default) Pinned posts are deleted according to the configured data retention policy.

This feature’s config.json setting is "DataRetentionSettings.PreservePinnedPosts": false with options true and false.

Note

  • This global configuration setting must be enabled with mmctl using the mmctl config set command.

  • This configuration setting applies to team and channel policies as well as data retention, and can’t be overridden in those more granular team or channel policies.

  • Files attached to the pinned message aren’t preserved.

  • Only the pinned post is preserved. If it’s attached to a thread or if it’s the root post of a thread, the other threaded messages aren’t preserved.

Custom retention policy

Select Add Policy to define a custom retention policy. See the custom data retention policy documentation for details.

Data deletion time

Set the start time of the daily scheduled data retention job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM.

This setting is based on the local time of the server.

Default is 02:00.

  • System Config path: Compliance > Data Retention Policies

  • config.json setting: DataRetentionSettings > DeletionJobStartTime > "02:00"

  • Environment variable: MM_DATARETENTIONSETTINGS_DELETIONJOBSTARTTIME

Run deletion job now

Select Run Deletion Job Now to start a Data Retention deletion job immediately. Monitor the status of the job in the data deletion job table within the Policy Log section.


Compliance export

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Access the following configuration settings in the System Console by going to Compliance > Compliance Export.

Enable compliance export

  • True: Mattermost will generate a compliance export file that contains all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See the compliance export documentation to learn more.

  • False: (Default) Mattermost doesn’t generate a compliance export file.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > EnableExport > false

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_ENABLEEXPORT

Compliance export time

Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM.

This setting is based on the local time of the server.

Default is 01:00.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > DailyRunTime > "01:00"

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_DAILYRUNTIME

Export file format

File format of the compliance export. Corresponds to the system that you want to import the data into.

Currently supported formats are CSV, Actiance XML, and Global Relay EML.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > ExportFormat > "csv"

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_EXPORTFORMAT

Global Relay customer account

Type of Global Relay customer account your organization has. Can be one of: A9/Type 9, A10/Type 10, or Custom.

Default is A9.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > CustomerType > "A9"

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_CUSTOMERTYPE

Global Relay SMTP username

The username for authenticating to the Global Relay SMTP server.

String input. Default is an empty string.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > SmtpUsername > ""

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_SMTPUSERNAME

Global Relay SMTP password

The password associated with the Global Relay SMTP username.

String input. Default is an empty string.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > SMTPPassword > ""

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_SMTPPASSWORD

Global Relay email address

The email address your Global Relay server monitors for incoming compliance exports.

String input. Default is an empty string.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > EmailAddress > ""

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_EMAILADDRESS

SMTP server name

The SMTP server name URL that will receive your Global Relay EML file when a custom account type is configured.

String input. Default is an empty string.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > CustomSMTPServerName > ""

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_CUSTOMSMTPSERVERNAME

SMTP server port

The SMTP server port that will receive your Global Relay EML file when a custom account type is configured.

Numerical input. Default is 25.

  • System Config path: Compliance > Compliance Export

  • config.json setting: MessageExportSettings > GlobalRelaySettings > CustomSMTPPort > 25

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_GLOBALRELAYSETTINGS_CUSTOMSMPTPORT

Message export batch size

Note

plans-img-yellow Available only on Enterprise plans

Determines how many new messages are batched together to a compliance export file.

Numerical input. Default is 10000 messages.

  • System Config path: N/A

  • config.json setting: MessageExportSettings > BatchSize > 10000

  • Environment variable: MM_MESSAGEEXPORTSETTINGS_BATCHSIZE

Note

This setting isn’t available in the System Console and can only be set in config.json.

Run compliance export job now

Select Run Compliance Export Job Now to start a compliance export job immediately. Monitor the status of the job in the compliance export job table.


Compliance monitoring

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Settings to enable and configure Mattermost compliance reports. Access the following configuration settings in the System Console by going to Compliance > Compliance Monitoring.

Enable compliance reporting

  • True: Compliance reporting is enabled in Mattermost.

  • False: (Default) Compliance reporting is disabled.

  • System Config path: Compliance > Compliance Monitoring

  • config.json setting: ComplianceSettings > Enable > false

  • Environment variable: MM_COMPLIANCESETTINGS_ENABLE

Compliance report directory

Sets the directory where compliance reports are written.

String input. Default is ./data/

  • System Config path: Compliance > Compliance Monitoring

  • config.json setting: ComplianceSettings > Directory > "./data/"

  • Environment variable: MM_COMPLIANCESETTINGS_DIRECTORY

Enable daily report

  • True: Mattermost generates a daily compliance report.

  • False: (Default) Daily reports aren’t generated.

  • System Config path: Compliance > Compliance Monitoring

  • config.json setting: ComplianceSettings > EnableDaily > false

  • Environment variable: MM_COMPLIANCESETTINGS_ENABLEDAILY

Batch size

Set the size of the batches in which messages will be read from the database to generate the compliance report.

Numerical input. Default is 30000 messages.

  • System Config path: Compliance > Compliance Monitoring

  • config.json setting: ComplianceSettings > BatchSize > 30000

  • Environment variable: MM_COMPLIANCESETTINGS_BATCHSIZE

Note

This setting isn’t available in the System Console and can only be set in config.json.


Custom terms of service

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Access the following configuration settings in the System Console by going to Compliance > Custom Terms of Service.

Enable custom terms of service

  • True: New users must accept the Terms of Service before accessing any Mattermost teams on desktop, web, or mobile.

  • False: (Default) During account creation or login, users can review Terms of Service by accessing the link configured via System Console > Legal and Support > Terms of Service link.

  • System Config path: Compliance > Custom Terms of Service

  • config.json setting: SupportSettings > CustomTermsOfServiceEnabled > false

  • Environment variable: MM_SUPPORTSETTINGS_CUSTOMTERMSOFSERVICEENABLED

Note

  • This configuration setting can only be managed using the System Console user interface. It can’t be set in config.json or through environment variables.

  • When custom terms of service are enabled, users must accept the terms before they can access Mattermost teams after login or page refresh.

  • To update the Terms of Service link displayed in account creation and login pages, go to System Console > Legal and Support > Terms of Service Link.

Custom terms of service text

Text that will appear in your custom Terms of Service. Supports Markdown-formatted text.

Text input.

  • System Config path: Compliance > Custom Terms of Service

  • config.json setting: N/A

  • Environment variable: N/A

Re-acceptance period

The number of days before Terms of Service acceptance expires, and the terms must be re-accepted.

Numerical input. Default is 365 days, and 0 indicates that the terms don’t expire.

  • System Config path: Compliance > Custom Terms of Service

  • config.json setting: SupportSettings > CustomTermsOfServiceReAcceptancePeriod > 365

  • Environment variable: MM_SUPPORTSETTINGS_CUSTOMTERMSOFSERVICEREACCEPTANCEPERIOD