Product SiteDocumentation Site

5.8. Email

$g_webmaster_email
The webmaster's e-mail address. This address is displayed in the bottom of all MantisBT pages. webmaster@example.com
$g_from_email
The email address to be used as the source of all emails sent by MantisBT. noreply@example.com
$g_from_name
The sender name of all emails sent by MantisBT. Mantis Bug Tracker
$g_return_path_email
Email address to receive bounced emails.
$g_enable_email_notification
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.
$g_email_notifications_verbose
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.
$g_default_notify_flags
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.
$g_notify_flags
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.
$g_email_receive_own
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.
$g_validate_email
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.

Note

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.
$g_check_mx_record
Set to OFF to disable email checking. Default is OFF.
$g_allow_blank_email
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.
$g_email_login_enabled
Enable support for logging in by email and password, in addition to username and password. 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.
$g_email_ensure_unique
When enabled, the uniqueness of email addresses will be enforced for new users as well as updates to existing ones. Note that there can be duplicate emails before this option was turned ON. Default is ON.
$g_limit_email_domains
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 only limited to send emails to SourceForge email addresses in order to avoid spam. $g_limit_email_domains = array( 'users.sourceforge.net', 'sourceforge.net' );
$g_show_user_email_threshold
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.
$g_phpMailer_method
Select the method to send mail:
  • PHPMAILER_METHOD_MAIL for use of mail() function,
  • PHPMAILER_METHOD_SENDMAIL for sendmail (or postfix),
  • PHPMAILER_METHOD_SMTP for SMTP,
Default is PHPMAILER_METHOD_MAIL.
$g_smtp_host
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. "smtp1.example.com:25;smtp2.example.com").
Hosts will be tried in the given order.

Note

This is only used with PHPMAILER_METHOD_SMTP (see $g_phpmailer_method).
The default is 'localhost'.
$g_smtp_port
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.
$g_smtp_connection_mode
Allow secure connection to the SMTP server. Valid values are:
  • '' (empty string): No encryption. This is the default.
  • ssl
  • tls
$g_smtp_username
SMTP Server Authentication user
Allows the use of SMTP Authentication when using a remote SMTP host.

Note

must be set to '' (empty string) if the SMTP host does not require authentication.
Default is ''.
$g_smtp_password
This is the password that is used in SMTP Authentication. Not used when $g_smtp_username = ''
Default is ''.
$g_email_dkim_enable
Enables DomainKeys Identified Mail (DKIM) Signatures (rfc6376). To successfully sign mails you need to enable DKIM and provide at least: DKIM domain (see $g_email_dkim_domain), DKIM private key or key file path (see $g_email_dkim_private_key_file_path and $g_email_dkim_private_key_string), DKIM selector (see $g_email_dkim_selector), DKIM identity (see $g_email_dkim_identity).
The default is OFF.
$g_email_dkim_domain
Defines domain for DomainKeys Identified Mail (DKIM) Signatures.
Typically same as the host part of the $g_from_email. For example example.com.
$g_email_dkim_private_key_file_path
Path to the private domain key to be used for DomainKeys Identified Mail (DKIM) Signatures.
If the key is specified in $g_email_dkim_private_key_string this setting will not be used.
$g_email_dkim_private_key_string
Private domain key to be used for DomainKeys Identified Mail (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.
$g_email_dkim_selector
Selector to be used for DomainKeys Identified Mail (DKIM) Signatures.
If your domain is example.com, 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
$g_email_dkim_passphrase
Private DKIM domain key password.
Leave empty string if your private key does not have password
$g_email_dkim_identity
Identity to be used for DomainKeys Identified Mail (DKIM) Signatures.
This is usually the same as your g_from_email. For example noreply@example.com
$g_email_retry_in_days
Duration (in days) to retry failed emails before deleting them from queue. Default 7 days.
$g_email_send_using_cronjob
Disables sending of emails as soon as an action is performed. Emails are instead queued and must be sent by running scripts/send_emails.php periodically. This script can only be executed from the CLI, not from the web interface, for security reasons.
Enabling this option can help with performance problems if large numbers of emails are generated or mail delivery is slow by not delaying page execution when sending emails.
$g_email_separator1
Default is str_pad('', 70, '='); This means 70 equal signs.
$g_email_separator2
Default is str_pad('', 70, '-'); This means 70 minus signs.
$g_email_padding_length
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