From 6901b0f05e8fb5167fa7c1d0c8cec6ea002bef3f Mon Sep 17 00:00:00 2001 From: Vincent Kling Date: Tue, 8 Nov 2022 11:47:20 +0100 Subject: [PATCH] Implement FETCHMAIL_ENABLED in fetchmail.py --- optional/fetchmail/fetchmail.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/optional/fetchmail/fetchmail.py b/optional/fetchmail/fetchmail.py index 5459de59..1889d808 100755 --- a/optional/fetchmail/fetchmail.py +++ b/optional/fetchmail/fetchmail.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 - +import distutils.util import time import os import tempfile @@ -96,5 +96,9 @@ def run(debug): if __name__ == "__main__": while True: time.sleep(int(os.environ.get("FETCHMAIL_DELAY", 60))) + + if not os.environ.get("FETCHMAIL_ENABLED", 'True') in ('True', 'true'): + continue + run(os.environ.get("DEBUG", None) == "True") sys.stdout.flush()