Add port to erpnext links

In mails there is added the link to the documents on the server.
Unfortunately we have to run the server on a non standard port.

Is there a way that the links include the port in the address?
Would need:

1 Like

Any hint someone can give?

We need to find the templates which generates that links.