EmailConfiguration » History » Version 33

Miodrag Milic, 2013-01-10 14:59

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