Liferay

Mail Configuration in Liferay with Gmail’s increased security

Pratik Kheni
Pratik KheniAug 1, 2023

Problem :-

Enhancing Liferay Mail Configuration with Gmail App Password for Increased Security

Solution :-

Google deprecated basic authentication for their email services.They are suggesting its customer move to OAuth 2.0 token-based authorization. We can use this OAuth 2.0 token-based authorization as password for gmail account. We can modify the Liferay server administration mail properties using Liferay OOTB.

Environment Requirements :

  • Liferay
  • Liferay dxp 7.x

Here this blog explains how to configure the mail server in liferay 7.x for sending and receiving emails using a Gmail account app password.

  1. Generate the gmail account app password
  2. Configuring Mail in Liferay

1. Generate the gmail account app password

Nowadays, Google deprecated basic authentication for sending and receiving their email services. So We have to generate App passwords for security purposes.

Follow the below steps to create app password for mail server configuration:

a. Log in to your gmail account :-Open your web browser and navigate to Gmail (https://mail.google.com/)

b. Click on your profile picture in the top right corner of your Gmail interface. Click on manage your google account. This will redirect you to your google account settings.

Blog Image

c. In the Google Account Settings, click on the security tab on the left side of the panel.

Blog Image

d. Scroll down to the “How to sign in your google account” section. You will see the 2-step verification option..

Note: For creating App password, you must enable 2-step verification for your gmail account otherwise you will not be able to create app password.

Blog Image

e. Click On 2-step verification option. Scroll down to the 2-step verification section, at the bottom you will see the “App passwords” section.

Blog Image

f. Click on App passwords. Open one new window seen as per below image.

Blog Image

g. For generating app password, select the app and devices for which you want to generate the app password.

Here we select the app as Mail and the device as Windows Computer.

Blog Image

h. Then click on GENERATE. Your app password is generated.

Blog Image

i. Now replace your gmail account password with the 16-character password shown above image.

2. Configuring Mail in Liferay

Follow the below steps to configure mail session from control panel:

Sign in as the Administrator user.

Go to the Global menu() Control Panel → System → Server Administration → Mail

Fill out the below configuration form.

Blog Image

In the above form, you are asked for following information:

  1. Incoming POP Server:- Refers to the server that handles incoming messages using the POP protocol.
  2. Incoming Port:- The port on which the POP server is listening.The default port for POP3 is 110, but some servers may use different ports for security reasons.
  3. Use a secure network connection:- The checkbox to enable whether to use an encrypted connection when connecting to the POP server.
  4. Username:- The user id used to log into the pop server.
  5. Password:- The password used to log into the pop server.
  6. Outgoing SMTP server:- Refers to the server that handles outgoing messages using the SMTP protocol.
  7. Outgoing Port:- The port on which the SMTP server is listening.The default port for SMTP is 25, but some servers may use different ports such as 587 or 465 , for secure connection.
  8. Use a secure network connection:- The checkbox to enable whether to use an encrypted connection when connecting to the SMTP server.
  9. Username:- The user id used to log into the SMTP server.
  10. Password:- The password used to log into the SMTP server.
  11. Manually specify additional JavaMail properties to override the above configuration: If there are additional properties you need to specify, supply them here.
Blog Image
Blog Image

Save the configuration. Now you should be able to send and receive emails from your portal.

Note: Make sure that you enable the Less Secure App Access in your gmail account.

Blog Image

© 2026 IGNEK. All rights reserved.

Ignek on LinkedInIgnek on InstagramIgnek on FacebookIgnek on YouTubeIgnek on X