mattmckenzy/mail2gotifySimple stand-alone service that hosts an STMP server, receives mail and redirects them to a Gotify instance.
This application will let you redirect mail to your gotify instance. It can help aggregate notifications from services or systems that don't support Gotify.
Simply fill up the necessary configuration variables, host the service and expose the configured port.
TLS 1.2 or 1.3 is mandatory and Mail2Gotify will need a certificate to function. You can choose to point the "CertLocation" variable to a valid PEM or PKCS7 certificate, or leave it empty to have Mail2Gotify cerate a self-signed one. Keep in mind, however, that self-signed certificates might not be accepted by certain applications, such as pfSense's notifications service. For PEM certificate types, it can also support encrypted or seperate key file certificates if the configuration is properly filled out.
Create a Gotify Application if necessary and point your email notifier to the host and port, using the Gotify App name as the authentication user and the Gotify App token as the authentication password. You can also append a dash and priority number to the application name, i.e. "pfSense-6", to change the priority level of the Gotify notification. Default priority is 5.
Configuring the service is done either the appsettings.json found at "/Mail2Gotify", or with associated environment variables (great for docker). Here's a list and small description of available configuration variables:
| Variable | Default | Description |
|---|---|---|
| Logging:LogLevel:Default | Debug | Default .NET logging level. |
| Logging:LogLevel:Microsoft | Warning | Default .NET Microsoft logging level. |
| Logging:LogLevel:Microsoft.Hosting.Lifetime | Information | Default .NET Microsoft Hosting logging level. |
| Services:Gotify:ServiceUri | Gotify's service uri. | |
| Services:Gotify:Header | X-Gotify-Key | Gotify's authentication header to use (the default is typically correct). |
| Services:Mail2Gotify:HostAddress | The address on which this service resides. | |
| Services:Mail2Gotify:HostPort | 587 | The port that this service will use to receive mail through SMTP. |
| Services:Mail2Gotify:CacheDirectory | The directory to use for persistent caaching (bind with docker for permanency). | |
| Services:Mail2Gotify:CertLocation | The location for the certificate used for TLS encryption. If left empty, Mail2Gotify will create a self-signed certificate using the "Services:Certificate:Name" and "Services:Certificate:Password" variables shown below. | |
| Services:Mail2Gotify:KeyLocation | The location of the PEM key file certificate used for TLS encryption. Only used when CertType is "PEM". | |
| Services:Mail2Gotify:CertPassword | The password of the PEM file if it is encrypted. Only used when CertType is "PEM". | |
| Services:Mail2Gotify:CertType | PEM | The type pf certificate used for TLS encryption. Either "PEM" or "PKCS7". |
| Services:SelfSignedCertificate:Name | Mail2Gotify | The name used for the creation of the self-signed certificate used for the SMTP server's TLS encryption. |
| Services:SelfSignedCertificate:Password | The password used for the creation of the self-signed certificate. |
Here's how I configure my installation :
yamlversion: "3" volumes: cache: services: mail2gotify: container_name: mail2gotify environment: - Services:Mail2Gotify:HostAddress=localhost - Services:Mail2Gotify:CacheDirectory=/cache - Services:Mail2Gotify:CertLocation=/certs/exampledomain.crt - Services:Mail2Gotify:KeyLocation=/certs/exampledomain.key - Services:Gotify:ServiceUri=[***] - TZ=America/Toronto image: mattmckenzy/mail2gotify:latest volumes: - cache:/cache - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro - /mnt/docker/storage/volumes/nginx_data/_data/keys:/certs restart: always ports: - "587:587" network_mode: "host"
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务