【问题标题】:Graylog SMTP server without TLS/SSL没有 TLS/SSL 的 Graylog SMTP 服务器
【发布时间】:2016-05-25 11:39:25
【问题描述】:

我想通过 docker 启动带有 smtp 支持的 graylog。我是这样做的:

docker run -d -p 9000:9000 -p 12201:12201 -p 12201:12201/udp \
  -e GRAYLOG_NODE_ID=My_Node_Id \
  -e GRAYLOG_SMTP_SERVER="Server.name.local --no-tls --no-ssl --web-url=http://web.name.local" \
  -e GRAYLOG_SERVER_SECRET=Secret \
  -v /graylog/data:/var/opt/graylog/data \
  -v /graylog/logs:/var/log/graylog graylog2/allinone

Graylog 工作正常,只是我无法发送电子邮件测试消息(在 Graylog 中:Streams - 管理警报 - 发送测试警报)。这样做我会在网络界面中看到一个错误屏幕

删除

--no-tls

从 docker 配置中,我看不到那个屏幕。但当然现在我收到一条错误消息

尝试发送电子邮件时出错! (触发 20 小时 前) Graylog 服务器在尝试发送 电子邮件。这是详细的错误消息: org.apache.commons.mail.EmailException:将电子邮件发送到 以下服务器失败:Server.name.local:587 (javax.mail.MessagingException:无法将套接字转换为 TLS; 嵌套异常是:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:P KIX 路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException:无法 找到请求目标的有效认证路径)

这个错误没有问题,因为没有 tls/ssl 支持。

但是为什么我在使用 --no-tls 的 Web 界面中会出现错误屏幕?任何想法如何在没有 ssl 的情况下发送邮件?我对 docker 做错了吗?有没有人在没有 tls/ssl 的情况下成功使用 docker、graylog 和 email?

在图片中,可以阅读

请检查右侧显示的服务器是否正在运行,并且 可达。

右上方红条下方的ip地址不可达。我什至不知道那个IP地址。那个ip地址是从哪里来的?我需要改变它吗?为什么只有在激活 --no-tls 时才会失败?

我正在使用可以通过 docker 获取的最新版本。

$ docker pull graylog2/allinone
Using default tag: latest
latest: Pulling from graylog2/allinone
e9c5e611068d: Already exists
c29de585b225: Already exists
0b3e3644d782: Already exists
a3ed95caeb02: Already exists
f9cf24c26853: Already exists
ff82d8c50b3d: Already exists
4136ecd1ecd2: Already exists
Digest: sha256:ec56d3678f072...
Status: Image is up to date for graylog2/allinone:latest

更新::

graylog2/allinonedocker container site 上,我刚刚读到它已被弃用,应该使用 graylog2/server。我会试一试。

我迷路了。非常感谢任何提示!

【问题讨论】:

  • 请参阅docs.graylog.org/en/2.0/pages/… 了解相关的常见问题解答项目。
  • 嗨 joschi,感谢您的回复。但我确实想使用 tls/ssl。我想我必须以某种方式设置“no_auth”smpt 服务器。我目前正在尝试将设置 #transport_email_use_auth = true #transport_email_use_tls = true #transport_email_use_ssl = true 更改为 false ...

标签: docker graylog2 graylog


【解决方案1】:

在尝试让graylog2/server 启动并运行但失败后,我返回graylog2/allinone,终于成功收到了一封电子邮件。像这样指定 ALL 所需的参数似乎很重要:

GRAYLOG_SMTP_SERVER="Server.name.local --port=25 --no-tls --no-ssl"

【讨论】:

    【解决方案2】:

    这是我在 Docker 中的 graylog 服务器上的工作方式。

    我正在使用 Docker 镜像:graylog/graylog:2.3.2-1

    在 docker-compose 格式中,因此这些可以在“docker run”命令中与“-e”一起使用以传递环境变量。

    environment:
      - GRAYLOG_TRANSPORT_EMAIL_ENABLED=true
      - GRAYLOG_TRANSPORT_EMAIL_HOSTNAME=smtp.myemailserver.com
      - GRAYLOG_TRANSPORT_EMAIL_PORT=25
      - GRAYLOG_TRANSPORT_EMAIL_USE_AUTH=false
      - GRAYLOG_TRANSPORT_EMAIL_USE_TLS=false
      - GRAYLOG_TRANSPORT_EMAIL_USE_SSL=false
      - GRAYLOG_TRANSPORT_EMAIL_FROM_EMAIL=noreply@mycompany.com
    

    文档不包含任何这些内容,只是进行搜索和试错。我认为任何普通的 graylog 配置 (.conf) 参数都可以作为环境变量在容器中传递,并带有 GRAYLOG_ 前缀。

    【讨论】:

    • 我也遇到了从 dockerized Graylog 发送电子邮件的问题。我遇到了异常org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.myemailserver.com:587 (javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLException: Read timed out)。我可以确认将 graylog 选项“transport_email_use_tls”和“transport_email_use_ssl”设置为false 可以解决问题。
    猜你喜欢
    • 2022-08-20
    • 1970-01-01
    • 2021-10-03
    • 2017-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-19
    • 2011-02-21
    相关资源
    最近更新 更多