[SOLVED] Newbie Question

Astraea

Renowned Member
Aug 25, 2018
224
41
68
I have been thinking about deploying PMG on my network and have read many forum posts and also the manual but still not sure it will do what I am hoping it will. Here are my newbie questions, I have been using ProxmoxVE for 3 years now but have yet to really dive into the PMG.

1. Can I setup PMG to accept all incoming mail for a domain and forward it to a specific email address? For example, let us say my domain is example.com and I want to forward all email to username@testsite.com which is on an externally hosted email server. Is this possible?

2. Can I have all outgoing mail go through PMG but also have mail sent from PMG that is not associated with an email server? What I mean is let us say I have example.com hosted on a Zimbra installation. I would have it so that PMG would process all the outgoing mail for that domain from that server. But can I also have PMG process mail from say an internal website that it sending mail to update me if something breaks, such as emails sent from my Nextcloud installation?

3. Could I use PMG to allow me to send different mail to different servers without having to change any settings at my registrar or an existing downstream email server? What I would like to do is say I have PMG handling 2 domains, we will call them example.com and example2.com. If I wanted to test a new mail server or test updates can I just log in to PMG and redirect all mail for example2.com to the new server? This would help me out a ton for testing as I have an unused domain but also when upgrading mail servers as I could just flip the switch so to speak when everything is ready on the new install.
 
I still have not figured out question 1, though I am planning to install PMG this week and backing it with hmailserver. I will be shutting off my production Zimbra install while I test. I will start with all emails being received by hmailserver and forwarded to another email address for safekeeping offsite. Then I will then setup PMG to receive all email and send all email for the two production domains and leave the third to have PMG send it by itself to a specific email address.

As for questions 2, I am still not sure if this it is possible for a random service such as a pfsense install to send emails through it or if it would have to point to Zimbra and then go through PMG

For question 3 i believe i have this understood now.
 
1. Not by default, you could perform that by manual postfix adjustments, however, you need to be sure, what you do with the shell to set this behavior

2. As far the system has a mail server locally installed, which can be adjusted to send mails through another system (transport file), you can do so, otherwise, PMG is not meant for direct sending mails. However, you may add smtp auth or allow internal IP networks manually.

3. It's not such easy, for sure you could change PMG to the IP of your MX server, that's the easiest thing, you can do, but if you would want to temporary add or remove, don't see see an easy fast and faulty-safe solution therefor. Sure, you can play with MX priorities, but that's all. However, I recognized, that such changes usually are really fast.
 
I spent some more time with a test PMG setup and wanted to get some input on how I plan to implement it / solve my 3 questions.

1. If I want to redirect all emails from a particular domain could I not create an inbound rule that would match on any @domain.name and forward that email to a specified address and then delete the email from PMG's queue instead of relying it on to the backend server?

2. Still working on this one, though It is not a massive deal as I will normally have a local email server available to said applications.

3. My plan is to have all the MX records for my domains to point to "mail.domain.name" which then has an associated CNAME record of mail which points to @, the A record would then resolve @ to my external IP address. This would direct all mail traffic on my domains to my external IP which is then passed through as the router would be set to forward all traffic on the specified ports (still need to figure out where the split is for PMG and Zimbra) to the PMG server. PMG would then be set to rely the domain to a specified server for example "testmail.domain.name". The router would have a DNS override to point "testmail.domain.name" to a local IP address of a mail server. So if I wanted to change which server it went to I could update the PMG entry and either specify an FQDN or an IP address as far as I am aware.
 
1. You could do that by adjusting postfix very much, however, that will stop PMG working as designed, so would also result in your test getting into wrong results. I would not recommend to do so. Disable the quarantine and use spam tagging instead wouldn't do anything to your mails just by adding an extra scanning step, so you should be fine to test that way.

2. As you have a local mail server, you can just use its transport file to transport through PMG to the internet, no big deal.

3. Sure, but like all DNS changes, this may take some time to get spread worldwide or get updated worldwide on the machines. However, if you have a router or firewall or sth. else in front of your infrastructure, e.g. also in front of PMG, then it's really easy to let your router point either to the PMG or to another mail server inside your network to switch very fast.
 
I finally bit the bullet and installed PMG and set it up so that it was in front of my Zimbra installation. I was able with a PMG mail filter to get it so that all email from domain1.com was sent to email@externaldomain.com and also blocked from reaching the Zimbra server. This would allow me to take the backend email server offline and still have emails forwarded to an external email address for retrieval later. I was also able to get my Zimbra server to send emails from other applications without any issues.

So far I am really liking the PMG and will be putting it into production shorty on a proper PVE VM but first I need to organize some other design elements that will be implemented at the same time.
 

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 yours easily in our online shop.

Buy now!