From 85bf9f319b92683b42fe4e115604614fa62f4a0f Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 10 Feb 2025 23:43:44 +0100 Subject: [PATCH] New Script: Proxmox Mail Gateway (#1906) * Proxmox Mail Gateway LXC * improvements * renamed to long name and added install check * Update proxmox-mail-gateway.sh * Update proxmox-mail-gateway.sh * Update proxmox-mail-gateway.json * Update proxmox-mail-gateway-install.sh * Update proxmox-mail-gateway.sh * Update proxmox-mail-gateway.sh * Update proxmox-mail-gateway-install.sh --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/proxmox-mail-gateway.sh | 43 +++++++++++++++++++++++++ install/proxmox-mail-gateway-install.sh | 36 +++++++++++++++++++++ json/proxmox-mail-gateway.json | 39 ++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 ct/proxmox-mail-gateway.sh create mode 100644 install/proxmox-mail-gateway-install.sh create mode 100644 json/proxmox-mail-gateway.json diff --git a/ct/proxmox-mail-gateway.sh b/ct/proxmox-mail-gateway.sh new file mode 100644 index 000000000..7aba78ed3 --- /dev/null +++ b/ct/proxmox-mail-gateway.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: thost96 (thost96) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.proxmox.com/en/products/proxmox-mail-gateway + +APP="Proxmox-Mail-Gateway" +var_tags="mail" +var_cpu="2" +var_ram="4096" +var_disk="10" +var_os="debian" +var_version="12" +var_unprivileged="1" + +header_info "$APP" +base_settings + +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -e /usr/bin/pmgproxy ]]; then msg_error "No ${APP} Installation Found!"; exit; fi + msg_info "Updating ${APP}" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Updated ${APP}" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:8006/${CL}" diff --git a/install/proxmox-mail-gateway-install.sh b/install/proxmox-mail-gateway-install.sh new file mode 100644 index 000000000..0b0ef63de --- /dev/null +++ b/install/proxmox-mail-gateway-install.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: thost96 (thost96) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get -y install \ + curl \ + sudo \ + mc \ + wget +msg_ok "Installed Dependencies" + +msg_info "Installing Proxmox Mail Gateway" +wget -q https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg +echo "deb http://download.proxmox.com/debian/pmg bookworm pmg-no-subscription" > /etc/apt/sources.list.d/pmg.list +$STD apt-get update +$STD apt-get -y install proxmox-mailgateway-container +msg_ok "Installed Proxmox Mail Gateway" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/proxmox-mail-gateway.json b/json/proxmox-mail-gateway.json new file mode 100644 index 000000000..3028dbd20 --- /dev/null +++ b/json/proxmox-mail-gateway.json @@ -0,0 +1,39 @@ +{ + "name": "Promox Mail Gateway", + "slug": "proxmox-mail-gateway", + "categories": [ + 1 + ], + "date_created": "2025-02-04", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8006, + "documentation": "https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html", + "website": "https://www.proxmox.com/en/products/proxmox-mail-gateway/overview", + "logo": "https://raw.githubusercontent.com/home-assistant/brands/master/core_integrations/proxmoxve/icon.png", + "description": "Proxmox Mail Gateway is the leading open-source email security solution helping you to protect your mail server against all email threats from the moment they emerge.", + "install_methods": [ + { + "type": "default", + "script": "ct/proxmox-mail-gateway.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 10, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "root", + "password": null + }, + "notes": [ + { + "text": "Set a root password if using autologin. This will be the PMG password. `passwd root`", + "type": "warning" + } + ] +}