Created Friday 01 December 2023
I'm using Postfix to send out emails from all the vm's that need to send emails out. It's pre-installed most of the time. If not just do an
apt install postfix
To send out emails, if the hosts domain is not real, then you need to change myorigin to a valid domain and also use the bse-mailx package instead of mailutils. If you do use mail from mailutils, then use the -r option. If you don't, the from field of your outgoing messages will be invalid, which will cause the message to be rejected.
send options
mydomain = servers domain
myhostname = fully qualified name
myorigin = This is important if your domain
is not a real domain because outgoing get stamped using
this as the from address. By default on ubuntu, this is set to a file
this as the from address. By default on ubuntu, this is set to a file
mydestination = a list of command separated fully qualifies server names. All
of these are considered to be localy handled by this server, and are delivered
localy.
localy.
relayhost = This is the host that will reay outgoing mail for us.
mynetworks = space separated list of local networks
Relaying
I have Proxmox Mail Gateway PMG installed and port forwarning all servers on green. So all outgoing mail goes through PMG via port forward in PFSense. I probably should install a second server and move this to HAProxy instead.