]> git.proxmox.com Git - pmg-docs.git/blame - pmgconfig.adoc
pmgconfig.adoc: add missing config files
[pmg-docs.git] / pmgconfig.adoc
CommitLineData
e62ceaf0
DM
1[[chapter_pmgconfig]]
2ifdef::manvolnum[]
3pmgconfig(1)
4============
5:pmg-toplevel:
6
7NAME
8----
9
10pmgconfig - Proxmox Mail Gateway Configuration Management Toolkit
11
12
13SYNOPSIS
14--------
15
16include::pmgconfig.1-synopsis.adoc[]
17
18
19DESCRIPTION
20-----------
21endif::manvolnum[]
22ifndef::manvolnum[]
66e9c719
DM
23Configuration Management
24========================
e62ceaf0
DM
25:pmg-toplevel:
26endif::manvolnum[]
27
685576c2
DM
28{pmg} is usually configured using the web-based Graphical User
29Interface (GUI), but it is also possible to directly edit the
30configuration files, use the REST API over 'https'
66e9c719 31or the command line tool `pmgsh`.
685576c2 32
66e9c719 33The command line tool `pmgconfig` is used to simplify some common
685576c2
DM
34configuration tasks, i.e. to generate cerificates and to rewrite
35service configuration files.
36
66e9c719
DM
37NOTE: We use a Postgres database to store mail filter rules and
38statistic data. See chapter xref:chapter_pmgdb[Database Management]
39for more information.
40
41
42Configuration files overview
43----------------------------
44
45`/etc/network/interfaces`::
46
47Network setup. We never modify this files directly. Instead, we write
48changes to `/etc/network/interfaces.new`. When you reboot, we rename
49the file to `/etc/network/interfaces`, so any changes gets activated
50on the next reboot.
51
9bfe27f3
DM
52`/etc/resolv.conf`::
53
54DNS search domain and nameserver setup.
55
56`/etc/hostname`::
57
58The system's host name.
59
60`/etc/hosts`::
61
62Static table lookup for hostnames.
63
66e9c719
DM
64`/etc/pmg/pmg.conf`::
65
66Stores common administration options, i.e. the spam and mail proxy setup.
67
68`/etc/pmg/cluster.conf`::
69
70The cluster setup.
71
72`/etc/pmg/domains`::
73
74The list of relay domains.
75
76`/etc/pmg/fetchmailrc`::
77
78Fetchmail configuration (POP3 and IMAP setup).
79
80`/etc/pmg/ldap.conf`::
81
82LDAP configuration.
83
84`/etc/pmg/mynetworks`::
85
86List of local (trusted) networks.
87
88`/etc/pmg/subscription`::
89
90Stores your subscription key and status.
91
92`/etc/pmg/transports`::
93
94Message delivery transport setup.
95
96`/etc/pmg/user.conf`::
97
98GUI user configuration.
99
100
101Keys and Certificates
102---------------------
103
104`/etc/pmg/pmg-api.pem`::
105
106Key and certificate (combined) used be the HTTPs server (API).
107
108`/etc/pmg/pmg-authkey.key`::
109
110Privat key use to generate authentication tickets.
111
112`/etc/pmg/pmg-authkey.pub`::
113
114Public key use to verify authentication tickets.
115
116`/etc/pmg/pmg-csrf.key`::
117
118Internally used to generate CSRF tokens.
119
120`/etc/pmg/pmg-tls.pem`::
121
122Key and certificate (combined) to encrypt mail traffic (TLS).
123
124
125Service Configuration Templates
126-------------------------------
127
9c85cc80
DM
128{pmg} uses various services to implement mail filtering, for example
129the {postfix} Mail Transport Agent (MTA), the {clamav} antivirus
130engine and the Apache {spamassassin} project. Those services use
131separate configuration files, so we need to rewrite those files when
132configuration is changed.
133
134We use a template based approach to generate those files. The {tts} is
135a well known, fast and flexible template processing system. You can
136find the default templates in `/var/lib/pmg/templates/`. Please do not
137modify them directly, because your modification would get lost on the
138next update. Instead, copy them to `/etc/pmg/templates/`, then apply
139your changes there.
140
141Templates can access any configuration setting, and you can use the
142`pmgconfig dump` command to get a list of all variable names:
143
144----
145# pmgconfig dump
146...
147dns.domain = yourdomain.tld
148dns.hostname = pmg
149ipconfig.int_ip = 192.168.2.127
150pmg.admin.advfilter = 1
151...
152----
153
154The same tool is used to force regeneration of all template based
155configuration files. You need to run that after modifying a template,
156or when you directly edit configuration files
157
158----
159# pmgconfig sync --restart 1
160----
161
162Above commands also restarts services if underlying configuration
163files are changed. Please note that this is automatically done when
164you change the configuration using the GUI or API.
165
166NOTE: Modified templates from `/etc/pmg/templates/` are automatically
167synced from the master node to all cluster members.
66e9c719
DM
168
169
685576c2
DM
170System Configuration
171--------------------
172
173Network and Time
174~~~~~~~~~~~~~~~~
175
176ifndef::manvolnum[]
177image::images/screenshot/pmg-gui-network-config.png[]
178endif::manvolnum[]
179
45de5bf5
DM
180Normally the network and time is already configured when you visit the
181GUI. The installer asks for those setting and sets up the correct
182values.
183
184The default setup uses a single Ethernet adapter and static IP
185assignment. The configuration is stored at '/etc/network/interfaces',
186and the actual network setup is done the standard Debian way using
187package 'ifupdown'.
188
189.Example network setup '/etc/network/interfaces'
190----
191source /etc/network/interfaces.d/*
192
193auto lo
194iface lo inet loopback
195
196auto ens18
197iface ens18 inet static
198 address 192.168.2.127
199 netmask 255.255.240.0
200 gateway 192.168.2.1
201----
202
203.DNS recommendations
204
205Many tests to detect SPAM mails use DNS queries, so it is important to
206have a fast and reliable DNS server. We also query some public
207available DNS Blacklists. Most of them apply rate limits for clients,
208so they simply will not work if you use a public DNS server (because
209they are usually blocked). We recommend to use your own DNS server,
210which need to be configured in 'recursive' mode.
685576c2
DM
211
212
213Options
214~~~~~~~
215
216ifndef::manvolnum[]
217image::images/screenshot/pmg-gui-system-options.png[]
218endif::manvolnum[]
219
220include::pmg.admin-conf-opts.adoc[]
221
222
223Backup and Restore
224~~~~~~~~~~~~~~~~~~
225
226ifndef::manvolnum[]
227image::images/screenshot/pmg-gui-backup.png[]
228endif::manvolnum[]
229
230TODO
231
232
e62ceaf0
DM
233
234ifdef::manvolnum[]
235include::pmg-copyright.adoc[]
236endif::manvolnum[]
237