Defect #10981

TLS features not effective on Redmine 2.0.0

Added by William Piedfort about 1 year ago. Updated about 1 year ago.

Status:ReopenedStart date:
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:-
Affected version:2.0.0 Resolution:Invalid

Description

I have installed on a host :
Environment:
Redmine version 2.0.0.stable
Ruby version 1.8.7 (i486-linux)
Rails version 3.2.3

The mail serveur on this host is Postfix, works with STL and
and configuration.yml is :
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25

1. Test Mail works if I set TLS at "NO" on Postfix, but this has to remain at "YES" .

So I get an error message "hostname was not match with the server certificate" in test mail, no matter the value in config/environment.rb :
ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false (or true)

I appears to me that I can't disable the TLS feature in the application.
May be there is another feature ?

2 . if I add the parametters in "configuration.yml" :
authentication: :login
user_name: "prx"
password: "passwd"
I have an error at the serveur start in WEBrick : /config/configuration.yml is not a valid YAML file and could not be loaded.

This is not consistant with the examples.

Where is teh clue ?

thanks in advance.

environment.rb Magnifier - environnement (751 Bytes) William Piedfort, 2012-05-22 14:59

History

#1 Updated by Etienne Massip about 1 year ago

  • Assignee deleted (Jean-Philippe Lang)

#2 Updated by Jean-Philippe Lang about 1 year ago

William Piedfort wrote:

1. Test Mail works if I set TLS at "NO" on Postfix, but this has to remain at "YES" .

So I get an error message "hostname was not match with the server certificate" in test mail, no matter the value in config/environment.rb :
ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false (or true)

Looks like your server certificate is not valid.
Please try to use the following option in your smtp settings:

openssl_verify_mode: 'none'

I have an error at the serveur start in WEBrick : /config/configuration.yml is not a valid YAML file and could not be loaded.

Please attach you configuration file.

#3 Updated by Jean-Philippe Lang about 1 year ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Have a look at: http://davidroetzel.wordpress.com/2011/01/14/rails-3-actionmailer-tls-certificate-verification/
Anyway, this is a Rails configuration issue so I'm closing it.

#4 Updated by William Piedfort about 1 year ago

  • File configuration.yml added
  • File environment.rbMagnifier added
  • Status changed from Closed to Reopened

Hi,
Yes I knew this option before and added it before in config/environment.rb (see attached): you cannot insert those type of option in configuration file , despite the exemples !

But as I wrote , it seems that, despite the option set not to control (I put it to true or false : no change, it controls the certificate (mine is expired but many applications exchange emails without problems with this Postfix).

So Redmine application use is blocked because of that point.
Other solutions ?

#5 Updated by William Piedfort about 1 year ago

And I have no other means because:
if I add the parametters in "configuration.yml" :
authentication: :login
user_name: "prx"
password: "passwd"

it fails !
So what else ?

#6 Updated by William Piedfort about 1 year ago

SOLVED :

in configuration.yml: place

default: # Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "myhost.xxx" (AND NOT "localhost" !!)
port: 25
domain: "mydomain"

the options :
  1. openssl_verify_mode: 'none'
  2. tls: true
  3. enable_starttls_auto: true
  4. authentication: :login or plain
  5. user_name: "user"
  6. password: "passwd"
    are not accepted in this file
    nor :async_smtp : doest not work
  7. Turn off auto TLS for e-mail
    ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false
in config/environment.rb 
To use the option, open up your environment.rb and add the following:

and I 've added :
ActionMailer::Base.smtp_settings[:openssl_verify_mode] = false
restart Apache server

And above all :
change the TLS certificate that is used in Postfix : it HAS to HAVE in Common Name = myhost.xxx (the name of your host , even it is a VPS name).

In this case, Rails 3 accept to talk in TLS security with the host and send your mail immediatly !

#7 Updated by Jean-Philippe Lang about 1 year ago

  • File deleted (configuration.yml)

Also available in: Atom PDF