No description
Find a file
2025-05-22 01:11:37 +02:00
.gitignore Initial commit 2025-05-21 18:50:52 +02:00
imapcalendar.py Use BODY.PEEK[] to avoid marking all mail as read 2025-05-22 01:11:37 +02:00
imapcalendar_config.ini.example Initial commit 2025-05-21 18:50:52 +02:00
LICENSE Initial commit 2025-05-21 18:50:52 +02:00
README.md Initial commit 2025-05-21 18:50:52 +02:00

IMAP calendar sync for Nextcloud

A Python script that automates the processing of .ics calendar invites received via e-mail and synchronizes them with a Nextcloud calendar using CalDAV.

Features

  • Connects to an IMAP inbox
  • Parses .ics attachments of type text/calendar
  • Automatically adds new events to a Nextcloud calendar
  • Updates existing events when changes are received
  • Deletes events when cancellation messages are received
  • Updates participant RSVP statuses (PARTSTAT)

Requirements

  • python3-caldav
  • python3-dateutil
  • python3-icalendar
  • python3-requests
  • python3-vobject

Configuration

1. Create your configuration file

Copy the example file and customize it:

cp imapcalendar_config.ini.example imapcalendar_config.ini
vim imapcalendar_config.ini

2. Secure the config file

Make sure your credentials file is only readable by you:

chmod 600 imapcalendar_config.ini

Usage

Run the script manually:

python3 imapcalendar.py

Or loop it for testing:

while true; do python3 imapcalendar.py; sleep 30; done

For production, consider a cron job or systemd timer.

License

This project is licensed under the GNU General Public License v3.0 or later (GPLv3+).

See the LICENSE file for details.