fluent-plugin-mail 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84dd64ebbce56d0161a06afdaad0f7b0b0e92ca8
4
- data.tar.gz: 26fbf27b85376d6145fb9c8417f0f78799f24245
3
+ metadata.gz: 6f96ccf9d6555c9ecff2ea89418bd070994c9a4c
4
+ data.tar.gz: 48ae990d610d3e05766e1cc84ff621e355da9b5c
5
5
  SHA512:
6
- metadata.gz: b6b1da613ef72f3a6ed6eb71c2848cc372263fded0a08a12cd9d2e221713b33195081e9a483471364bb37a91577b13983c2a7e72cac2eb917f369c22b079e8d2
7
- data.tar.gz: 7b379e8fbce5ac4d77409f3a8e502bd62e8d03d944754f39ef4949f43f31dfd1c5ae210949ffa94964ae8ca79ed77c8fdec854f9be4a4b419cf4cc3fe5830035
6
+ metadata.gz: 5dd6e69c2161fc7dbb8f88baa6be0b1e877b09354ceec2d3fe24b5bcde35de582a830bf147445f7194698e1537ba6d37a333614fb90b1acd0c838e31c3c1352f
7
+ data.tar.gz: c7c9543c545bb28fe5c66417071cc27c6a244c2dfb1b6ccbeaf7fc29bdfe86bb785a8521ba152b7d065d5bf351f9a80ae2d60a0b3df9c09338843e960593a3ca
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # 0.1.0
2
+
3
+ Enhancement:
4
+
5
+ * Add `enable_tls` option (thanks to @mash)
6
+ * Add more debug messages (thanks to @glaci)
7
+
8
+ # 0.0.5
9
+
10
+ olders
data/README.md CHANGED
@@ -70,7 +70,7 @@ Email is sent like
70
70
  #{target_tag} #{pattern}
71
71
  #{value}
72
72
 
73
- ## Mail Configuration for Gmail(use TLS)
73
+ ## Mail Configuration for Gmail(use STARTTLS)
74
74
 
75
75
  <match **>
76
76
  type mail
@@ -83,6 +83,7 @@ Email is sent like
83
83
  user USERNAME( ex. hoge@gmail.com)
84
84
  password PASSWORD
85
85
  enable_starttls_auto true
86
+ enable_tls false
86
87
  out_keys target_tag,pattern,value
87
88
  time_locale UTC # optional
88
89
  </match>
@@ -201,10 +202,14 @@ log server("/etc/td-agent/td-agent.conf")
201
202
 
202
203
  * add config "mail_text_format"
203
204
 
205
+ ## ChangeLog
206
+
207
+ See [CHANGELOG.md](CHANGELOG.md) for more details.
208
+
204
209
  ## Copyright
205
210
 
206
211
  * Copyright
207
212
  * Copyright (c) 2012- Yuichi UEMURA
213
+ * Copyright (c) 2014- Naotoshi Seo
208
214
  * License
209
215
  * Apache License, Version 2.0
210
-
@@ -1,8 +1,8 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.authors = ["Yuichi UEMURA"]
5
- gem.email = ["yuichi.u@gmail.com"]
4
+ gem.authors = ["Yuichi UEMURA", "Naotoshi Seo"]
5
+ gem.email = ["yuichi.u@gmail.com", "sonots@gmail.com"]
6
6
  gem.description = %q{output plugin for Mail}
7
7
  gem.summary = %q{output plugin for Mail}
8
8
  gem.homepage = "https://github.com/u-ichi/fluent-plugin-mail"
@@ -12,9 +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.0.5'
16
- gem.add_development_dependency "fluentd"
15
+ gem.version = '0.1.0'
17
16
  gem.add_development_dependency "rake"
18
17
  gem.add_runtime_dependency "fluentd"
19
18
  end
20
-
@@ -24,6 +24,7 @@ class Fluent::MailOutput < Fluent::Output
24
24
  config_param :subject, :string, :default => 'Fluent::MailOutput plugin'
25
25
  config_param :subject_out_keys, :string, :default => ""
26
26
  config_param :enable_starttls_auto, :bool, :default => false
27
+ config_param :enable_tls, :bool, :default => false
27
28
  config_param :time_locale, :default => nil
28
29
 
29
30
  def initialize
@@ -92,8 +93,8 @@ class Fluent::MailOutput < Fluent::Output
92
93
  subject = subjects[i]
93
94
  begin
94
95
  res = sendmail(subject, msg)
95
- rescue
96
- log.warn "out_mail: failed to send notice to #{@host}:#{@port}, subject: #{subject}, message: #{msg}"
96
+ rescue => e
97
+ log.warn "out_mail: failed to send notice to #{@host}:#{@port}, subject: #{subject}, message: #{msg}, error_class: #{e.class}, error_message: #{e.message}, error_backtrace: #{e.backtrace.first}"
97
98
  end
98
99
  end
99
100
 
@@ -161,6 +162,7 @@ class Fluent::MailOutput < Fluent::Output
161
162
  if @user and @password
162
163
  smtp_auth_option = [@domain, @user, @password, :plain]
163
164
  smtp.enable_starttls if @enable_starttls_auto
165
+ smtp.enable_tls if @enable_tls
164
166
  smtp.start(@domain,@user,@password,:plain)
165
167
  else
166
168
  smtp.start
@@ -175,7 +177,7 @@ class Fluent::MailOutput < Fluent::Output
175
177
  date = Time::now
176
178
  end
177
179
 
178
- smtp.send_mail(<<EOS, @from, @to.split(/,/), @cc.split(/,/), @bcc.split(/,/))
180
+ debug_msg = smtp.send_mail(<<EOS, @from, @to.split(/,/), @cc.split(/,/), @bcc.split(/,/))
179
181
  Date: #{date.strftime("%a, %d %b %Y %X %z")}
180
182
  From: #{@from}
181
183
  To: #{@to}
@@ -187,6 +189,7 @@ Content-Type: text/plain; charset=utf-8
187
189
 
188
190
  #{body}
189
191
  EOS
192
+ log.debug "out_mail: email send response: #{debug_msg}"
190
193
  smtp.finish
191
194
  end
192
195
 
@@ -202,5 +205,3 @@ class Time
202
205
  output
203
206
  end
204
207
  end
205
-
206
-
@@ -1,6 +1,9 @@
1
1
  require 'helper'
2
2
 
3
3
  class MailOutputTest < Test::Unit::TestCase
4
+ def setup
5
+ Fluent::Test.setup
6
+ end
4
7
 
5
8
  CONFIG_OUT_KEYS = %[
6
9
  out_keys tag,time,value
metadata CHANGED
@@ -1,29 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichi UEMURA
8
+ - Naotoshi Seo
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
12
+ date: 2014-10-24 00:00:00.000000000 Z
12
13
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: fluentd
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
14
  - !ruby/object:Gem::Dependency
28
15
  name: rake
29
16
  requirement: !ruby/object:Gem::Requirement
@@ -55,11 +42,13 @@ dependencies:
55
42
  description: output plugin for Mail
56
43
  email:
57
44
  - yuichi.u@gmail.com
45
+ - sonots@gmail.com
58
46
  executables: []
59
47
  extensions: []
60
48
  extra_rdoc_files: []
61
49
  files:
62
50
  - ".gitignore"
51
+ - CHANGELOG.md
63
52
  - Gemfile
64
53
  - LICENSE
65
54
  - README.md
@@ -87,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
76
  version: '0'
88
77
  requirements: []
89
78
  rubyforge_project: fluent-plugin-mail
90
- rubygems_version: 2.0.3
79
+ rubygems_version: 2.2.2
91
80
  signing_key:
92
81
  specification_version: 4
93
82
  summary: output plugin for Mail