fluent-plugin-mail 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +21 -16
- data/fluent-plugin-mail.gemspec +1 -1
- data/lib/fluent/plugin/out_mail.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c0ed5964e665422a987c3698d6689c521cb05ae
|
4
|
+
data.tar.gz: c44f585a3b06b52381b74c96cc2a2a835a8ed26c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fcc02a2825ce7515ada10d5fbdcab305d05288a8a08e63632f4316a9bebb41495bd11e9762c7762199ab68d40ca4e4e674ed9e7f81c9f9448da748c03f8316b
|
7
|
+
data.tar.gz: ac92cac11525affb6fd81a07611582f79f025702f52ce223a1c98c8b9c124f0c2c20fdc0419e96561012ef77fe9d0823fa4a576f5946d33b0d594a4e905eb981
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -25,22 +25,26 @@ Or use td-agent : (on Ubuntu12.04)
|
|
25
25
|
from SOURCE
|
26
26
|
to DEST1,DEST2,DEST3
|
27
27
|
subject SUBJECT: %s
|
28
|
-
subject_out_keys
|
29
|
-
out_keys
|
28
|
+
subject_out_keys tag
|
29
|
+
out_keys tag,foo,message
|
30
30
|
time_locale UTC # optional
|
31
31
|
</match>
|
32
32
|
|
33
|
+
Assume following input:
|
34
|
+
|
35
|
+
tag.example: {"foo":"bar","message":"awesome!"}
|
36
|
+
|
33
37
|
Email is sent like
|
34
38
|
|
35
39
|
From: SOURCE
|
36
40
|
To: DEST1,DEST2,DEST3
|
37
|
-
Subject: SUBJECT:
|
41
|
+
Subject: SUBJECT: tag.example
|
38
42
|
Mime-Version: 1.0
|
39
43
|
Content-Type: text/plain; charset=utf-8
|
40
44
|
|
41
|
-
|
42
|
-
|
43
|
-
|
45
|
+
tag: tag.example
|
46
|
+
foo: bar
|
47
|
+
message: awesome!
|
44
48
|
|
45
49
|
## Mail Configuration with Message Format (no auth)
|
46
50
|
|
@@ -53,22 +57,26 @@ You may use `message` parameter to define mail format as you like. Use `\n` to p
|
|
53
57
|
from SOURCE
|
54
58
|
to DEST1,DEST2,DEST3
|
55
59
|
subject SUBJECT: %s
|
56
|
-
subject_out_keys
|
57
|
-
message %s
|
58
|
-
message_out_keys
|
60
|
+
subject_out_keys tag
|
61
|
+
message %s\n%s %s
|
62
|
+
message_out_keys tag,foo,message
|
59
63
|
time_locale UTC # optional
|
60
64
|
</match>
|
61
65
|
|
66
|
+
Assume following input:
|
67
|
+
|
68
|
+
tag.example: {"foo":"bar","message":"awesome!"}
|
69
|
+
|
62
70
|
Email is sent like
|
63
71
|
|
64
72
|
From: SOURCE
|
65
73
|
To: DEST1,DEST2,DEST3
|
66
|
-
Subject: SUBJECT:
|
74
|
+
Subject: SUBJECT: tag.example
|
67
75
|
Mime-Version: 1.0
|
68
76
|
Content-Type: text/plain; charset=utf-8
|
69
77
|
|
70
|
-
|
71
|
-
|
78
|
+
tag.example
|
79
|
+
bar awesome!
|
72
80
|
|
73
81
|
## Mail Configuration for Gmail(use STARTTLS)
|
74
82
|
|
@@ -84,12 +92,11 @@ Email is sent like
|
|
84
92
|
password PASSWORD
|
85
93
|
enable_starttls_auto true
|
86
94
|
enable_tls false
|
87
|
-
out_keys
|
95
|
+
out_keys tag,foo,message
|
88
96
|
time_locale UTC # optional
|
89
97
|
</match>
|
90
98
|
|
91
99
|
|
92
|
-
|
93
100
|
## Usage Sample
|
94
101
|
|
95
102
|
### SingleNode's syslog check
|
@@ -140,8 +147,6 @@ use config_expander(https://github.com/tagomoris/fluent-plugin-config-expander)
|
|
140
147
|
|
141
148
|
$ gem install fluent-plugin-config-expander
|
142
149
|
|
143
|
-
|
144
|
-
|
145
150
|
source node("/etc/td-agent/td-agent.conf")
|
146
151
|
|
147
152
|
<source>
|
data/fluent-plugin-mail.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.name = "fluent-plugin-mail"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = '0.1.
|
15
|
+
gem.version = '0.1.2'
|
16
16
|
|
17
17
|
gem.add_runtime_dependency "fluentd"
|
18
18
|
gem.add_runtime_dependency "string-scrub" if RUBY_VERSION.to_f < 2.1
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
1
3
|
class Fluent::MailOutput < Fluent::Output
|
2
4
|
Fluent::Plugin.register_output('mail', self)
|
3
5
|
|
@@ -190,6 +192,8 @@ class Fluent::MailOutput < Fluent::Output
|
|
190
192
|
date = Time::now
|
191
193
|
end
|
192
194
|
|
195
|
+
mid = sprintf("<%s@%s>", SecureRandom.uuid, SecureRandom.uuid)
|
196
|
+
|
193
197
|
debug_msg = smtp.send_mail(<<EOS, @from, @to.split(/,/), @cc.split(/,/), @bcc.split(/,/))
|
194
198
|
Date: #{date.strftime("%a, %d %b %Y %X %z")}
|
195
199
|
From: #{@from}
|
@@ -197,6 +201,7 @@ To: #{@to}
|
|
197
201
|
Cc: #{@cc}
|
198
202
|
Bcc: #{@bcc}
|
199
203
|
Subject: #{subject}
|
204
|
+
Message-Id: #{mid}
|
200
205
|
Mime-Version: 1.0
|
201
206
|
Content-Type: text/plain; charset=utf-8
|
202
207
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuichi UEMURA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|