如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Postfix SMTP relay docker image. Useful for sending email without using an external SMTP server.
Default configuration is an open relay that relies on docker networking for protection. So be careful to not expose it publicly.
docker pull mwader/postfix-relay or clone/build it yourself. Docker hub image is built for amd64, arm/v7 and arm64.
Postfix http://www.postfix.org/postconf.5.html can be set
using POSTFIX_<name> environment variables. See Dockerfile for default
configuration. You probably want to set POSTFIX_myhostname (the FQDN used by 220/HELO).
Note that POSTFIX_myhostname will change the postfix option
http://www.postfix.org/postconf.5.html#myhostname.
You can modify master.cf using postconf with POSTFIXMASTER_ variables. All double __ symbols will be replaced with /. For example
- POSTFIXMASTER_submission__inet=submission inet n - y - - smtpd
will produce
postconf -Me submission/inet="submission inet n - y - - smtpd"
You can also create multiline http://www.postfix.org/DATABASE_README.html#types using POSTMAP_<filename> like this example:
environment: - POSTFIX_transport_maps=hash:/etc/postfix/transport - | POSTMAP_transport=gmail.com smtp mydomain.com relay:[relay1.mydomain.com]:587 * relay:[relay2.mydomain.com]:587
which will generate file /etc/postfix/transport
gmail.com smtp mydomain.com relay:[relay1.mydomain.com]:587 * relay:[relay2.mydomain.com]:587
and run postmap /etc/postfix/transport.
OpenDKIM configuration options can be set
using OPENDKIM_<name> environment variables. See Dockerfile for default
configuration. For example OPENDKIM_Canonicalization=relaxed/simple.
docker run -e POSTFIX_myhostname=smtp.domain.tld mwader/postfix-relay
app: # use hostname "smtp" as SMTP server smtp: image: mwader/postfix-relay restart: always environment: - POSTFIX_myhostname=smtp.domain.tld - OPENDKIM_DOMAINS=smtp.domain.tld
By default container only logs to stdout. If you also wish to log mail.* messages to file on persistent volume, you can do something like:
environment: ... - RSYSLOG_LOG_TO_FILE=yes - RSYSLOG_TIMESTAMP=yes volumes: - /your_local_path:/var/log/
You can also forward log output to remote syslog server if you define RSYSLOG_REMOTE_HOST variable. It always uses UDP protocol and port 514 as default value,
port number can be changed to different one with RSYSLOG_REMOTE_PORT. Default format of forwarded messages is defined by Rsyslog template RSYSLOG_ForwardFormat,
you can change it to another template (section Reserved Template Names) if you wish with RSYSLOG_REMOTE_TEMPLATE variable.
environment: ... - RSYSLOG_REMOTE_HOST=my.remote-syslog-server.com - RSYSLOG_REMOTE_PORT=514 - RSYSLOG_REMOTE_TEMPLATE=RSYSLOG_ForwardFormat
Wrong timestamps in log can be fixed by setting proper timezone. This parameter is handled by Debian base image.
environment: ... - TZ=Europe/Prague
I see key data is not secure: /etc/opendkim/keys can be read or written by other users error messages.
Some Docker distributions like Docker for Windows and RancherOS seems to handle volume permission in way that does not work with OpenDKIM default behavior of ensuring safe permissions on private keys.
A workaround is to disable the check using a OPENDKIM_RequireSafeKeys=no environment variable.
When sending email using your own SMTP server it is probably a good idea to setup SPF for the domain you're sending from.
To enable DKIM,
specify a whitespace-separated list of domains in the environment variable
OPENDKIM_DOMAINS. The default DKIM selector is "mail", but can be changed to
"<selector>" using the syntax OPENDKIM_DOMAINS=<domain>=<selector>.
At container start, RSA key pairs will be generated for each domain unless the
file /etc/opendkim/keys/<domain>/<selector>.private exists. If you want the
keys to persist indefinitely, make sure to mount a volume for
/etc/opendkim/keys, otherwise they will be destroyed when the container is
removed.
DNS records to configure can be found in the container log or by running docker exec <container> sh -c 'cat /etc/opendkim/keys/*/*.txt you should see something like this:
bash$ docker exec 7996454b5fca sh -c 'cat /etc/opendkim/keys/*/*.txt' mail._domainkey.smtp.domain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n" "j5joTnYwat4387VEUyGUnZ0aZxCERi+ndXv2/wMJ0tizq+a9+EgqIb+7lkUc2XciQPNuTujM25GhrQBEKznvHyPA6fHsFheymOuB763QpkmnQQLCxyLygAY9mE/5RY+5Q6J9oDOQIDAQAB" ) ; ----- DKIM key mail for smtp.domain.tld
postfix-relay is licensed under the MIT license. See LICENSE for the full license text.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务