Project

General

Profile

Actions

Feature #1412

closed

SMTP server config should be moved from environment.rb

Added by Anonymous almost 16 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
Start date:
2008-06-09
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Items that will be customised regularly on a per-installation basis should not be in version-controlled code. This makes upgrading harder or even working with an svn checkout of a branch (e.g. the 0.7-stable branch).

In the first case, moving to a new installation will break loose the SMTP settings as you'll get a new environment.rb and in the second, you'll always see local modifications etc.

The config settings for SMTP server should either be in the database (configured through the e-mail administration page) or in a separate config file that isn't versioned (similar to databases.yml).

Actions #1

Updated by Jean-Philippe Lang almost 16 years ago

I propose to move the mail settings to a file similar to database.yml (eg. email.yml), with a section for each environment (production, development ...).

It would like this:

production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.somenet.foo
    port: 25
    domain: somenet.foo
    authentication: :login
    user_name: redmine@somenet.foo
    password: redmine
  perform_deliveries: true

development:
[...]

What do you think ?

Actions #2

Updated by Eric Davis almost 16 years ago

Jean-Philippe Lang wrote:

I propose to move the mail settings to a file similar to database.yml (eg. email.yml), with a section for each environment (production, development ...).

What do you think ?

That should work good. I've seen several projects use a format like that.

Actions #3

Updated by Anonymous almost 16 years ago

Jean-Philippe Lang wrote:

I propose to move the mail settings to a file similar to database.yml (eg. email.yml), with a section for each environment (production, development ...).

Hi Jean-Philippe, yes that would be fine.

Thanks

Russell

Actions #4

Updated by Jean-Philippe Lang almost 16 years ago

  • Status changed from New to Closed
  • Target version set to 0.8
  • Resolution set to Fixed

Committed in r1625.
SMTP settings should now be entered in config/email.yml (see the sample email.yml.example).

Actions #5

Updated by Roger Hunwicks over 15 years ago

It took me a while to figure out how to get Redmine to send emails using an internal SMTP server that doesn't require authentication - Google turned up some settings for ActionMailer that didn't work - so I thought I would document it here in case it is useful for anyone else.

If you are getting "authentication not enabled" when you try and send a test email, you need to configure your email.yml like:

production:
  delivery_method: :smtp
  smtp_settings:
    address: mailserver.domain.tld
    port: 25
    domain: thisserver.domain.tld

I.e. remove the lines relating to authentication, user_name and password.

Actions #6

Updated by Anonymous over 15 years ago

Roger Hunwicks wrote:

It took me a while to figure out how to get Redmine to send emails using an internal SMTP server that doesn't require authentication - Google turned up some settings for ActionMailer that didn't work - so I thought I would document it here in case it is useful for anyone else.

If you are getting "authentication not enabled" when you try and send a test email, you need to configure your email.yml like:
[...]

I.e. remove the lines relating to authentication, user_name and password.

Took me a while to find this too. For non-ruby users, things like this do need documenting somewhere.

Cheers

Russell

Actions #7

Updated by Ryan Macaluso about 15 years ago

I gave up on using gmail as SMTP server and used this method to use the IIS SMTP server. I also had to give access in IIS for my computer (acting as the server) to relay email and then notifications worked.

I am so glad I found this solution!!!

Thanks,
Ryan

Actions

Also available in: Atom PDF