calrules enables you to perform actions against meeting requests and meeting cancellations.
calrules only works with Microsoft Exchange calendar providers.
I'm too lazy to create a PyPi package, but you can easily install this using:
pip install git+https://github.com/sthulb/cal-rules.gitThis package requires Python 3.9 or higher.
You can run the project using the calrules binary that's installed, make sure you include the --config parameter:
calrules --config /path/to/config.yamlYou can add more detailed logging using the LOG_LEVEL=debug env var.
senderemail address who sent the meetingrecipientsa list of email addresses the event was sent to.typemeeting event type,REQUESTorCANCELLATIONsubjectcalendar event subject linehas_conflictsif the event is conflicted with anothersent_datea unix timestamp of sent datedurationduration of the eventmodifiedif the event is an update to the original event
Example Config:
exchange:
email: <email>
username: <username>
domain: <domain>
password: <password>
server: <server>
ca_cert: <optional mail server TLS root cert>
rules:
- pattern: "type == 'CANCELLATION'"
description: Meeting Cancellation
response: DELETE
- pattern: "sender == '[email protected]'"
description: Decline cal spam
response: DECLINE
message: No thanks!
## Complex rules
- pattern: >
sender in [
"[email protected]",
"[email protected]",
"[email protected]",
]
description: Thing (Addresses)
response: DECLINE
- pattern: >
[s for s in [
".*Foo.*",
".*Bar.*",
".*Baz.*",
] if subject =~ s]
description: Thing (Subject)
response: DECLINE