Implement FETCHMAIL_ENABLED in fetchmail.py

main
Vincent Kling 2 years ago
parent 83fdc07a6f
commit 6901b0f05e

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
import distutils.util
import time import time
import os import os
import tempfile import tempfile
@ -96,5 +96,9 @@ def run(debug):
if __name__ == "__main__": if __name__ == "__main__":
while True: while True:
time.sleep(int(os.environ.get("FETCHMAIL_DELAY", 60))) 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") run(os.environ.get("DEBUG", None) == "True")
sys.stdout.flush() sys.stdout.flush()

Loading…
Cancel
Save