大网数据广告活动
服务器运维问答

How can I bypass mailhog in Docker4Drupal?

· 52CE 我爱测

I am using Docker4drupal , a preconfigured set of docker containers. One of the containers is the mailhog tool. Docker4drupal is configured to use mailhog as email sender so it captures all mail sent for developing purposes. This…

问题原文

原帖链接 · Edu · CC BY-SA 4.0

I am using Docker4drupal, a preconfigured set of docker containers.

One of the containers is the mailhog tool.

Docker4drupal is configured to use mailhog as email sender so it captures all mail sent for developing purposes. This is great but I would to allow some emails to pass through.

How can I bypass mailhog for certain emails?

I can think on those approaches:

  1. Temporary reconfigure docker4drupal to use an smtp server.
  2. Make mailhog forward emails using an smtp server.

I don't know how to accomplish any of them. How can I do this? I there any other better approach?

已采纳解答

原帖链接 · Moshe Katz · CC BY-SA 4.0

Mailhog's documentation describes how to set it up to release emails to an SMTP server.

In short, you need to set the environment variable MH_OUTGOING_SMTP to contain a JSON object which points to the SMTP server(s) you want to release the message to:

{
    "server name": {
        "name": "server name",
        "host": "...",
        "port": "587",
        "email": "...",
        "username": "...",
        "password": "...",
        "mechanism": "PLAIN"
    }
}

Note that in this configuration you still need to manually "release" the messages in the mailhog interface. I don't think there is a way to tell it something like "auto-release all messages that are being sent to [email omitted]" or similar.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-06-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。