rylorin/postfix-relayPostfix SMTP relay docker image. Useful for sending email without using an external SMTP server, or for forward emails for virtual domains.
docker pull rylorin/postfix-relay or clone and build it yourself. Default postfix is configured not to be an open relay as it has to be exposed publicly on Internet to receive your virtual domains emails.
All postfix configuration options can be set using POSTFIX_<name> environment variables. See Dockerfile for default configuration. You can use POSTFIX_myhostname to set the FQDN used by 220/HELO.
docker run \ -e POSTFIX_myhostname=smtp.domain.tld \ --name smtp \ rylorin/postfix-relay
app: # use hostname "smtp" as SMTP server smtp: image: rylorin/postfix-relay restart: always environment: - POSTFIX_myhostname=smtp.domain.tld
When sending email using your own SMTP server it is probably a very good idea to setup SPF for the domain your sending from.
To enable DKIM
specifying a white space separated list of domains in the environment variable
OPENDKIM_DOMAINS. At container start key pairs for each domain will be
generated if not found in /etc/opendkim/keys/<domain>. To persist the keys make
sure to add a host directory volume for /etc/opendkim/keys. If your using
docker-compose it will automatically take care of moving data volumes between
container recreates.
DNS records to configure can be found in the container log or by running
docker exec <container> cat /etc/opendkim/keys/*/mail.txt.
You can set up Postfix to forward all mails coming on your domain email to your other address like gmail.
mail for *** ==> [ site.com Postfix server ] ==> forwarded to ***
First it's necessary to ensure that all mail for your domain will be delivered to your Postfix server. You do that by adding a MX record to your DNS, like:
site.com. 85100 IN MX 10 mail.site.com.
where mail.site.com. is your Postfix server address.
On your docker host you need to setup a directory which will contains your virtual address mapping file.
This directory will be mounted to the docket image and shared with Postfix.
Your virtual file should look like:
@site.com *** *** *** *** @site3.com ***
Read Postfix documentation for more information.
Assemble everything using docker-compose:
version: '2' services: app: # use hostname "smtp" as SMTP server smtp: image: rylorin/postfix-relay environment: POSTFIX_virtual_alias_domains: site.com site2.com site3.com POSTFIX_myhostname: mail.site.com volumes: - /path/to/your/host/conf.d:/etc/postfix/conf.d:rw ports: - 25:25/tcp
postfix-relay is licensed under the MIT license. See LICENSE for the full license text.
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 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 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务