Sending shares per Mail loses the portnumber and ends in a wrong url

Hello everyone,

I use my Nextcloud Installation from behind a Provider, which only gives out DS-Lite Ipv6 Adresses.
To publicly access my Cloud, I use a DynDns service, in combination with a Portmapper. (This did take quite a while to get to work)

Now I can access my Nextcloud under and it works just perfect.

However, if I share a folder and use the mail function, to share the url, an email ist sent as:

“Click here:…” without the port and as such doesnt work.

How could I resolve this?

Many Greetings from Germany,


you have to use this options in your config/config.php:


         * The automatic hostname detection of Nextcloud can fail in certain reverse
     * proxy and CLI/cron situations. This option allows you to manually override
     * the automatic detection; for example ````, or specify the port
     * ````.
    'overwritehost' => '',