Set up e-mail

  • For IT
  • Bugsoft Portal 4.12.14

How Bugsoft Portal sends notifications by e-mail: through a Microsoft 365 relay or Direct Send, or another mail server, and how to test it.

Bugsoft Portal also sends urgent messages, reminders and tasks by e-mail. This is on by default (Settings › Sign-in and security › Urgent messages also by e-mail), but it only works when the server may send e-mail.

Until then, a message shows on Start and on System status, and php bin/console production:check gives advice (!).

The settings in .env

You set up e-mail in the file .env on the server (in Docker: in the environment of the container). All settings are also on The configuration file.

NameWhat it doesExample
MAIL_HOSTThe mail server. Without this value, e-mail is off.klaverveld-example.mail.protection.outlook.com
MAIL_PORTThe port (default 587).25
MAIL_ENCRYPTIONtls (STARTTLS, default), ssl (port 465) or none (only inside your own network).tls
MAIL_USERNAMEOnly if the mail server asks for an account. Empty = Bugsoft Portal does not sign in.
MAIL_PASSWORDThe password of that account.
MAIL_FROMThe sender. Required.bugsoft@klaverveld.example
MAIL_FROM_NAMEThe sender name (default: the name of the portal).Bugsoft Portal Klaverveld
MAIL_DRIVERsmtp (automatic when MAIL_HOST is set), log (only to storage/logs/mail.log, for a test environment) or off.

Microsoft 365

Microsoft is phasing out signing in to the mail server with a user name and password (SMTP AUTH). So choose one of these two ways. With both, leave MAIL_USERNAME and MAIL_PASSWORD empty.

A relay through a connector (recommended)

  1. In the Exchange admin center, create a connector from your organization's email server to Office 365 that accepts mail from the public IP address of the Bugsoft Portal server.
  2. In .env, set: MAIL_HOST = the MX address of your domain (for example klaverveld-example.mail.protection.outlook.com), MAIL_PORT=25, MAIL_ENCRYPTION=tls, and MAIL_FROM = an address on a domain of your organisation.
  3. Send a test e-mail (see below).

With a relay, e-mail also reaches addresses outside your organisation.

Direct Send

It also works without a connector, with the same settings as above. But then e-mail only reaches addresses inside your own organisation. Add the IP address of the Bugsoft Portal server to the SPF record of your domain, otherwise e-mail may be treated as spam.

Port 25 is closed on some networks and at some hosting providers. If there is no connection, ask your network administrator whether outgoing traffic to port 25 may be opened.

Another mail server

With your own mail server or a mail service, enter the details you get there. Usually that is port 587 with MAIL_ENCRYPTION=tls and an account (MAIL_USERNAME and MAIL_PASSWORD), or port 465 with MAIL_ENCRYPTION=ssl. Bugsoft Portal always checks the certificate of the mail server.

Send a test e-mail

  1. Go to Settings › System › System status.
  2. The card E-mail shows whether Bugsoft Portal sends e-mail, which mail server and sender are set, and whether Bugsoft Portal signs in to the mail server.
  3. Choose Send a test e-mail. The test e-mail goes to your own e-mail address. Do you not see it? Also check your spam folder.
The Email card on System status, with the mail server, the sender and the Send a test mail button

You can also do it on the server, to any address:

php bin/console mail:test it@klaverveld.example

If it fails

The reason is shown with the result, and on the card under Last error. Common errors:

  • 535 or Authentication unsuccessful: the account or password is wrong, or the mail server no longer allows signing in with a password. With Microsoft 365, choose a relay or Direct Send.
  • 550 5.7.x or relay access denied: the mail server does not accept mail from this server. Check the connector and the IP address.
  • connect failed or a time-out: the server cannot reach the mail server. Check the name, the port and the firewall.

Every test e-mail goes into the audit log in Admin (who, when, and whether it worked).

Stuck? See Questions and problems or contact Bugsoft at ugurs156@gmail.com.