Coder Social home page Coder Social logo

cal_agent's Introduction

CalDav Agent

This tool provides an interface to add Todo or Calendar items to your CalDav server by sending e-mails. For the moment, it has only been tested with owncloud server.

Please feel free to fork the project and send me pull requests with your bug fixes or enhancements.

Usage

The Cal Agent in its current configuration only runs once per invocation. Hence, to parse your emails on a regular basis, I suggest to use your systems' scheduler. While it would be easy to run an infinite loop in python itself, it seems much more appealing to me to use cronjobs instead.

All available command-line parameters are optional. If you don't add any option, the tool assumes your configuration file is named config.ini and lies in the same folder as cal_agent.py. The default profile is called - guess what - default.

If you want to specify your own config or run several configurations alongside, you can specifiy files and profiles, for instance:

python cal_agent.py --config /home/astriffe/config.ini --profile owncloud

The correct parsing of the e-mail messages relies on some conventions on how these messages are structured:

Todo

Subject prefix: 'TODO'

E-Mail body: Description

Calendar

Subject prefix: 'CAL'

E-Mail Body:

  • first line: start ; end (mandatory, delimiter set in configuration file)
  • second line*: calendar= (optional)

The delimiter can be defined in the configuration file using the property date_delimiter. All entries will be suffixed with the sender's name and e-mail address.

Configuration

The parameters for both IMAP and CalDav server connections can be specified in a separate configuration file. On application start, this file can be specified. This allows for storing the configuration with probably sensitive password data at a protected place. The following configuration properties are available, all except those marked with an asterix are mandatory. I'll quickly explain the non-trivial ones:

  • imap_username
  • imap_password
  • imap_hostname
  • imap_port
  • caldav_username
  • caldav_password
  • caldav_port
  • caldav_server_path: The path on which your server provides the caldav interface. For owncloud, this should equal 'remote.php/caldav'
  • delete_when_read*: Decide whether to delete processed messages on the imap server or not. Note: To avoid create multiple entries from one message, only unseen messages are processed and immediately marked 'seen' afterwards.
  • date_delimiter*: The delimiter between start and end time of an event. Please make sure this character does not conflict with the date format.
  • calendarname*: The name of the calendar your tasks are stored in, as well as the events if you do not specify a different calendar name. The name comparison is case insensitive.

Disclaimer

Use at own risk, protect against spam and get lucky :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.