blob: 11c062473c0716b35ca062c83f19fc06e3b58363 [file] [log] [blame]
James E. Blaireff5a9d2017-06-20 00:00:37 -07001:title: SMTP Driver
2
3SMTP
4====
5
6The SMTP driver supports reporters only. It is used to send email
7when items report.
8
9Connection Configuration
10------------------------
11
James E. Blairfb0f7162017-08-04 08:36:33 -070012.. attr:: <smtp connection>
James E. Blaireff5a9d2017-06-20 00:00:37 -070013
James E. Blairfb0f7162017-08-04 08:36:33 -070014 .. attr:: driver
15 :required:
James E. Blaireff5a9d2017-06-20 00:00:37 -070016
James E. Blairfb0f7162017-08-04 08:36:33 -070017 .. value:: smtp
James E. Blaireff5a9d2017-06-20 00:00:37 -070018
James E. Blairfb0f7162017-08-04 08:36:33 -070019 The connection must set ``driver=smtp`` for SMTP connections.
James E. Blaireff5a9d2017-06-20 00:00:37 -070020
James E. Blairfb0f7162017-08-04 08:36:33 -070021 .. attr:: server
22 :default: localhost
23
24 SMTP server hostname or address to use.
25
26 .. attr:: port
27 :default: 25
28
29 SMTP server port.
30
31 .. attr:: default_from
32 :default: zuul
33
34 Who the email should appear to be sent from when emailing the report.
35 This can be overridden by individual pipelines.
36
37 .. attr:: default_to
38 :default: zuul
39
40 Who the report should be emailed to by default.
41 This can be overridden by individual pipelines.
James E. Blaireff5a9d2017-06-20 00:00:37 -070042
43Reporter Configuration
44----------------------
45
46A simple email reporter is also available.
47
48A :ref:`connection<connections>` that uses the smtp driver must be supplied to the
49reporter. The connection also may specify a default *To* or *From*
50address.
51
52Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by
James E. Blairfb0f7162017-08-04 08:36:33 -070053providing alternatives as arguments to the reporter. For example:
James E. Blaireff5a9d2017-06-20 00:00:37 -070054
James E. Blairfb0f7162017-08-04 08:36:33 -070055.. code-block:: yaml
56
57 - pipeline:
58 name: post-merge
59 success:
60 outgoing_smtp:
61 to: you@example.com
62 failure:
63 internal_smtp:
64 to: you@example.com
65 from: alternative@example.com
66 subject: Change {change} failed
67
68.. attr:: pipeline.<reporter>.<smtp source>
69
70 To report via email, the dictionaries passed to any of the pipeline
71 :ref:`reporter<reporters>` attributes support the following
72 attributes:
73
74 .. attr:: to
75
76 The SMTP recipient address for the report. Multiple addresses
77 may be specified as one value separated by commas.
78
79 .. attr:: from
80
81 The SMTP sender address for the report.
82
83 .. attr:: subject
84
85 The Subject of the report email.
86
87 .. TODO: document subject string formatting.