Email test@domain.invalid is used instead of the configured one

Issue

  • Although you configure through Instance Settings -> Email -> Email Sender an specific email sender, test@domain.invalid is used and the following WARN log shows ups when trying to send emails from custom developments:
    • WARN  [liferay/mail-2][MailMessageListener:125] Email test@domain.invalid will be ignored because it is included in mail.send.blacklist
  • If you check the value of admin.email.from.address through Server Administration -> Properties -> Portal Properties, you will get the value you have configured.

Environment

  • Liferay DXP

Resolution

Case 1: Retrieving the value from a custom development

  • If you are using the value from the property PropsKeys.ADMIN_EMAIL_FROM_ADDRESS to obtain the email sender, note that this value is static and will be retrieved from the ones defined in portal-ext.properties, whose default value is:
    admin.email.from.address=test@domain.invalid
    • If you check with a Groovy Script the following information:
      out.println(com.liferay.portal.util.PropsValues.ADMIN_EMAIL_FROM_ADDRESS);
  • The outputs differ because the value retrieved for the same property but from Server Administration -> Properties -> Portal Properties, is loaded from PortalPreferences table, where the value is up-to-date.
  • So if you want to retrieve the correct value from your custom development, you have two options:
    1. Update directly portal-ext.properties' value to the correct one.
    2. Change your code and get the value like Liferay does when looking for it from Server Administration -> Portal Properties at this point of the code.

Case 2: Using your own Sign-in widget

  • You have configured the Email Sender in Instance Settings and the admin.email.from.address in your portal-ext.properties, but test@domain.invalid is still being used.
  • If this is the case, review your portlet configuration and update the sender information in the 'Email From' tab.
  • This happens because the specific widget configuration takes precedence over the rest.
这篇文章有帮助吗?
1 人中有 0 人觉得有帮助