Sha256: e1b2d97f9726769242316f818e545e0960dc511208ca7f4fe28876fa7a92a547

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 KB

Contents

module Mail

  # A delivery method implementation which sends via exim.
  #
  # To use this, first find out where the exim binary is on your computer,
  # if you are on a mac or unix box, it is usually in /usr/sbin/exim, this will
  # be your exim location.
  #
  #   Mail.defaults do
  #     delivery_method :exim
  #   end
  #
  # Or if your exim binary is not at '/usr/sbin/exim'
  #
  #   Mail.defaults do
  #     delivery_method :exim, :location => '/absolute/path/to/your/exim'
  #   end
  #
  # Then just deliver the email as normal:
  #
  #   Mail.deliver do
  #     to 'mikel@test.lindsaar.net'
  #     from 'ada@test.lindsaar.net'
  #     subject 'testing exim'
  #     body 'testing exim'
  #   end
  #
  # Or by calling deliver on a Mail message
  #
  #   mail = Mail.new do
  #     to 'mikel@test.lindsaar.net'
  #     from 'ada@test.lindsaar.net'
  #     subject 'testing exim'
  #     body 'testing exim'
  #   end
  #
  #   mail.deliver!
  class Exim < Sendmail
    def initialize(values)
      self.settings = { :location       => '/usr/sbin/exim',
                        :arguments      => '-i -t' }.merge(values)
    end

    def self.call(path, arguments, destinations, mail)
      popen "#{path} #{arguments}" do |io|
        io.puts mail.encoded.to_lf
        io.flush
      end
    end

  end
end

Version data entries

19 entries across 18 versions & 9 rubygems

Version Path
mail-2.5.5.rc1 lib/mail/network/delivery_methods/exim.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
mail-2.6.4.rc1 lib/mail/network/delivery_methods/exim.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb
mail-2.6.3 lib/mail/network/delivery_methods/exim.rb
mail-portertech-2.6.2.edge lib/mail/network/delivery_methods/exim.rb
mail-2.6.1 lib/mail/network/delivery_methods/exim.rb
mail-2.6.0 lib/mail/network/delivery_methods/exim.rb
challah-1.0.0 vendor/bundle/gems/mail-2.5.4/lib/mail/network/delivery_methods/exim.rb
swipe-rails-0.0.5 vendor/bundle/gems/mail-2.5.4/lib/mail/network/delivery_methods/exim.rb
mail-2.5.4 lib/mail/network/delivery_methods/exim.rb