aboutsummaryrefslogtreecommitdiff
path: root/watcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'watcher.py')
-rw-r--r--watcher.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/watcher.py b/watcher.py
index 9799bae..e5df0b6 100644
--- a/watcher.py
+++ b/watcher.py
@@ -20,7 +20,7 @@ from urllib.parse import quote
from server import DEFAULT_CONFIG_FILE, AppConfig, load_config
-SCAN_INTERVAL_SECONDS = 5 * 60
+SCAN_INTERVAL_SECONDS = 60
IMAGE_SUFFIXES = {".jpg", ".png", ".heic"}
SUBJECT = "New upload received"
BODY = "A new file has been uploaded to your private drop."
@@ -71,11 +71,11 @@ def build_message(config: AppConfig, target: str, target_dir: Path, filenames: l
message = EmailMessage()
message["From"] = config.smtp.send_as
message["To"] = config.recipients[target]
- message["Subject"] = SUBJECT
+ message["Subject"] = config.subjects.get(target, SUBJECT)
message["Date"] = formatdate(localtime=True)
message["Message-ID"] = make_msgid(domain=config.smtp.send_as.rsplit("@", 1)[1])
prefix = config.view_url_prefixes.get(target)
- sections = [BODY]
+ sections = [config.body_headers.get(target, BODY)]
for name in filenames:
# Stored names are server-generated hex plus an extension, so they are URL-safe.
heading = prefix + quote(name) if prefix else f"File: {name}"