プロジェクト

全般

プロフィール

Vote #63390

完了

SMTP server config should be moved from environment.rb

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
開始日:
2008/06/09
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
2
issue_org_id:
1412
author_id:
4
assigned_to_id:
0
comments:
7
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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).


journals

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:

<pre>
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:
[...]
</pre>

What do you think ?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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

--------------------------------------------------------------------------------
Committed in r1625.
SMTP settings should now be entered in config/email.yml (see the sample email.yml.example).
--------------------------------------------------------------------------------
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:
<pre>
production:
delivery_method: :smtp
smtp_settings:
address: mailserver.domain.tld
port: 25
domain: thisserver.domain.tld
</pre>

I.e. remove the lines relating to authentication, user_name and password.
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリEmail notifications_9 にセット
  • 対象バージョン0.8_2 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0