Comments (5)
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.
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)
ormail = Mail.new(open('test.mail').read)
mail['DKIM-Signature'] =
Dkim::SignedMail.new(mail.encoded).dkim_header.value
puts mail.encodedThe 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.
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)
ormail = Mail.new(open('test.mail').read)
mail['DKIM-Signature'] =
Dkim::SignedMail.new(mail.encoded).dkim_header.value
puts mail.encodedThe 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 Technologiesweb: 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.
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.
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)
- Does it work with rails 4? HOT 2
- Signing too early HOT 3
- Options overridden per message not working HOT 3
- Generating pem files HOT 1
- [WIP] Verification Features
- Simple Canonicalization HOT 6
- Invalid (wrong body hash) due to no line breaks HOT 11
- undefined method `strip_field' after update to mail 2.7.0
- Push new release v1.0.1 HOT 2
- dkim fail(wrong body hash) HOT 5
- Mail::Field::ParseError, DateTimeElement can not parse, in rails 3.0.0 app HOT 1
- Typo in README.md HOT 2
- Duplicate DKIM header HOT 4
- Interceptor no longer works with Mail 2.5.4 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dkim.