Postfix setup and forwarding root email to a remote server

c0mputerking

Member
Oct 5, 2011
172
4
18
I have noticed i have not gotten any emails from my proxmox hypervisors they must send some intresting emails right? at least the standard debian stuff? anyways i have checked email on the hypervisor in the root account and there is no email in there.

I am just woundering where if anywhere emails are going I also poked around the /etc/postfix direcotry and found some files in there i have never seen in a standard postfix install. Read through them abit but not sure what is going on there. Would simply adding root: myemail@address.com to the /etc/aliases file and running postalias /etc/aliases work?
 

mir

Famous Member
Apr 14, 2012
3,553
114
83
Copenhagen, Denmark
fix install. Read through them abit but not sure what is going on there. Would simply adding root: myemail@address.com to the /etc/aliases file and running postalias /etc/aliases work?
Yes, provided that you have specified a relay host in /etc/postfix/main.cf.

Do the following as root on each node:
dpkg-reconfigure postfix
1) Choose 'Internet with smarthost' (recommended) to use another mail server for relaying mail or 'Internet Site' (not recommended) for running a full blown mail server on each node. The following assumes smarthost
2) Enter system mail name (node1.foo.tld)
3) Enter SMTP relay host (mail.foo.tld)
4) Root and postmaster mail recipient (myemail@address.com)
5) Other destinations to accept mail for (node1.foo.tld, localhost.foo.tld, localhost)
6) Force synchronous updates on mail queue (No)
7) Local networks (127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128)
8) Use procmail for local delivery (Yes)
9) Mailbox size limit (bytes) (0)
10) Local address extension character (+)
11) Internet protocols to use (ipv4 is the safe choice)
 
  • Like
Reactions: mrE and batijuank

c0mputerking

Member
Oct 5, 2011
172
4
18
Thank you very much, mostly following your great instructions i have gotten one node working now.
Going to setup the rest of my nodes but might have some questions coming up, as the only working node so far is on the same LAN as the main email server.
Predicting differences when relaying from some nodes outside the main email servers LAN.

However still a bit confused not sure where/how to setup the "relay host in my main.cf" is this on the nodes or on the main email server

Here are some notes i made following your instructions

3. For SMTP relay host I tried entering mx1.mymailserver.com but it does not work i get connetion timed out errors. However entering 10.0.0.102 instead works perfectly I am sure this will bite me when setting up remote nodes. Or do i need an email server for each of my remote locations? hmm guess that could be done.

5. A bit different for the other destinations or the same? not sure how the openvz hostname works in this case I accepted the defaults $myhostname, localhost.$mydomain, localhost, host1 which when decoded looks alot like what you suggested i think?

7. For local networks i again used the defaults 127.0.0.0/8 i think the other stuff is ipv6 right? not using here yet.
 

mir

Famous Member
Apr 14, 2012
3,553
114
83
Copenhagen, Denmark
However still a bit confused not sure where/how to setup the "relay host in my main.cf" is this on the nodes or on the main email server
If you followed my instructions this option was configured in step 3.

Here are some notes i made following your instructions

3. For SMTP relay host I tried entering mx1.mymailserver.com but it does not work i get connetion timed out errors. However entering 10.0.0.102 instead works perfectly I am sure this will bite me when setting up remote nodes. Or do i need an email server for each of my remote locations? hmm guess that could be done.
Is your mail host mx1.mymailserver.com resolvable via dns?
If not stick to using the IP

For setting up remote nodes you have two options:
1) Use the default mail server at the remote location as relay host
2) Configure your local mail server to be a mail exchanger for your remote nodes. See the mynetworks option in /etc/postfix/main.cf on your local mail server.
5. A bit different for the other destinations or the same? not sure how the openvz hostname works in this case I accepted the defaults $myhostname, localhost.$mydomain, localhost, host1 which when decoded looks alot like what you suggested i think?
This is ok.
7. For local networks i again used the defaults 127.0.0.0/8 i think the other stuff is ipv6 right? not using here yet.
Yes, the other settings is for ipv6.
 

c0mputerking

Member
Oct 5, 2011
172
4
18
Ok thanks I have gotten all my internal LAN nodes working now, just trying to get my relay host in this instance a remote server to accept mail from all the nodes. So far it is not playing nice with the remote nodes and rejecting thier email it is a Zimbra server so configuration is alway problem. I keep getting errors about null bits on my netmask when trying to add relay domains to Zimbra, I am almost positive the address i am entering is correct, but null bits just the same i have several more to setup maybe they wont give null bits. As you suggested might be better to setup a node as a dedicated relay for each proxmox system (proxmox with some nodes) i have running that would keep all the relaying on the LAN. Also would save me from having to add a relay domain to big bad Zimbra each time i setup a new proxmox system somewhere.

A bit of an aside what about the proxmox hypervision itself should i do a dpkg-reconfigure postfix on it too? hate to mess up my hypervisor plus all the fancy stuff in postfix directory on there.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!