Changing the server name in notification emails

xwiki version 16.10.9

I’ve moved my xwiki to a new server, but the links in notification emails still contain the old server name (IP address actually). I’ve searched everywhere to try and work out where it might be getting this name from - and the only possibility i’ve found is in the xwikistrings database table where there is a ‘server’ key entry, which contains the old server name.

However i can’t find any where in the settings to allow me to change this… short of manually changing the entry in the database, which seems slightly dangerous, and probably unnecessary.

How to I go about changing this server name?

Hi! Perhaps this is too obvious, but have you checked your Administer Wiki > Mail > Mail Sending settings?

Yes, it’s not there. Just to clarify - the e-mail notifications are sending correctly - but in the content of the emails there are hyperlinks to the xwiki - but these contain the wrong server name.

I’m just guesting but; my server name is found in my Nginx .conf files.

Thanks for the suggestion, but I don’t think this is anything to do with Ngnix - we aren’t even using Nginx.
I’m fairly confident the only place it can be picking up the wrong name is from the xwikistrings table in the database - but I can’t find any interface for editing them - surely it’s not correct to be modifying these tables manually.

Many times I feel myself scared by all the possibilities XWiki offers us to customize contents! It is the price of freedom! :wink:

I investigated a bit further. I’m sure we will find the answer by studying the content of the XWiki.Mail object instantiated on https://yourmain.here/xwiki/bin/view/XWiki/Notifications/MailTemplate.

I found that reference here: https://extensions.xwiki.org/xwiki/bin/view/Extension/Notifications%20Application/

Likewise, I’m stuck myself for doing more research, as I’m not authorized yet to send messages using my corporative email server.

HTH!

Also! It could be worth to have a look to the template store in /usr/lib/xwiki/templates/notification in your server folders’ structure.

Hi! By doing some more research, I found that I’m facing the same issue on a new XWiki Debian 17.7.0 on Ubuntu 24.04.3 LTS box. In my case, the host part of the URLs in notifications points to http://localhost:8080. I will keep this thread posted if I find the solution. There are several related forum entries we need to pay attention to.

For instance:

…and…

Setting xwiki.home did the trick for me. No side effects identified so far. Annotation works fine. The variable reads now:

xwiki.home=https://our.public.domain.name/

Our XWiki server is behind a Nginx proxy, but I don’t find any reason why it must not work in your environment.

HTH!

In XWiki, email links come from the configured server/base URL, not directly from the database. Update the server URL in the XWiki configuration (usually xwiki.cfg or via Admin → Configuration → General → Server URL if available), then restart XWiki. Once that’s set correctly, notification emails will use the new server name—no need to edit the database manually.