PMG Post Install
Set up package repositories, the subscription notice and updates on a Proxmox Mail Gateway host.
post-pmg-install.sh does for Proxmox Mail Gateway what PVE Post Install does for Proxmox VE.
Website entry: post-pmg-install. Source: tools/pve/post-pmg-install.sh.
Run
In the Proxmox Mail Gateway shell, as root:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/post-pmg-install.sh)"The script exits with 232 unless the package proxmox-mailgateway or proxmox-mailgateway-container is installed, and with 1 on ARM64.
Prompts
After the text prompt Start the Proxmox Mail Gateway Post Install Script (y/n)? the script asks one whiptail menu per step. The Debian codename is read from VERSION_CODENAME in /etc/os-release and used in all files it writes.
| Menu title | Choices | Effect |
|---|---|---|
| PMG SOURCES | yes | Writes /etc/apt/sources.list.d/debian.sources (deb822; the release, its -updates and -security suites; main contrib non-free non-free-firmware) and deletes /etc/apt/sources.list. |
| PMG-ENTERPRISE | see below | |
| PMG-NO-SUBSCRIPTION | see below | |
PMG TEST (only if pmgtest is not found anywhere) | yes | Writes /etc/apt/sources.list.d/pmgtest.sources with Enabled: no. |
| SUBSCRIPTION NAG | yes | Writes /usr/local/bin/pmg-remove-nag.sh and the APT hook /etc/apt/apt.conf.d/no-nag-script, and removes the older /etc/apt/apt.conf.d/no-nag-script-pmgmanagerlib-mobile. |
no | Deletes those three files. | |
| UPDATE | yes | apt update and apt -y dist-upgrade. |
| REBOOT | yes | Reboots the host. |
The enterprise and no-subscription menus depend on what the script finds in /etc/apt/sources.list, *.list and *.sources:
| State | Choices |
|---|---|
| Enabled | keep, disable, delete (removes the file that contains the repository) |
| Disabled | enable, keep, delete |
Missing, pmg-enterprise | no (default) or yes: writes /etc/apt/sources.list.d/pmg-enterprise.sources |
Missing, pmg-no-subscription | yes: writes /etc/apt/sources.list.d/pmg-no-subscription.sources; no |
disable and enable set Enabled: no or Enabled: yes in a .sources file, and comment or uncomment the lines of a .list file.
The nag script patches these files if they exist: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js, /usr/share/javascript/pmg-gui/js/pmgmanagerlib-mobile.js and /usr/share/pmg-mobile-quarantine-ui/pmg-mobile-index.html.tt. After the nag question the script reinstalls proxmox-widget-toolkit and pmg-gui (and pmg-mobile-quarantine-ui if installed), which applies the patch or restores the original files.
Undo
- Subscription notice: run the script again and answer
noat SUBSCRIPTION NAG. - Repositories: run the script again; existing repositories can be enabled, disabled or deleted.
/etc/apt/sources.listis deleted without a backup when you answeryesat PMG SOURCES.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base URL the script loads api/api.func from. |
Limits
disableanddeleteact on the whole file that contains the repository. If a file holds several repositories, all of them are affected.- A
.sourcesfile counts as disabled only if it has anEnabled: noline. - In a PMG cluster, run the script on every node.