git clone https://github.com/zzlyzq/mail-provider.git
1、cd mail-provider
(mail-provider存放在GOPATH/src/github/open-falcon目录下)
2、执行命令:go get ./...
(这条命令的作用大概是解决包依赖,会把需要的包从go官网或github下载到本地)
3、执行命令: ./control build =
#编译
4、执行命令: ./control pack
#打包
"smtp": {
"addr": "mail.example.com:25", #邮箱的smtp地址
"username": "falcon@example.com", #邮箱
"password": "123456", #邮箱的smtp密码
"from": "falcon@example.com" #发件人
./control start
curl http://$ip:4000/sender/mail -d "tos=a@a.com,b@b.com&subject=xx&content=yy"
vim alarm/config/cfg.json
"api": {
"im": "http://127.0.0.1:10086/wechat",
"sms": "http://127.0.0.1:10086/sms",
"mail": "http://127.0.0.1:4000/sender/mail", #只需修改mail这条,其它保持默认
"dashboard": "http://127.0.0.1:8081",
"plus_api":"http://127.0.0.1:8080",
"plus_api_token": "default-token-used-in-server-side"
},