Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84320

Deny sending mail when sender is unconfigured (e.g. test@liferay.com)

    Details

      Description

      From time to time, systems are configured with default settings, e.g. administrator names "test@liferay.com". As this is not even legit for Liferay-internal systems, I'd consider a system as "unconfigured for mail" as long as this is the sender address.

      I'm proposing to suppress any outgoing mail, instead raise an error stating that the sender address needs to be configured and can't be test@liferay.com.

      Preferably backported to whatever versions are still under active development.

      Added by Jorge Diaz:

      Steps to Reproduce

      1. Start Liferay, with default configuration. (test@liferay.com)
      2. Go to "Sign In" => "Create account"
      3. Create a test account with any random value
      4. After account creation, a email is sent, check log file:
        • Expected behevior: A warning is written in log and mail isn't sent
          • 2019-09-06 06:48:29.512 WARN  [liferay/mail-1][MailMessageListener:135] Email test@liferay.com will be ignored because it is included in mail.send.blacklist
        • Wrong behevior: No warning is written in log and mail is sent

      Important changes

      LPS-84320 denies sending mail when sender is unconfigured (e.g. test@liferay.com)

      In case email sender is not correctly configured in your server, mails won't be sent and you will start seeing following warn traces in the log file:

      • [liferay/mail-1][MailMessageListener:135] Email test@domain.invalid will be ignored because it is included in mail.send.blacklist
      • [liferay/mail-1][MailMessageListener:135] Email test@liferay.com will be ignored because it is included in mail.send.blacklist
      • [liferay/mail-1][MailMessageListener:52] Skipping email because the sender is not specified

      In order to avoid that warn traces and mail issues, you will have to configure a correct email in portal-ext.properties:

      admin.email.from.address=...your admin user email...
      announcements.email.to.address=...your no-reply email...

      Note: noreply@liferay.com, test@liferay.com, noreply@domain.invalid, and test@domain.invalid are considered invalid email addresses.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 weeks, 1 day ago

                  Packages

                  Version Package
                  7.0.0 DXP FP87
                  7.0.10.12 DXP SP12
                  7.0.X
                  7.1.X
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.X
                  7.2.1 CE GA2
                  Master