lib/fluent/plugin/out_mail.rb in fluent-plugin-mail-0.2.4 vs lib/fluent/plugin/out_mail.rb in fluent-plugin-mail-0.2.5

- old
+ new

@@ -34,10 +34,12 @@ config_param :domain, :string, :default => 'localdomain' desc "User for SMTP Auth" config_param :user, :string, :default => nil desc "Password for SMTP Auth" config_param :password, :string, :default => nil, :secret => true + desc "Type for SMTP Auth such as 'plain', 'login', and 'cram_md5'" + config_param :authtype, :string, :default => 'plain' desc "MAIL FROM this value" config_param :from, :string, :default => 'localhost@localdomain' desc "Mail destination (To)" config_param :to, :string, :default => '' desc "Mail destination (Cc)" @@ -210,13 +212,13 @@ def sendmail(subject, msg, dest = nil) smtp = Net::SMTP.new(@host, @port) if @user and @password - smtp_auth_option = [@domain, @user, @password, :plain] + smtp_auth_option = [@domain, @user, @password, @authtype.to_sym] smtp.enable_starttls if @enable_starttls_auto smtp.enable_tls if @enable_tls - smtp.start(@domain,@user,@password,:plain) + smtp.start(@domain, @user, @password, @authtype.to_sym) else smtp.start end subject = subject.force_encoding('binary')