Coder Social home page Coder Social logo

integration with Mail gem about dkim HOT 5 CLOSED

jhawthorn avatar jhawthorn commented on August 19, 2024
integration with Mail gem

from dkim.

Comments (5)

jhawthorn avatar jhawthorn commented on August 19, 2024

Hi. Thanks for feedback.

Dkim can sign Mail::Message objects using either of the following methods.

mail = Mail.new(open('test.mail').read)
puts Dkim.sign(mail.encoded)

or

mail = Mail.new(open('test.mail').read)
mail['DKIM-Signature'] = Dkim::SignedMail.new(mail.encoded).dkim_header.value
puts mail.encoded

The second one adds the signature to the mail object, allowing you to use mail.deliver for using mail's delivery methods. I'll make sure to document this in the readme, will that suit your needs? What sort of integration did you have in mind?

from dkim.

ssinghi avatar ssinghi commented on August 19, 2024

Thanks!
This indeed simplifies what I was doing, and I am sure mentioning this in
the Readme will help lot of other people.

An additional feature which will be really helpful, and make integrating
Dkim into any rails application really simple, would be adding a hook into
ActionMailer which auto adds the signature to all emails.

This can be perhaps done by using :delivering_email method

On Mon, Jul 25, 2011 at 4:34 PM, jhawthorn <
[email protected]>wrote:

Hi. Thanks for feedback.

Dkim can sign Mail::Message objects using either of the following methods.

mail = Mail.new(open('test.mail').read)
puts Dkim.sign(mail.encoded)
or

mail = Mail.new(open('test.mail').read)
mail['DKIM-Signature'] =
Dkim::SignedMail.new(mail.encoded).dkim_header.value
puts mail.encoded

The second one adds the signature to the mail object, allowing you to use
mail.deliver for using mail's delivery methods. I'll make sure to document
this in the readme, will that suit your needs? What sort of integration did
you have in mind?

Reply to this email directly or view it on GitHub:
#1 (comment)

Surendra Singhi
Kreeti Technologies

web: http://www.kreeti.com
facebook: http://facebook.com/KreetiTechnologieshttp://www.facebook.com/pages/Kreeti-Technologies/100261250058049
twitter: http://twitter.com/kreetitech

from dkim.

ssinghi avatar ssinghi commented on August 19, 2024

It was easy.

It can be used as ActionMailer::Base.register_interceptor(DkimInterceptor)

or SomeMailer.register_interceptor(DkimInterceptor)

On Mon, Jul 25, 2011 at 5:46 PM, Surendra Singhi [email protected] wrote:

Thanks!
This indeed simplifies what I was doing, and I am sure mentioning this in
the Readme will help lot of other people.

An additional feature which will be really helpful, and make integrating
Dkim into any rails application really simple, would be adding a hook into
ActionMailer which auto adds the signature to all emails.

This can be perhaps done by using :delivering_email method

On Mon, Jul 25, 2011 at 4:34 PM, jhawthorn <
[email protected]>wrote:

Hi. Thanks for feedback.

Dkim can sign Mail::Message objects using either of the following methods.

mail = Mail.new(open('test.mail').read)
puts Dkim.sign(mail.encoded)
or

mail = Mail.new(open('test.mail').read)
mail['DKIM-Signature'] =
Dkim::SignedMail.new(mail.encoded).dkim_header.value
puts mail.encoded

The second one adds the signature to the mail object, allowing you to use
mail.deliver for using mail's delivery methods. I'll make sure to document
this in the readme, will that suit your needs? What sort of integration did
you have in mind?

Reply to this email directly or view it on GitHub:
#1 (comment)

Surendra Singhi
Kreeti Technologies

web: http://www.kreeti.com
facebook: http://facebook.com/KreetiTechnologieshttp://www.facebook.com/pages/Kreeti-Technologies/100261250058049
twitter: http://twitter.com/kreetitech

Surendra Singhi
Kreeti Technologies

web: http://www.kreeti.com
facebook: http://facebook.com/KreetiTechnologieshttp://www.facebook.com/pages/Kreeti-Technologies/100261250058049
twitter: http://twitter.com/kreetitech

from dkim.

ssinghi avatar ssinghi commented on August 19, 2024

My attachment didn't come through, so here it is:

class DkimInterceptor
  def self.delivering_email(message)
    message['DKIM-Signature'] = Dkim::SignedMail.new(message.encoded).dkim_header.value
    message
  end
end

from dkim.

jhawthorn avatar jhawthorn commented on August 19, 2024

Great!

I've added this as Dkim::Interceptor in 4cbb68c and documented its use.

Thanks for the excellent contribution. This should make things much nicer for rails users of this gem (which i assume is almost everyone).

I'll bump dkim's version tomorrow.

from dkim.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.