I tried to configure the mail service postfix according to the official Proxmox VE wiki. After many hours I gave up and started to look for another solution. I then found a post on howtogeek.com on getting emails working with ssmtp. It's quite easy to setup and worked very well for me.
First install it with
sudo apt-get install ssmtp
This will install ssmtp and remove postfix. Afterwards we can configure the config file at /etc/ssmtp/ssmtp.conf My config looks similar to this:
# Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. email@example.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.example.com # The full hostname hostname=example.com # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address #FromLineOverride=YES AuthUser=user AuthPass=user_password FromLineOverride=yes
I don't have setup an encrypted connection because the server will not send any critical information.
When we configure everything as needed we can try to send a testmail with the following command.
echo "Test message from Linux server using ssmtp" | sudo ssmtp -vvv firstname.lastname@example.org