Feature #5814

Hard time configuring email notifications - Must issue a STARTTLS command first.

Added by Leonardo De Araujo over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-07-04
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Invalid

Description

Hi guys,
First of all, Redmine is great!
Big fan of it.
Now I am trying to configure some more advanced functionalities like email notifications.

We are using google apps.

I followed all instructions I could find. After creating email.yml I get the following error when testing email. (Settings).
An error occurred while sending mail (530 5.7.0 Must issue a STARTTLS command first. g11sm14567329bkw.10 )

Here is a dump of my email.yml

  1. Outgoing email settings

production:
delivery_method: :smtp
smtp_settings:
tls: true
address: "smtp.gmail.com"
port: 587
domain: "ourdomain.ca"
authentication: :plain
user_name: ""
password: xxxxxxxxxxxxx

I tried playing with :login instead but all return the same error.

I tried following the instructions on installing

DUMP of my ENVIRONMENT.rb
  1. Be sure to restart your web server when you modify this file.
  1. Uncomment below to force Rails into production mode when
  2. you don't control web/app server and can't set it the proper way
  3. ENV['RAILS_ENV'] ||= 'production'
  1. Specifies gem version of Rails to use when vendor/rails is not present
    RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
  1. Bootstrap the Rails environment, frameworks, and default configuration
    require File.join(File.dirname(FILE), 'boot')
  1. Load Engine plugin if available
    begin
    require File.join(File.dirname(FILE), '../vendor/plugins/engines/boot')
    rescue LoadError # Not available
    end

Rails::Initializer.run do |config| # Settings in config/environments/* take precedence those specified here

  1. Skip frameworks you're not going to use
  2. config.frameworks -= [ :action_web_service, :action_mailer ]
  1. Add additional load paths for sweepers
    config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
  1. Force all environments to use the same logger level
  2. (by default production uses :info, the others :debug)
  3. config.log_level = :debug
  1. Enable page/fragment caching by setting a file-based store
  2. (remember to create the caching directory and make it readable to the application)
  3. config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
  1. Activate observers that should always be running
  2. config.active_record.observers = :cacher, :garbage_collector
    config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer
  1. Make Active Record use UTC-base instead of local time
  2. config.active_record.default_timezone = :utc
  1. Use Active Record's schema dumper instead of SQL when creating the test database
  2. (enables use of different database adapters for development and test environments)
  3. config.active_record.schema_format = :ruby
  1. Deliveries are disabled by default. Do NOT modify this section.
  2. Define your email configuration in email.yml instead.
  3. It will automatically turn deliveries on
    config.action_mailer.perform_deliveries = false
config.gem 'rubytree', :lib => 'tree'
  1. Load any local configuration that is kept out of source control
  2. (e.g. gems, patches).
    if File.exists?(File.join(File.dirname(FILE), 'additional_environment.rb'))
    instance_eval File.read(File.join(File.dirname(FILE), 'additional_environment.rb'))
    end
    end
Here is my mailer.rb
  1. /config/initializers/mailer.rb
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
    :address => 'smtp.gmail.com',
    :port => 587,
    :domain => 'xxxxxxxxx.ca',
    :authentication => :login,
    :user_name => 'leonardo',
    :password => 'xxxxxxx'
    }

Any ideas?

Thanks

Leonardo

History

#1 Updated by Leonardo De Araujo over 6 years ago

Forgot to mention:

Redmine 0.9.5
on WEBrick 1.3.1
ruby 1.8.7
on Windows
mysql

Thanks

Leonardo

#2 Updated by Felix Schäfer over 6 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid
  1. Please use the forums for support requests, the bugtracker is for bugs and feature requests only,
  2. Please please put anything you paste from config files or logs in < pre> < /pre> tags (well, minus the spaces I put in there for them not to trigger) for legibility,
  3. I haven't read through the whole thing because it's too hard without proper formatting, but see these instructions on how to configure redmine to use gmail for outgoing emails, and from what I've seen you have begun meddling at places you shouldn't, stick to modifying email.yml and take out any other modifications you might have made in your previous process.

#3 Updated by Joël Lamotte over 6 years ago

  • Status changed from Closed to Reopened

Hi!

I have exactly the same problem (google app + "Must issue a STARTTLS command first." issue) and I'm a newcommer from TRAC to RedMine (actually reviewing it for potential migration of a big project of mine).

Now reading this answer is not helpfull at all Felix. You should know that not everybody asking for help will know about redmine-specific text formating (ok it's common but that's not the point) and can forget about it if they knew.

About 1. , I don't understand : it really looks like a bug, because I don't find any way to make it work. The pointed page don't help at all. It just don't work. I got the error reported by Leonardo and I tried variants based on discussions on this very forum, without any success. I'm not sure what's the origin of the problem but it's serious matter in my case.

So please, can you take a look to this issue? It really bothers me. And it seem I'm not the only one.

(is it normal that i'm allowed to modify ticket status while I'm a newcomer?)

#4 Updated by Joël Lamotte over 6 years ago

Joël Lamotte wrote:

Hi!

I have exactly the same problem (google app + "Must issue a STARTTLS command first." issue) and I'm a newcommer from TRAC to RedMine (actually reviewing it for potential migration of a big project of mine).

Now reading this answer is not helpfull at all Felix. You should know that not everybody asking for help will know about redmine-specific text formating (ok it's common but that's not the point) and can forget about it if they knew.

About 1. , I don't understand : it really looks like a bug, because I don't find any way to make it work. The pointed page don't help at all. It just don't work. I got the error reported by Leonardo and I tried variants based on discussions on this very forum, without any success. I'm not sure what's the origin of the problem but it's serious matter in my case.

So please, can you take a look to this issue? It really bothers me. And it seem I'm not the only one.

(is it normal that i'm allowed to modify ticket status while I'm a newcomer?)

And I forgot : this should be a Bug, not a Feature. I can't change it mysellf.

#5 Updated by Felix Schäfer over 6 years ago

  • Status changed from Reopened to Closed

Joël Lamotte wrote:

Now reading this answer is not helpfull at all Felix. You should know that not everybody asking for help will know about redmine-specific text formating (ok it's common but that's not the point) and can forget about it if they knew.

There's a text formatting help, and just asking/pointing it out usually has the result that this part of the answer is readily ignored.

About 1. , I don't understand : it really looks like a bug, because I don't find any way to make it work. The pointed page don't help at all. It just don't work. I got the error reported by Leonardo and I tried variants based on discussions on this very forum, without any success. I'm not sure what's the origin of the problem but it's serious matter in my case.

So please, can you take a look to this issue? It really bothers me. And it seem I'm not the only one.

If it's a bug, it's a bug in ActionMailer, which is part of rails, not in redmine, so still a support request. I don't know why gmail smtp configuration is so complex, it seems it's the only service that generates so much problems, but the best help you will find is with rails, see the ActionMailer configuration example for GMail , though IIRC the plugin isn't needed anymore in recent ruby and rails versions as TLS will automatically be used if necessary.

Again, this is a configuration problem, please use the forums for further assistance.

#6 Updated by Joël Lamotte over 6 years ago

Hi,

I'm getting back to this issue because I found a solution that works for me and I think should be added to the wiki page.

I made a "last" search on google to try to find a solution to this problem (someone suggest to install a smtp server for redmine but I find it a bit overkill if it's just for this) and I found this : http://davidebenini.it/2009/06/25/rails-233-ruby-187-gmail-smtp-settings/

The important part being :

"The most important line is enable_starttls_auto => true."

So just to check, I edited my redmine email config file and added "enable_starttls_auto: true" to get similar code :

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

And then fired a test email using a google app account.

It worked.

So maybe it's just that line that is missing in the documentation (specific to google apps) and that would really help other people.
Should I add it myself to the wiki page? ( this one http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/ )
Is it really a solution that works for everyone?

Anyway I'm happy I fixed the last showstopper for more serious use of redmine for my projects :)

#7 Updated by Felix Schäfer over 6 years ago

Joël Lamotte wrote:

Should I add it myself to the wiki page?

Yes.

( this one http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/ )

No, that is an article, but feel free to add it to EmailConfiguration, maybe even in a specific subparagraph for "gmail and other TLS-requiring SMTP servers".

Is it really a solution that works for everyone?

No, IIRC that will only work with "recent" enough ruby and rails versions (1.8.7 patchset 2xx and 2.3.5),

#8 Updated by Joël Lamotte over 6 years ago

Thanks, I added a subparagraph to the wiki page.

Also available in: Atom PDF