Skip to content

Commit

Permalink
email reporter: Allow multiple recipients for sendmail method (thp#797,…
Browse files Browse the repository at this point in the history
… by monperrus)

Co-authored-by: Thomas Perl <m@thp.io>
  • Loading branch information
monperrus and thp authored Mar 12, 2024
1 parent 4d3b7a8 commit 5c0b15c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format mostly follows [Keep a Changelog](http://keepachangelog.com/en/1.0.0/

### Fixed

- `email` reporter: Allow multiple recipients for `sendmail` method (#797, by monperrus)
- Fix documentation for watching Github tags and releases, again (#723)
- Fix `--test-reporter` command-line option so `separate` configuration option is no longer ignored when sending test notifications (#772, by marunjar)
- Fix line height and dark mode regression (#774 reported by kongomongo, PRs #777 and #778 by trevorshannon)
Expand Down
17 changes: 16 additions & 1 deletion docs/source/reporters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The list of built-in reporters can be retrieved using::
At the moment, the following reporters are built-in:

- **discord**: Send a message to a Discord channel
- **email**: Send summary via e-mail / SMTP
- **email**: Send summary via e-mail / SMTP / sendmail
- **ifttt**: Send summary via IFTTT
- **mailgun**: Send e-mail via the Mailgun service
- **matrix**: Send a message to a room using the Matrix protocol
Expand Down Expand Up @@ -290,6 +290,21 @@ public Matrix room, as the messages quickly become noisy:
minimal: true
enabled: true
E-Mail via sendmail
---------------------

You can send email via the system's ``sendmail`` command provided by the MTA. You need to set ``method: sendmail`` in the config file:

.. code:: yaml
report:
email:
enabled: true
from: 'postmaster@example.com'
to: 'recipient@bar.com'
method: sendmail
E-Mail via GMail SMTP
---------------------

Expand Down
2 changes: 1 addition & 1 deletion lib/urlwatch/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __init__(self, sendmail_path):
self.sendmail_path = sendmail_path

def send(self, msg):
p = subprocess.Popen([self.sendmail_path, '-oi', '-f', msg['From'], msg['To']],
p = subprocess.Popen([self.sendmail_path, '-oi', '-f', msg['From']] + msg['To'].split(','),
stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True)
Expand Down

0 comments on commit 5c0b15c

Please sign in to comment.