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

Viewing the mail config from the wiki UI overrides the config in xwiki.properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 10.11.9, 11.7, 11.3.4
    • Mail
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Context: you can define a custom mail server port in xwiki.properties using the key mail.sender.port. However, when you set a custom value to this key, and then go to the wiki administration, in the mail section, XWiki will reset to the port 25, which is the default.

      Steps to reproduce :

      • Create a new clean instance, set the key mail.sender.port to something like 1025 in xwiki.propperties
      • In the home page of the wiki put the following code, this will allow to display the currently configured port in the wiki :
        {{velocity}}
        $services.mailsender.configuration.port
        {{/velocity}}
        
      • Go in the administration of the wiki and in the email sending section (http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=emailSend). You can just look at the section and then close your tab / go back to the home page, no need to click "Save".
      • Go back on the home page of the wiki, the port has changed to the default (25)

      Now, this is an issue if the admin "looking" at the page doesn't have access to the web server : he could change the port of the mail server without even knowing it !

      This seems to be related to the migration defined here : https://github.com/xwiki/xwiki-platform/commit/3a20d2aafa0f#diff-2dd0d260d9a299728a76affd2a83340eR48 which creates a MailConfig object with the port 25 as a default value.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              caubin Clément Aubin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: