My mailprovider was rejecting my pve mails. I didn't get it working with postfix. So I tried msmtp and found a working config.
EDIT/Attention: Logfile needs to be at /var/log/msmtp because otherwise AppArmor profile will deny msmtp to write to it.
This is not the most secure configuration. See links at bottom for better ways to store passwords etc.
Step 1 Installation msmtp
	
	
	
		
this replaces postfix as mta
Step 2 add systemwide msmtp config
	
	
	
		
Step 3 create log writeable for everyone
	
	
	
		
thanks to Astraea for updating step 3
Step 4 set E-Mail from in PVE Webinterface to a valid E-mail address
Set a proper From E-Mail address in there. Otherwise it wont work. PVE ignores /etc/aliases

Step 5 Testing
I testet my config by starting the daily update task
Links for more config (Google Account etc., secure config) with msmtp:
- https://wiki.archlinux.org/index.php/msmtp
				
			EDIT/Attention: Logfile needs to be at /var/log/msmtp because otherwise AppArmor profile will deny msmtp to write to it.
This is not the most secure configuration. See links at bottom for better ways to store passwords etc.
Step 1 Installation msmtp
		Bash:
	
	apt install msmtp msmtp-mtaStep 2 add systemwide msmtp config
/etc/msmtprc
		Code:
	
	defaults
port 587
tls on
auth on
logfile /var/log/msmtp
account youraccount
host smtp.yourprovider.com
from youremail@yourprovider.com
user youruser
password yourpassword
account default : youraccountStep 3 create log writeable for everyone
		Bash:
	
	groups msmtp
touch /var/log/msmtp.log
chown msmtp:msmtp /var/log/msmtp
chmod 660 /var/log/msmtpthanks to Astraea for updating step 3
Step 4 set E-Mail from in PVE Webinterface to a valid E-mail address
Set a proper From E-Mail address in there. Otherwise it wont work. PVE ignores /etc/aliases

Step 5 Testing
I testet my config by starting the daily update task
systemctl start pve-daily-update.serviceLinks for more config (Google Account etc., secure config) with msmtp:
- https://wiki.archlinux.org/index.php/msmtp
			
				Last edited: 
				
		
	
										
										
											
	
										
									
								 
	 
	
