2014-02-03 19:23:00 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2012-04-13 16:42:25 +00:00
|
|
|
class Channel::SMTP < Channel::EmailBuild
|
2012-04-13 13:51:10 +00:00
|
|
|
def send(attr, channel, notification = false)
|
2012-12-24 13:55:43 +00:00
|
|
|
|
|
|
|
# return if we run import mode
|
|
|
|
return if Setting.get('import_mode')
|
|
|
|
|
2012-04-13 16:42:25 +00:00
|
|
|
mail = build(attr, notification)
|
2012-04-13 13:51:10 +00:00
|
|
|
mail.delivery_method :smtp, {
|
|
|
|
:openssl_verify_mode => 'none',
|
|
|
|
:address => channel[:options][:host],
|
2013-01-04 22:30:57 +00:00
|
|
|
:port => channel[:options][:port] || 25,
|
2012-04-13 13:51:10 +00:00
|
|
|
:domain => channel[:options][:host],
|
|
|
|
:user_name => channel[:options][:user],
|
|
|
|
:password => channel[:options][:password],
|
2013-06-12 15:59:58 +00:00
|
|
|
# :authentication => 'plain',
|
2012-04-13 13:51:10 +00:00
|
|
|
:enable_starttls_auto => true
|
|
|
|
}
|
2013-06-12 15:59:58 +00:00
|
|
|
mail.deliver
|
2012-04-13 13:51:10 +00:00
|
|
|
end
|
2013-06-12 15:59:58 +00:00
|
|
|
end
|