elasticsearch - 如何解决 '530 5.7.0 必须先发出 STARTTLS 命令。o63-v6sm4041934ywc.36 - 用于弹性搜索的 gsmtp\n'?
问题描述
我正在创建一个需要为我的日志发送电子邮件警报的应用程序。这是创建观察者的输入:
PUT _xpack/watcher/watch/log_error_watch
{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"search" : {
"request" : {
"indices" : [ "testindexv4" ],
"body" : {
"query" : {
"match" : { "log_level": "ERROR" }
}
}
}
}
}
,
"actions" : {
"send_email" : {
"email" : {
"to" : "<mailId>@gmail.com",
"subject" : "Watcher Notification",
"body" : "error logs found"
}
}
}
}
这是 elasticsearch.yml 的配置
xpack.security.enabled: false
xpack.notification.email.account:
standard_account:
profile: standard
smtp:
auth: false
starttls.enable: false
starttls.required: false
host: smtp.gmail.com
port: 587
当我尝试运行我的观察者时,我收到以下错误:
reason": "530 5.7.0 Must issue a STARTTLS command first. o63-v6sm4041934ywc.36 - gsmtp\n
请问有什么解决方案吗?
解决方案
现在解决了,我需要做的就是启用 TLS 身份验证。
这是我的elasticsearch.yml更新内容:
xpack.security.enabled: false
xpack.notification.email.account:
standard_account:
profile: standard
smtp:
auth: true
starttls.enable: true
starttls.required: true
host: smtp.gmail.com
port: 587
user: <mailId>
password: <passowrd>
推荐阅读
- date - Dart for Flutter 中的日期差异
- javascript - 将 jQuery 与 django 一起使用时出错:未捕获的 ReferenceError:未定义 jQuery
- c# - C# LINQ 过滤器 IEnumerable
并表示为 IEnumerable - sorting - 根据组将字典排序为两个不同的列表
- ruby-on-rails - Rails - collection_check_boxes 未触发连接模型上的回调
- grafana - 以编程方式导出 grafana 仪表板数据
- excel - MS Query 在 OBDC 查询中将十进制作为参数传递
- javascript - (ASP.NET) args.IsValid 如何阻止表单被提交?
- r - 将读取为字符的对比列表传递给R中的线性模式
- ios - Firebase 中生产的 APNs 身份验证密钥失败