From 5fc42907e3660db62aaffddac037373d24e80212 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Sat, 25 May 2024 12:34:29 +0200 Subject: [PATCH] Add a success indication Also document the command. --- README.md | 11 ++++++----- hedgedoc-expire.py | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3ff610d..6ddd2e4 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,12 @@ Without it, the expiry action will be taken. Command is one of: -| Command | Description | -|---------|------------------------------------------------------------------------------------------------------------| -| check | Print a list of revisions and notes that would be expired, based on the given parameters for `-n` and `-r` | -| cron | Run `expire` at 2 am local time each day. Will run until killed. | -| expire | Expire old revisions and notes. | +| Command | Description | +|------------|------------------------------------------------------------------------------------------------------------| +| check | Print a list of revisions and notes that would be expired, based on the given parameters for `-n` and `-r` | +| cron | Run `expire` at 2 am local time each day. Will run until killed. | +| emailcheck | Send a test email from the configured sender to themselves. | +| expire | Expire old revisions and notes. | ### Environment variables diff --git a/hedgedoc-expire.py b/hedgedoc-expire.py index 5119535..e4ec253 100644 --- a/hedgedoc-expire.py +++ b/hedgedoc-expire.py @@ -69,6 +69,7 @@ class EmailSender: except Exception as e: print(f'Unable to send mail through {self}: {e}') raise e + print(f'Test email to {self.mail_from} sent successfully.') def __str__(self): return f'EmailSender<{self.hostname},{self.port},{self.username},{self.mail_from}>' @@ -291,6 +292,7 @@ def main(): command is one of: - check: print a list of revisions and notes to be expired - cron: run expire every 24 hours + - emailcheck: send a test email from the configured sender to themselves - expire: expire old revisions and untouched notes See https://git.hamburg.ccc.de/CCCHH/hedgedoc-expire