EmailConfiguration » History » Version 29

Miodrag Milic, 2012-12-25 18:42

1 1 Cyber Sprocket
h1. Email Configuration
2 1 Cyber Sprocket
3 7 Mischa The Evil
{{>toc}}
4 7 Mischa The Evil
5 1 Cyber Sprocket
h2. Configuration Directives
6 1 Cyber Sprocket
7 10 Graham King
This page is a work in progress, the following configuration directives are only a partial list.
8 1 Cyber Sprocket
9 1 Cyber Sprocket
h3. authentication
10 1 Cyber Sprocket
11 1 Cyber Sprocket
The type of authentication method expected by your service provider. 
12 1 Cyber Sprocket
13 1 Cyber Sprocket
Valid settings:
14 1 Cyber Sprocket
* :login
15 1 Cyber Sprocket
* :none
16 1 Cyber Sprocket
17 4 Anthony Cartmell
(note: if you set this to @:none@, you must not include the @user_name@ and @password@ settings)
18 4 Anthony Cartmell
19 1 Cyber Sprocket
h3. delivery_method
20 1 Cyber Sprocket
21 6 Eric Davis
The mail transport method to be used.
22 1 Cyber Sprocket
23 1 Cyber Sprocket
Valid settings:
24 1 Cyber Sprocket
* :smtp
25 16 Mischa The Evil
* :async_smtp
26 1 Cyber Sprocket
* :sendmail
27 16 Mischa The Evil
* :async_sendmail
28 1 Cyber Sprocket
29 6 Eric Davis
h4. Asynchronous delivery_methods
30 6 Eric Davis
31 29 Miodrag Milic
The @:async_smtp@ and @:async_sendmail@ use asynchronous sends, which means Redmine does not wait for the email to be sent to display the next page.  See "Asynchronous Email Delivery":http://redmineblog.com/articles/asynchronous-email-delivery/ for more details. Some SMTP servers have delay period before processing as security feature, during which time synchronous method will block Redmine ("10 seconds":http://answers.bitnami.org/questions/4421/updating-an-issue-in-redmine-takes-10-seconds could be default value, see also #11376 for more information) .
32 1 Cyber Sprocket
33 23 Miodrag Milic
With this delivery method, smtp configuration is specified using @async_smtp_settings@ keyword:
34 23 Miodrag Milic
35 23 Miodrag Milic
<pre>
36 23 Miodrag Milic
development:
37 23 Miodrag Milic
  email_delivery:
38 23 Miodrag Milic
    delivery_method: :async_smtp
39 23 Miodrag Milic
    async_smtp_settings:
40 23 Miodrag Milic
    ...
41 23 Miodrag Milic
</pre>
42 23 Miodrag Milic
43 11 Etienne Massip
h2. Example configuration.yml Configurations
44 1 Cyber Sprocket
45 1 Cyber Sprocket
h3. Simple Login Authentication (default settings)
46 1 Cyber Sprocket
47 1 Cyber Sprocket
<pre>
48 1 Cyber Sprocket
# Outgoing email settings
49 1 Cyber Sprocket
50 1 Cyber Sprocket
production:
51 12 Ross Wilson
  email_delivery:
52 12 Ross Wilson
    delivery_method: :smtp
53 12 Ross Wilson
    smtp_settings:
54 12 Ross Wilson
      address: smtp.example.net
55 12 Ross Wilson
      port: 25
56 12 Ross Wilson
      domain: example.net
57 12 Ross Wilson
      authentication: :login
58 12 Ross Wilson
      user_name: redmine@example.net
59 12 Ross Wilson
      password: redmine
60 1 Cyber Sprocket
  
61 1 Cyber Sprocket
development:
62 12 Ross Wilson
  email_delivery:
63 12 Ross Wilson
    delivery_method: :smtp
64 12 Ross Wilson
    smtp_settings:
65 12 Ross Wilson
      address: 127.0.0.1
66 12 Ross Wilson
      port: 25
67 12 Ross Wilson
      domain: example.net
68 12 Ross Wilson
      authentication: :login
69 12 Ross Wilson
      user_name: redmine@example.net
70 12 Ross Wilson
      password: redmine
71 1 Cyber Sprocket
</pre>
72 1 Cyber Sprocket
73 1 Cyber Sprocket
74 1 Cyber Sprocket
*If you want to use GMail/Google Apps and other TLS-requiring SMTP servers*, you'll have to add some TLS-related settings :
75 8 Joël Lamotte
76 8 Joël Lamotte
<pre>
77 8 Joël Lamotte
production:
78 12 Ross Wilson
  email_delivery:
79 12 Ross Wilson
    delivery_method: :smtp
80 12 Ross Wilson
    smtp_settings:
81 12 Ross Wilson
      enable_starttls_auto: true
82 12 Ross Wilson
      address: "smtp.gmail.com" 
83 12 Ross Wilson
      port: '587'
84 12 Ross Wilson
      domain: "smtp.gmail.com" 
85 12 Ross Wilson
      authentication: :plain
86 12 Ross Wilson
      user_name: "your_email@gmail.com" 
87 12 Ross Wilson
      password: "your_password" 
88 8 Joël Lamotte
89 8 Joël Lamotte
</pre>
90 8 Joël Lamotte
91 8 Joël Lamotte
However, this will only work with "recent" enough ruby and rails versions (1.8.7 patchset 2xx and 2.3.5).
92 8 Joël Lamotte
(See #5814 )
93 8 Joël Lamotte
94 1 Cyber Sprocket
h3. No Authentication
95 1 Cyber Sprocket
96 1 Cyber Sprocket
Example for an SMTP service provider with no authentication.  Note the colon before none.
97 1 Cyber Sprocket
98 1 Cyber Sprocket
<pre>
99 1 Cyber Sprocket
production:
100 13 Ross Wilson
  email_delivery:
101 13 Ross Wilson
    delivery_method: :smtp
102 13 Ross Wilson
    smtp_settings:
103 13 Ross Wilson
      address: smtp.knology.net
104 13 Ross Wilson
      port: 25
105 13 Ross Wilson
      domain: cybersprocket.com
106 13 Ross Wilson
      authentication: :none
107 1 Cyber Sprocket
</pre>
108 1 Cyber Sprocket
109 1 Cyber Sprocket
h3. Using sendmail command
110 5 Eric Davis
111 5 Eric Davis
Example for a unix system that uses the @/usr/sbin/sendmail@ command.
112 5 Eric Davis
113 5 Eric Davis
<pre>
114 5 Eric Davis
production:
115 13 Ross Wilson
  email_delivery:
116 13 Ross Wilson
    delivery_method: :sendmail
117 5 Eric Davis
</pre>
118 1 Cyber Sprocket
119 7 Mischa The Evil
h2. More information
120 5 Eric Davis
121 5 Eric Davis
* "Action Mailer Configuration":http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration