Project

General

Profile

Redmine and Gmail

Added by Johan Welgemoed over 15 years ago

Hi all,
I've recently installed Redmine (using Bitnami Stack) and wanted to set it up using Gmail for outgoing email.
I've followed the steps in http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail about how to go about doing this.

But after installing the action_mailer_optional_tls_plugin I can't access the site and only get a 502 exception.
I managed to track the issue down in the Mongrel log file to the following error:
Mounting Rails at /redmine...
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:142:in `activate': can't activate actionmailer (>= 0, runtime), already activated actionmailer-2.1.2 (Gem::Exception)
from C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/plugins/action_mailer_optional_tls/lib/action_mailer_tls.rb:2
from C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:102:in `require_or_load'
... 27 levels...
from C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run'
from C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281
from C:/Program Files/BitNami Redmine Stack/ruby/bin/mongrel_rails:19:in `load'
from C:/Program Files/BitNami Redmine Stack/ruby/bin/mongrel_rails:19

If I remove the plugin then Redmine works fine again, anyone any idea about what the issue is? Is there another version of the actionmailer that's already installed by default?

Thanks,
Johan


Replies (11)

RE: Redmine and Gmail - Added by Greg Duda over 15 years ago

I am using the Bitnami stack as well, runnning Redmine 0.8.3 on OS X Leopard. I'm running into the exact same issue, and have been pulling my hair out. Did you find anything that works? I didn't use the

ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git

command to install the Action Mailer plug-in because bash complains it doesn't understand "git", so instead I used:


./script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls

but I believe it is the same Action Mailer plug in....

RE: Redmine and Gmail - Added by Johan Welgemoed over 15 years ago

yes that's the same Action Mailer plugin...and no haven't found anything yet, going back to using the local smtp server...

RE: Redmine and Gmail - Added by Hugh Flynn over 15 years ago

I was able to configure Redmine to use GMail (I am also running the Bitnami stack, version 0.8.4 on OS 10.5) by using the configuration described in step 2 of the redmineblog.com entry referenced in this post but also following these instructions for adding tls_smtp.rb to the /ruby/lib directory:

http://bug.gd/search/details/78026/redmine-rails-must-issue-a-starttls-command-first

The 0.8.4 stack already has the action_mailer_optional_tls_plugin included so I did not need to follow any of the other steps outlined in the blog post.

Hope this helps.

RE: Redmine and Gmail - Added by Basil Rormose about 15 years ago

Hi

Complete newbie here as far ruby/rails/redmine goes.

I'm using the Bitnami Ruby stack with the redmine module on Windows 2008 server (64bit)

Can anyone give me any suggestions on how/where to install the 'tls_smtp' file and which environment.rb file to modify. Unfortunately the script commands to install the actionmailer plugin do not run.

Redmine runs great otherwise.

Many thanks

Basil

RE: Redmine and Gmail - Added by Hugh Flynn about 15 years ago

The environment.rb file is located in <your redmine directory>/apps/redmine/config/. Just put require 'tls_smtp' at the top near the other require statements (I put it below require File.join(File.dirname(__FILE__), 'boot' in my environment.rb file).

Copy tls_smtp.rb to <your redmine directory>/ruby/lib/

Hugh

RE: Redmine and Gmail - Added by Basil Rormose about 15 years ago

Thanks Hugh.

I have tried the above many other variations based on postings on various forums & blog articles

in environment.rb, I have

  1. Required for gmail use
    require File.join(File.dirname(FILE), '../lib/tls_smtp')

In email.yml (no tabs, only spaces):
production:
delivery_method: :smtp
smtp_settings:
address: smtp.gmail.com
port: 587
domain: xxxx.gr
authentication: :plain
user_name:
password: xxxxxxxxxxxxx
tls: true

I have also tried 'authentication: :login'

There is no <your redmine directory>/ruby/lib/ directory. So I put the tls_smtp.rb file in redmine/lib directory.
Ruby version: 1.8.7
Rails version: 2.3.2
Redmine version: 0.8.4
Bitnami ruby stack + redmine module

Trying to send a test e-mail always gets me: An error occurred while sending mail (530 5.7.0 Must issue a STARTTLS command first. j10sm2362856mue.15 )

Was thinking of updating redmine from svn.
Obviously I'm missing something. Any ideas or suggestions would be appreciated.

Basil

RE: Redmine and Gmail - Added by Hugh Flynn about 15 years ago

Basil,

Note that require 'tls_smtp' goes below (or above, for that matter) the other line and is not a part of it:


# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

require 'tls_smtp'

Also, you need follow the examples in step 2 of the Redmine Blog post more literally. Note, for example, that the domain in email.yml should be the mail server's domain (gmail, in this case) not your domain since the gmail domain is the one from which the e-mail will be originating and you should enclose the appropriate values with quotation marks (mine are mixed single and double quotes as in the example but one form or the other might work). This is what I have used successfully:

production:
  delivery_method: :smtp
  smtp_settings:
    tls: true
    address: "smtp.gmail.com" 
    port: '587'
    domain: "smtp.gmail.com" 
    authentication: :plain
    user_name: "user@gmail.com" 
    password: "xxxxxxxxxxx" 

Hugh

RE: Redmine and Gmail - Added by Lars Fischer almost 15 years ago

Hello,

I tried to install the action_mailer_optional_tls plugin, but all I get is an empty folder.

Where can I get the needed files to make " require 'tls_smtp' " work?

Regards,
Lars

RE: Redmine and Gmail - Added by Rajeev B over 14 years ago

Hi,

Following the instructions at http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/
I tried installing the action_mailer_optional_tls plugin I tried the following:

c:\path\to\redmine-0.9.3>ruby script\plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git

this simply creates an empty folder:

C:\path\to\redmine-0.9.3\vendor\plugins\action_mailer_optional_tls

Then I also tried installing it from the svn url

c:\path\to\redmine-0.9.3>ruby script\plugin install --force http://svn.douglasf shearer.com/rails/plugins/action_mailer_optional_tls

I get a plugin not found error as below:

Plugin not found: ["http://svn.douglasfshearer.com/rails/plugins/action_mailer_o
ptional_tls"]

I don't know where else I could find this plugin and install it. Help needed
I am running redmine-0.9.3 on windows7 OS.

RE: Redmine and Gmail - Added by TEHEK Firefox over 14 years ago

Hey guys,

It seems svn repo on svn.douglasfshrearer.com is no longer available. I tried to download from git, but it failed silently.

Later on I discovered that my server simply didn't have git installed. Since it's Ubuntu:

# sudo apt-get install git git-core

# ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git
Initialized empty Git repository in /var/www/redmine/vendor/plugins/action_mailer_optional_tls/.git/
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 14 (delta 2), reused 2 (delta 0)
Unpacking objects: 100% (14/14), done.
From git://github.com/collectiveidea/action_mailer_optional_tls
 * branch            HEAD       -> FETCH_HEAD

It's now working both with regular @gmail.com accounts and google apps.

RE: Redmine and Gmail - Added by Russell Kwok over 14 years ago

Just a reminder,

As what TEHEK said, I have found that the Centos does not have git as well, however, its default repository don't have git package, so you may need to following the link below to add the epel repository first:
http://www.hampson.ca/blog/2009/09/08/setup-git-centos-53-and-make-public-over-ssh/

after the epel repo is installed, then you can simply install the git by yum install git.

Cheers.

    (1-11/11)