Google for postfix as a SMTP relay. What to do heavily depends on the email provider.
For my provider (netcup) it for example looks like this:
Code:
nano /etc/postfix/main.cf
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
relayhost = [YOURNETCUPSERVER.netcup.net]:465
smtpd_tls_security_level = may
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls = yes
smtp_tls_wrappermode = yes
nano /etc/postfix/sasl_passwd
[YOURNETCUPSERVER.netcup.net]:465 YOURRELAY@YOURDOMAIN.TLD:PASSWORT
postmap /etc/postfix/sasl_passwd
chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
nano /etc/postfix/sender_canonical
/.+@YOURFQDN/ YOURRELAY@OYURDOMAIN.TLD
/.+@YOURDOMAIN.TLD/ OYURRELAY@YOURDOMAIN.TLD
postmap /etc/postfix/sender_canonical
nano /etc/aliases
postmaster: root
webmaster: root
root: WHERE@ITSHOULD.GO
newaliases
service postfix restart
Here sasl is used for authentification. One big problem I had was that the mail provider rejected emails that weren't send from my own valid mail address. My SMTP account was "
MyAdresss@email.tld" so the senders email address has to be "
MyAdresss@email.tld" too or it will be blocked.
So I needed to tell Proxmox in the options which email address to use as sender address (Datacenter -> Options -> Email from address) so that it matches "
MyAdresss@email.tld".