Revision 4672e230
Added by Marc Dequènes almost 11 years ago
README | ||
---|---|---|
ruby-tmail
|
||
ruby-gpgme (>= 2.0)
|
||
ruby-rails-2.3 (ruby-actionmailer-2.3 at least)
|
||
ruby-activesupport
|
||
ruby-activeldap
|
||
#<del>libxmpp4r-ruby</del> is dead, maybe http://adhearsion.github.com/blather/ instead
|
||
|
data/cyborghood/schema/postman.yaml | ||
---|---|---|
type: map
|
||
mapping:
|
||
"from_address": {type: str}
|
||
"smtp_server": {type: str}
|
||
"smtp_port": {type: int}
|
||
"smtp":
|
||
type: map
|
||
mapping:
|
||
=: {type: any}
|
||
"organization": {type: str}
|
||
"key_id": {type: str, required: yes}
|
||
"key_passphrase": {type: str, required: yes}
|
lib/cyborghood/base/lang_additions.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
# until we're ready for Ruby 2.0 which already implements it
|
||
class OpenStruct
|
||
def to_h
|
||
@table.dup
|
||
end
|
||
end
|
||
|
||
class Object
|
||
def logger
|
||
CyborgHood::Logger.instance
|
lib/cyborghood/mail.rb | ||
---|---|---|
require 'cyborghood/objects'
|
||
require 'fileutils'
|
||
require 'digest/md5'
|
||
require 'active_support/core_ext/hash/keys'
|
||
|
||
|
||
# This class handles RFC3156 signed/encrypted messages, validates them, and extract content properly.
|
||
... | ... | |
|
||
def deliver
|
||
unless self.class.delivery_initialized
|
||
config = @config
|
||
params = @config.mail.smtp.nil? ? {} : @config.mail.smtp.to_h.symbolize_keys
|
||
|
||
::Mail.defaults do
|
||
delivery_method :smtp, {
|
||
:address => config.mail.smtp_server,
|
||
:port => config.mail.smtp_port
|
||
}
|
||
delivery_method :smtp, params
|
||
end
|
||
|
||
self.class.delivery_initialized = true
|
Also available in: Unified diff
[evol] allow passing any parameter to the ruby-mail delivery settings