Email Connection

Updated in Jmix 3.1

The Email connection administration view shows the parameters of the connection to the mail server: the authentication type, the mailbox account (spring.mail.username) and the server (spring.mail.host and spring.mail.port).

The following actions are available:

  • Test connection: Connect to the mail server and log in without sending a message. With OAuth2 authentication, the test also gets an access token, so an invalid or revoked refresh token fails the test.

  • Connect via authorization code: Sign in to the mailbox account on the provider page and store the obtained refresh token. Available for the google and microsoft providers.

  • Connect via device code: Sign in to the mailbox account using a code shown in the dialog and store the obtained refresh token. Available for the microsoft provider.

  • Manual update in the Advanced section: Replace the stored refresh token with an entered value. See Entering Refresh Token Manually.

The connect buttons are enabled and the Advanced section is shown only with OAuth2 authentication. See Connecting Mailbox Account for the steps.

Connection Status

Until you test the connection, the view shows Connected (not verified) if a refresh token is stored in the database (OAuth2 authentication) or spring.mail.host is set (basic authentication), and Not connected otherwise. A token that is set only in the jmix.email.oauth2.refresh-token property is shown as Not connected.

After the test, the status is Connection verified or Connection error.

Grant the Email: token manager resource role to allow access to this view to non-administrator users.