diff --git a/ics_mail_importer.py b/ics_mail_importer.py index 0db10ce..351c151 100644 --- a/ics_mail_importer.py +++ b/ics_mail_importer.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -ics_mail_importer_env_v4.py +ics_mail_importer_env_v5.py --------------------------- ICS-Importer für mailbox.org / CalDAV. @@ -54,12 +54,17 @@ def env_bool(name: str, default: str = "false") -> bool: def is_newer_version_conflict(exc: Exception) -> bool: - message = str(exc) - return ( - "412 Precondition Failed" in message - and "CAL-4121" in message - and "newer version of the appointment already exists" in message - ) + message = str(exc or "").lower() + patterns = [ + "412 precondition failed", + "cal-4121", + "newer version of the appointment already exists", + "concurrent modification", + "client sequence", + "actual sequence", + ] + matches = sum(1 for p in patterns if p in message) + return matches >= 2 def import_ics_to_caldav(ics_bytes: bytes, uid_hash: str):