Basic Settings, Concept and Terminology for Beginners (PMG 6.1.2 Cluster)

J.a.c.o.b

New Member
Apr 17, 2020
1
0
1
Hi everyone,

I started using Proxmox mail gateway version 6.1.2 to understand and experience it. We do not currently have a production environment. If I manage to operate as we want, we want to use it as production.

The structure in the environment we use is as follows.

The first request comes to the HAProxy Load Balancer server. HaProxy listens for TCP 25, TCP 587, TCP 465 ports. HAProxy distributes the load to a total of 3 servers with "round robin" (1 master server, 2 node server).

I will have some questions in this structure. My mother tongue is not in English so if I'm not understandable enough, I apologize in advance for this.

1) I would like to permanently add the subject of the e-mail logs to each gateway server. Unfortunately, the subject of the e-mail is not visible at the moment. How can I do this, could you please give detailed examples?

2) I see the application that "postgres" works on all mail gateway servers. I have no information about postgresql. Is it possible to change the database in the mail gateway to MariaDB Cluster?

3) Is it currently working as a postgresql cluster, is data stored separately in each gateway? Can you give some details on this subject?

4) What is PostgreSQL admin username and password? I want to check the tables and data in postgresql.

5) What are your suggestions or suggestions to be considered in the production environment? (Make sure to back up this folder, do the following daily, pay attention to this, etc.)
 
The first request comes to the HAProxy Load Balancer server. HaProxy listens for TCP 25, TCP 587, TCP 465 ports. HAProxy distributes the load to a total of 3 servers with "round robin" (1 master server, 2 node server).

I really would suggest to start with a smaller environment and only add clustering/loadbalancing/etc as the need arises.
If you want to have availability during upgrades etc - 2 nodes in a cluster should be enough.
e.g. SMTP from server to server (MTA to MTA) is quite resilient if you add two MX records for both nodes to your domain.

If your users clients (MUAs) connect directly to the PMG then maybe a loadbalancer might help. (however PMG in general is meant to be deployed after your inbound and userfacing server).
Regarding port 465 (smtps) and 587 (submission) - PMG usually does not listen to those ports (465 is not so widely deployed and afaik depracated in favor of STARTTLS over 25, and 587 is used for autheticated mail submission by end-user clients (see the point above - it's not PMGs classical deployment point) - you can adapt the configuration to listen on 465 and on 587 with appropriate configs by overriding the settings in the configuration template for postfix' 'master.cf' - see https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

2) I see the application that "postgres" works on all mail gateway servers. I have no information about postgresql. Is it possible to change the database in the mail gateway to MariaDB Cluster?
Postgres is quite central in PMGs code - and while most queries should be SQL standard compliant, the creation and handling and upgrading of the Database during package-upgrades is definitely postgres specific - so in short - it's not possible to swap out Postgresql with MariaDB (without quite some adaptation of the source code)
I would also recommend to use the PMG GUI to manipulate the data in the database (because a few constraints and sanity checks have to happen in the code outside of sql)

3) Is it currently working as a postgresql cluster, is data stored separately in each gateway? Can you give some details on this subject?
the data is individually stored and synced to each PMG via the pmg-clustering stack (mostly based on ssh, rsync, and socket forwarding for the postgres connection) - this has shown to be quite robust and gives you the advantage that you can at any point remove any node from you cluster (you should eventually remove it from the cluster config as well as promote a new node to master if you removed the master) and mailprocessing will continue to work without any problems.

a general overview of the clustering stack can be found in the reference documentation: https://pmg.proxmox.com/pmg-docs/pmgcm.1.html

4) What is PostgreSQL admin username and password? I want to check the tables and data in postgresql.
postgres handles authentication quite nicely and flexibly - in short if you are user 'myuser' on the shell and connect to a postgres database cluster as user 'myuser' thats enough credentials (in the default configuration, which trusts local user information) - see the excellent postgres documentation for more details https://www.postgresql.org/docs/11/client-authentication.html

5) What are your suggestions or suggestions to be considered in the production environment? (Make sure to back up this folder, do the following daily, pay attention to this, etc.)
as far as backups are concerned the 'pmgbackup' command should backup everything for a working configuration of you PMG (you need to save the network and hostname configuration separately and you should also backup everything you need to backup from a regular linux system).

I hope this helps!
 

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!