Using Postfix to send out emails from development environment in Rails


You want to be able to send emails from your development enironment using Postfix in your (K)Ubuntu pc.


First you would need to install postfix:

and then you would need to change an option in postfix to not use tls, so change /etc/postfix/

and change the smtpd_use_tls from yes to no:

restart your postfix server:

and then setup your config/development.rb as follows:

Testing Active_Mailer with GMail in development

You want to test your email configuration and be able to send emails in your development environment, using a GMail account in a Rails application using 2.3.2.

Start your console in your development environment:


Add the following replacing your GMail details:

ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "",
:port => 587,
:domain => "your_gmail_domain",
:authentication => :plain,
:user_name => "your_gmail_user_name",
:password => "your_gmail_password"}

Add a simple email class:

class MyMailer < ActionMailer::Base def test_email @recipients = "" @from = "" @subject = "test from dev console" @body = "this is the body" end end

and to finally test the email:


if it doesn't return with an error but with something like:

TMail::Mail port=#TMail::StringPort:id=0x..fdab4cee0 bodyport=#TMail::StringPort:id=0x..fdab4a9ec

then it should be working so add the configuration to your environments/development.rb

config.action_mailer.smtp_settings { ... }

cap deploy_with_migrations default behaviour

When using cap deploy_with_migrations, the default behaviour is to deploy with the migrations in the production environment.

To change this behavior add:

in your config/deploy.rb