Info
To send emails via a relay host, it is sufficient to simply follow the manual: 14.7. Configuration of the mail server — Univention Corporate Server - Manual for users and administrators
This help article explicitly points out the necessary procedure so that the relay also works via a specific port, here port 587.
We will update the documentation in the future: Bug 57084 – Mail relay host configuration insufficient
2024-07-17 We updated the documentation (see the link above) and you can proceed/use either that or this help article.
1. UCR-variable mail/smtpport
The variable mail/smtpport specifies the port on which postfix is listening. If this is changed, postfix can no longer receive anything from the UMC because it sends with port 25. For example, if emails are sent via self-service, the variable should remain set to 25:
ucr set mail/smtpport=25
2. UCR-variable mail/relayhost
The desired port for the relay (here port 587) is set in this variable and placed after the host name, separated by a colon. The host name of the variable mail/relayhost is set here with square brackets so that exactly this server is addressed without querying an MX record:
ucr set mail/relayhost='[mail.server.de]:587'
3. /etc/postfix/smtp_auth
The same entry from mail/relayhost must also be entered into the configuration file /etc/postfix/smtp_auth, followed by username/password, like described in the handbook:
[mail.server.de]:587 username:password
4. Update the authentication mapping
This step is necessary to update the postfix lookup tables, to apply the changes to the configuration file:
postmap /etc/postfix/smtp_auth
5. Reload the postfix service
Finally reload the postfix service to re-read the configuration files:
postfix reload