Product SiteDocumentation Site

5.8. Email

The webmaster's e-mail address. This address is displayed in the bottom of all MantisBT pages.
The email address to be used as the source of all emails sent by MantisBT.
The sender name of all emails sent by MantisBT. Mantis Bug Tracker
Email address to receive bounced emails.
Set to ON to enable email notifications, OFF to disable them. Default is ON. Note that disabling email notifications has no effect on emails generated as part of the user signup process. When set to OFF, the password reset feature is disabled. Additionally, notifications of administrators updating accounts are not sent to users.
When enabled, the email notifications will include the full issue with a hint about the change type at the top, rather than using dedicated notifications that are focused on what changed. This change can be overridden in the database per user. Default is OFF.
Associates a default notification flag with each action, to control who should be notified. The default will be used if the action is not defined in $g_notify_flags or if the flag is not included in the specific action definition.
The list of actions include: new, assigned, resolved, bugnote, reopened, closed, deleted, feedback.
The default is:
$g_default_notify_flags = array(
	'reporter'      => ON,
	'handler'       => ON,
	'monitor'       => ON,
	'bugnotes'      => ON,
	'category'      => ON,
	'explicit'      => ON,
	'threshold_min' => NOBODY,
	'threshold_max' => NOBODY
threshold_min and threshold_max are used to send messages to all members of the project whose status is
  • greater than or equal to threshold_min, and
  • less than or equal to threshold_max.
Sending messages to everyone would set threshold_min to ANYBODY and threshold_max to NOBODY. To send to all DEVELOPERS and above, use DEVELOPER and NOBODY respectively.
Defines the specific notification flags when they are different from the defaults defined in $g_default_notify_flags.
For example, the following code overrides the default by disabling notifications to bugnote authors and users monitoring the bug when submitting a new bug:
$g_notify_flags['new'] = array(
	'bugnotes' => OFF,
	'monitor' => OFF,
See Section 7.4, “Email Notifications” for further examples of customizing the notification flags.
Available actions include:
  • new: a new bug has been added
  • reopened: the bug has been reopened
  • deleted: a bug has been deleted
  • owner: the bug has been assigned a new owner
  • bugnote: a bugnote has been added to a bug
  • sponsor: the sponsorship for the bug has changed (added, deleted or updated)
  • relation: a relationship for the bug has changed (added, deleted or updated)
  • monitor: a user is added to the monitor list.
In addition, an action can match the bug status in $g_status_enum_string. Note that spaces in the string are replaced with underscores ('_') when creating the action. Thus, using the defaults, 'feedback' would be a valid action.
This defines whether users should receive emails for their own actions. This option is defaulted to OFF, hence, users do not receive email notification for their own actions. This can be a source for confusions for users upgrading from MantisBT 0.17.x versions, since in these versions users used to get notified of their own actions.
Determines whether email addresses are validated.
When ON (default), validation is performed using the pattern given by the HTML5 specification for email type form input elements. When OFF, validation is disabled.


Regardless of how this option is set, validation is never performed when using LDAP email (i.e. when $g_use_ldap_email = ON, see Section 5.21.2, “LDAP authentication method parameters”), as we assume that it is handled by the directory.
Set to OFF to disable email checking. Default is OFF.
If ON, allows the user to omit an email address field. If you allow users to create their own accounts, they must specify an email at that point, no matter what the value of this option is. Otherwise they wouldn't get their passwords.
Administrators are able to bypass this check to enable them to create special accounts like anonymous access and other service accounts that don't need notifications.
Allow login with email address.
When this is ON, users can log in with their registered email address, in addition to their username.
This will only work as long as there is a single user with the specified email address, and the email address is not blank.
The default value is OFF.
When enabled, the uniqueness of email addresses will be enforced for new users as well as updates to existing ones. Default is ON.


When this setting changes from OFF to ON (which will de facto occur when upgrading to MantisBT 1.3.0 or later from an older version), there could be existing user accounts sharing the same email address.
It important that such duplicates are identified and fixed, to avoid unexpected and unpredictable behavior when looking up users with their email address, as the system expects them to be unique.
To facilitate this task, the Administration Checks will detect duplicate email addresses and identify the related user accounts. A warning will also be displayed in the Manage Users page (see Section 6.8.1, “Users”) and when editing a user account whose email address is associated with one or more other accounts.
Only allow and send email to addresses in the given domain(s). This is useful as a security feature and it is also useful in cases like Sourceforge where its servers are limited to only sending emails to SourceForge email addresses in order to avoid spam. $g_limit_email_domains = array( '', '' );
This specifies the access level that is needed to have user names hyperlinked with mailto: links. The default value is NOBODY, hence, even administrators won't have this feature enabled.
This specifies the access level that is needed to see realnames on user view page. The default value is NOBODY, hence, even administrators won't have this feature enabled.
Select the method to send mail:
  • PHPMAILER_METHOD_MAIL for use of mail() function,
  • PHPMAILER_METHOD_SENDMAIL for sendmail (or postfix),
This option specifies the SMTP server to submit messages to. The SMTP server (MTA) then takes on the responsibility of delivering messages to their final destinations.
To use the local SMTP (if available) set this to 'localhost', otherwise use the fully qualified domain name of the remote SMTP server.
It can be either a single hostname, or multiple semicolon-delimited hostnames. You can specify for each host a port other than the default, using format: hostname:port (e.g. ";").
Hosts will be tried in the given order.


This is only used with PHPMAILER_METHOD_SMTP (see $g_phpmailer_method).
The default is 'localhost'.
The default SMTP port to use. This can be overridden individually for specific hosts. (see $g_smtp_host).
Typical SMTP ports are 25 and 587.
The default is 25.
Allow secure connection to the SMTP server. Valid values are:
  • '' (empty string): No encryption. This is the default.
  • ssl
  • tls
SMTP Server Authentication user
Allows the use of SMTP Authentication when using a remote SMTP host.


must be set to '' (empty string) if the SMTP host does not require authentication.
Default is ''.
This is the password that is used in SMTP Authentication. Not used when $g_smtp_username = ''
Default is ''.
Duration (in days) to retry failed emails before deleting them from queue. Default 7 days.
Use a cron scheduler to send emails.
When this is ON (recommended), instead of sending of emails as soon as an action is performed (typically at the end of each page), emails are queued and must be sent manually by executing scripts/send_emails.php. This script can only be run from the CLI, not from the web interface, for security reasons.
The script's execution is typically handled by a cron job or a scheduler task, set to run every few minutes.
If no cronjob is used (default), then the user will have to wait for MantisBT to process the email queue after each page load.


Considering that processing the email queue can take a significant amount of time on systems generating large numbers of notifications, when the queue contains many undeliverable emails or when mail delivery is slow, enabling this option can significantly improve MantisBT's performance.
Default is str_pad('', 70, '='); This means 70 equal signs.
Default is str_pad('', 70, '-'); This means 70 minus signs.
Default is 28.
MantisBT uses flags and a threshold system to generate emails on events. For each new event, email is sent to:
  • the reporter, qualified by the notify flag 'reporter' below
  • the handler (or Assigned to), qualified by the notify flag 'handler' below
  • anyone monitoring the bug, qualified by the notify flag 'monitor' below
  • anyone who has ever added a bugnote the bug, qualified by the notify flag 'bugnotes' below
  • anyone assigned to the project whose access level is greater than or equal to the notify flag 'threshold_min' and less than or equal to the notify flag 'threshold_max' below
From this list, those recipients who meet the following criteria are eliminated:
  • the originator of the change, if $g_email_receive_own is OFF
  • the recipient either no longer exists, or is disabled
  • the recipient has turned their email_on_<new status> preference OFF
  • the recipient has no email address entered

5.8.1. DKIM signature

In order to setup DomainKeys Identified Mail (DKIM) Signatures (as defined in RFC 6376), you need to enable the feature (see $g_email_dkim_enable), and provide at least:
  • Domain (see $g_email_dkim_domain),
  • Private key or key file path (see $g_email_dkim_private_key_file_path and $g_email_dkim_private_key_string),
  • Selector (see $g_email_dkim_selector),
  • Identity (see $g_email_dkim_identity).
Enables DomainKeys Identified Mail (DKIM).
The default is OFF.
Defines the domain for DKIM Signatures.
This is typically same as the host part of the $g_from_email. For example
Path to the private domain key to be used for DKIM Signatures.
If the key is specified in $g_email_dkim_private_key_string this setting will not be used.
Private domain key to be used for DKIM Signatures.
This string should contain private key for signing. Leave empty string if you wish to load the key from the file defined with $g_email_dkim_private_key_file_path.
Selector to be used for DKIM Signatures.
If your domain is, typically DNS TXT field should have: host: mail.example._domainkey, value: v=DKIM1; t=s; n=core; k=rsa; p=[public key]. In this case selector should be mail.example
Private DKIM domain key password.
Leave empty string if your private key does not have password
Identity to be used for DomainKeys Identified Mail (DKIM) Signatures.
This is usually the same as $g_from_email. For example,