Issue
Steps Followed:
1. portal-ext. properties:
mail.session.mail.smtp.auth=true mail.session.mail.smtp.starttls.enable=true
2. Navigate to Server Administration -> Mail
Outgoing SMTP Server: smtp.office365.com Outgoing Port: 587 Use a Secure Network Connection: Uncheck Enable StartTLS: Check Provide the outlook credentials and Save
3. Navigate to Instance Settings-> Email-> Email Sender and provide the same outlook account given in step 2
4. Create a new user and check for the email.
Expected Behaviour: Email should be triggered at password update or user creation etc.
Actual Behaviour: Email is not getting triggered with the below error in server logs
2022-03-22 05:49:45.971 ERROR [liferay/mail-1][MailEngine:74] Unable to send message: 451 5.7.3 STARTTLS is required to send mail [BMXPR01CA0009.INDPRD01.PROD.OUTLOOK.COM]_ [Sanitized] com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [BMXPR01CA0009.INDPRD01.PROD.OUTLOOK.COM]_ [Sanitized] at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583) at com.liferay.petra.mail.MailEngine._send(MailEngine.java:605) at com.liferay.petra.mail.MailEngine.send(MailEngine.java:386) at com.liferay.petra.mail.MailEngine.send(MailEngine.java:461) at com.liferay.mail.messaging.MailMessageListener.doMailMessage(MailMessageListener.java:99) at com.liferay.mail.messaging.MailMessageListener.doReceive(MailMessageListener.java:114) at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26) at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664) at java.lang.Thread.run(Thread.java:748)
Environment
- Liferay DXP 7.2
Resolution
- The observed behavior is a known issue and is fixed in fixpack dxp-5.
- Installing Fix Packs and Hotfixes on Liferay DXP will guide you to install the Fixpack in your environment.
- If the hotfix is required for this issue, please create a support ticket requesting the hotfix by attaching the patch details.