Commit graph

18 commits

Author SHA1 Message Date
Jelle van der Waa
03a6fa2f7e Call sendmail with to, not recipient
After f7a57c8 (Localize notification emails, 2018-05-17), the
server.sendmail line was not updated to now send the to the email
address but instead sends to (email, 'en') and as sendmail accepts an
iterable an email is also send to 'en'.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-08-26 08:32:32 -04:00
Lukas Fleischer
b855ce9452 Make SMTP port and authentication configurable
Add more options to configure the smtplib implementation for sending
notification emails.

The port can be changed using the new smtp-port option.

Encryption can be configured using smtp-use-ssl and smtp-use-starttls.
Keep in mind that you usually also need to change the port when enabling
either of these options.

Authentication can be configured using smtp-user and smtp-password.
Authentication is disabled if either of these values is empty.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-11 12:19:56 +01:00
Lukas Fleischer
de549fb2d5 Support smtplib for sending emails
Support mail delivery without a local MTA. Instead, an SMTP server can
now be configured using the smtp-server option in the [notifications]
section. In order to use this option, the value of the sendmail option
must be empty.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-11 12:19:56 +01:00
Lukas Fleischer
ee2aa9755f Add support for backup email addresses
Support secondary email addresses that can be used to recover an account
in case access to the primary email address is lost. Reset keys for an
account are always sent to both the primary and the backup email
address.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:42 +01:00
Lukas Fleischer
4ececd6041 Keep signature delimiters intact in notifications
Since commit eeaa1c3 (Separate text from footer in notification emails,
2020-01-04), information about unsubscribing from notifications is added
in a signature block. However, the code to format the email body trimmed
the RFC 3676 signature delimiter, replacing "-- " by "--". Fix this by
adding a special case for signature delimiters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-01-30 13:25:15 +01:00
Stephan Springer
eeaa1c3a32 Separate text from footer in notification emails
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-01-06 16:37:04 +01:00
Lars Rustand
a66c7fa615 notify.py: Use a/an correctly when sending request notifications
Will no longer send notifications about "a orphan request", but determine
whether to use a/an based on the first character of the request type.

Signed-off-by: Lars Rustand <rustand.lars@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-08-19 14:47:07 -04:00
Eli Schwartz
e0d821352f
notify: add X-AUR-Reason header to allow conveniently filtering emails
Because filtering by matching the sender && regular expressions on the
subject is awkward.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2019-02-08 11:19:16 -05:00
Lukas Fleischer
b70f048bc3 Add package base name in request close notifications
Mention both the package base name and the request type in the subject
of request closure notification.

Implements FS#41607.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-20 16:55:58 +02:00
Lukas Fleischer
6367dfd245 Use modern format strings in notification messages
User modern Python format() strings with curly braces. Also, convert all
placeholders to named arguments. This allows translators to reorder
messages.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-17 22:58:54 +02:00
Lukas Fleischer
f7a57c82bc Localize notification emails
Add support for translating notification emails and send localized
notifications, based on the user's language preferences. Also, update
the translations Makefile to add strings from the notification script
to the message catalog.

Implements FS#31850.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-17 22:58:54 +02:00
Lukas Fleischer
f3b4c5c6bc Refactor the notification script
Reimplement most of the notification script logic. Create a separate
class for each notification type. Each class provides methods for
generating the list of recipients, the message subject, the message
body, the references to add at the end of the message and the message
headers. Additionally, a method for sending notification emails is
provided.

One major benefit of the new implementation is that both the generation
of recipients and message contents are much more flexible. For example,
it is now easily possible to make user-specific adjustments to every
single notification of a batch.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-17 22:05:52 +02:00
Lukas Fleischer
7e452fdfb0 notify.py: Do not add stray newlines
Make sure we are consistent with not adding newlines at the end of
notification emails.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-16 20:10:03 +02:00
Johannes Löthberg
879db7012c notify: Send vote reminders to TUs that are also devs
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-03-13 21:05:37 +01:00
Lukas Fleischer
cb307bf01a Do not hardcode path to the Python interpreter
Use `/usr/bin/env python3` instead of `/usr/bin/python3` in the shebang
of Python scripts. This adds support for non-standard Python interpreter
paths such as the paths used in virtualenv environments.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-08-25 07:01:12 +02:00
Lukas Fleischer
fd36125a21 notify: Avoid EXCEPT in SQL statement
Do not use the EXCEPT clause which is unsupported in MySQL. Instead, use
a subquery which is standard-compliant and makes the query easier to
read at the same time.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
e9ac4b9b9e Send out-of-date notifications to co-maintainers
Currently, only package maintainers receive out-of-date notifications
for their packages. Add package base co-maintainers to the list of
recipients for out-of-date notifications.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:38:44 +01:00
Lukas Fleischer
37188603b5 Make maintenance scripts installable
Add wrappers for the maintenance scripts to the setuptools
configuration.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:23:13 +02:00
Renamed from scripts/notify.py (Browse further)