James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 1 | :title: SMTP Driver |
| 2 | |
| 3 | SMTP |
| 4 | ==== |
| 5 | |
| 6 | The SMTP driver supports reporters only. It is used to send email |
| 7 | when items report. |
| 8 | |
| 9 | Connection Configuration |
| 10 | ------------------------ |
| 11 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 12 | .. attr:: <smtp connection> |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 13 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 14 | .. attr:: driver |
| 15 | :required: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 16 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 17 | .. value:: smtp |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 18 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 19 | The connection must set ``driver=smtp`` for SMTP connections. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 20 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 21 | .. 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. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 42 | |
| 43 | Reporter Configuration |
| 44 | ---------------------- |
| 45 | |
| 46 | A simple email reporter is also available. |
| 47 | |
| 48 | A :ref:`connection<connections>` that uses the smtp driver must be supplied to the |
| 49 | reporter. The connection also may specify a default *To* or *From* |
| 50 | address. |
| 51 | |
| 52 | Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 53 | providing alternatives as arguments to the reporter. For example: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 54 | |
James E. Blair | fb0f716 | 2017-08-04 08:36:33 -0700 | [diff] [blame] | 55 | .. 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. |