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. [email protected])

    Details

      Description

      From time to time, systems are configured with default settings, e.g. administrator names "[email protected]". 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 [email protected]

      Preferably backported to whatever versions are still under active development.

      Added by Jorge Diaz:

      Steps to Reproduce

      1. Start Liferay, with default configuration. ([email protected])
      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 [email protected] 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. [email protected])

      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 [email protected] will be ignored because it is included in mail.send.blacklist
      • [liferay/mail-1][MailMessageListener:135] Email [email protected] 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: [email protected], [email protected], [email protected], and [email protected] are considered invalid email addresses.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sharry.shi Sharry Shi
              Reporter:
              olaf.kock Olaf Kock
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 3 days ago

                  Packages

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