Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10623

Mail sending should use the "admin_email" xproperty instead of "smtp_from"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.1
    • Fix Version/s: 6.2-milestone-1
    • Component/s: Mail
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      In the new mail sender API the algorithm is the following:

      • look for a "smtp_host" xproperty in WebPreferences (current space)
      • if not defined, look for a "smtp_host" xproperty in XWikiPreferences
      • if not defined, look for a "mail.sender.from" configuration property in xwiki.properties
      • If not defined, return null

      I'm proposing 2 changes:

      • Remove the usage of "smtp_from" since this xproperty doesn't exist by default in XWikiPreferences. Instead use "admin_email".
      • Use a default value of "no-reply@xwiki.org" as a fallback when the from is not defined anywhere + raise a warning in the logs.

      Note: Ideally we would be able to compute the domain name but this can be computed only from a request. So in the future I'd like to have some Servlet Filter that saves the host name on the first request and puts it in the application context for later retrieval.

      Any better idea?

        Attachments

          Activity

            People

            Assignee:
            vmassol Vincent Massol
            Reporter:
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: