Hi devs,
I’m working on
http://jira.xwiki.org/browse/XWIKI-13546 ("Error in the log when
sending a mail through the Mail API”). One way to fix it would to always look for the
Mail.Config page in the main wiki instead of in the current wiki.
Actually the current algorithm is the following when looking up a mail configuration
property:
* <ul>
* <li>Look in Mail.MailConfig in the current wiki</li>
* <li>[Backward compatibility] Look in (current space).XWikiPreferences in the
current wiki</li>
* <li>[Backward compatibility] Look in XWiki.XWikiPreferences in the current
wiki</li>
* <li>Look in the xwiki properties file</li>
* </ul>
We also need to implement
http://jira.xwiki.org/browse/XWIKI-12435 (“Use the Main Wiki
Mail Configuration if not overridden at the subwiki level”):
“
Right now when sending a mail in a subwiki, the configuration is taken from that
subwiki's Mail.MailConfig document.
In a non-farm use case, it's a pain to have to configure SMTP settings for each
subwiki.
It would be better to look into the main wiki's mail configuration when there's no
overridden config at the subwiki's level.
"
So I can see 2 options.
Option 1: Drop support for looking for configuration in subwikis
========
* Rationale: there are few use cases that require overriding the mail config in a subwiki
* Potential issue: if we stop looking for *.XWikiPreferences or for <current
wiki>:Mail.Config then we won’t migrate configurations but always use the config from
the main wiki. So backward compat is theoretically broken.
* But it’s likely that the config in subwikis is the same as the config from the main wiki
anyway. It’s also likely that if a subwikis smtp server is configured, then the main wiki
is also configured. So it could be acceptable with a message in the Release Notes.
Option 2: Continue supporting overriding in subwikis
========
* Stop bundling Mail.Config for subwikis and modify the config algorithm to be:
* <ul>
* <li>Look in Mail.MailConfig in the current wiki</li>
* <li>[Backward compatibility] Look in (current space).XWikiPreferences in the
current wiki</li>
* <li>[Backward compatibility] Look in XWiki.XWikiPreferences in the current
wiki</li>
* <li>Look in Mail.MailConfig in the main wiki</li>
* <li>Look in the xwiki properties file</li>
* </ul>
I’ve discussed it quickly with Denis who prefers option 1 since he even sees the ability
to configure the smtp server at the wiki level a potential issue (bypassing the farm
admin).
Personally I’m hesitating and I’d hate to remove the local override and then find some use
cases where we need it.
WDYT?
Thanks
-Vincent