How do I send signed emails from ActionMailer in Rails 3? - ruby-on-rails

Using Rails 3 I want to use an X.509 certificate to sign parts of emails. There is a currently existing answer for Rails 2 at How do I send signed emails from ActionMailer? but it doesn't work on Rails 3.
Is it possible to sign emails via ActionMailer in Rails 3?
If that is not possible, is it possible to sign emails via sendmail after creating by ActionMailer?

perhaps it's not the best answer, however here's what I'd do:
try to install that plugin (even if it's for rails 2.0.x)
tests and fix code until I get the result
looking at the code, turns out that the core file is:
https://github.com/penso/actionmailer_x509/blob/master/lib/actionmailer_x509.rb
which exposes a bunch of methods for mailer DSL:
x509_sign true # or false
x509_cert "path/to/cert"
x509_key "path/to/key"
x509_passphrase "passphrase"
so you could grab that file, and put it under $APP/lib, then write some test to check it's working.
A.

I have been ported actionmailer_x509 to Rails 3 and wrap it into the gem. So now it works and available here: https://github.com/petRUShka/actionmailer_x509

Related

What is the best way to test Action mailer without worrying about the enviroment-rails 3

i need to test the action mailer in my ruby on rails project which is already live.i don't want to go in the mess of creating a new mail server like zimbra on localhost or mess with the configurations of the other environments that i have.moreover i cant think of looking in the log files which will be a complete height of patience.is there any other way to check/debug action mailer in localhost.if yes then how and if not then why not?
Several alternatives:
define an interceptor in development, see this railscast
use letter_opener gem to see the mail instead of actually sending it, link to gem

Where should I put username/password for http basic authentication in rails app

I am going to use http-basic-authentication in a rails app. I watched this railscast to figure out how do do that:
http://railscasts.com/episodes/82-http-basic-authentication
In the video he says not to put the username and password directly in the code. Where should I put them then?
I am using rails 3.1.0.
You want to move them into config files. Ceck out this RailsCast about "Application Configuration".

Import Devise 1.1.8 credentials into 2.0.0

I have an export of the users table from a Rails 3.0/Devise 1.1.8 app. I would like to seed these into a Rails 3.1/Devise 2.0 app. I imported that data via CSV and configured Devise with the same pepper value as the old app, however users are not able to log in. Bcrypt is/was used in both cases.
I think what I'm missing is that Devise 1 stored the salt in a separate field, but 2.0 puts it in the encrypted password string. Is there a way to migrate my data into the new app properly?
The best idea is to follow this: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0, which basically recommends that you upgrade to 1.5 first, then upgrade all the way to 2.0. I think its pretty straight forward from that wiki explanation.

How to send emails through Ruby on rails in linux

I want to include a new module to my project where i can send some mails to my client.I don know how to include this emailing module . i searched in net but most of them have told to edit some SMTP.Where can i find this in linux.I am really confused about this.Plz guide me out.I need it urgently.
You need to setup a mail server like Exim4 on your server. Rails should be able to connect to it without any configuration.
The Rails Guides site has a great tutorial on how to send mail from your application.

AR Mailer with changing settings?

we're running ARMailer in one of our projects right now.
It's working fine but as different customers are allowed to send confirmation emails via this service we want to offer them the possibility to use their own SMTP settings for that.
Is there a way to change ARMailer settings on the fly?
Or is there an ARMailer alternative maybe which abstracts this better?
Thanks
Matt
this: Using multiple SMTP accounts with Rails & ActionMailer
has a nice example using yaml for storing the multiple configurations, but can easily be adapted to use the db
What I did in the end was:
I took the ARMailer gem and took a copy of it.
After that, modified the email delivery action and started the daemon from my new custom folder. Works fine. Will create a custom some day...

Resources