wait for dovecot

This commit is contained in:
2026-01-27 21:21:43 -06:00
parent 1d5e24f541
commit 96a1815b6a
2 changed files with 19 additions and 5 deletions

View File

@@ -108,7 +108,23 @@ def sync():
print(f'{email}')
def wait_for_dovecot():
"""Wartet, bis der Dovecot Auth Socket verfügbar ist."""
# Der Pfad zum Socket, über den doveadm kommuniziert
socket_path = '/var/run/dovecot/auth-userdb'
print("⏳ Warte auf Dovecot Start...")
while not os.path.exists(socket_path):
print(f" ... Socket {socket_path} noch nicht da. Schlafe 5s.")
time.sleep(5)
print("✅ Dovecot ist bereit!")
if __name__ == '__main__':
# 1. Erst warten, bis Dovecot da ist, sonst hagelt es Fehler beim Start
wait_for_dovecot()
# Pfad zur Cron-Definition (nur der String, z.B. "*/5 * * * *")
CRON_FILE = '/etc/sieve-schedule'