ews-orgmode is a python script to fetch your exchange calendar using exchange webservices and format it into an orgmode readable format for using it in your orgmode agenda.
Clone the repository using:
git clone http://github.com/kautsig/ews-orgmode.git
Change into the directory and create a config file:
cd ews-orgmode cp config.cfg.sample config.cfg emacs config.cfg
The only mandatory field of the configuration file is ‘host’, pointing to your server. Other fields have somewhat sane values that should fit your needs.
host
- server name without protocol, e.g. your.exchange.host.org.path
- web-service path, defaults to e.g. /ews/Exchange.asmx.username
- user’s name for HTTP authentications, may be omitted in some situations (e.g. with GSSAPI).password
- password for HTTP authentications.auth_type
- One of: ‘any’, ‘basic’, ‘digest’, ‘ntlm’, ‘negotiate’. ‘any’ makes the choice automatically and chooses any of the mechanisms provided by a server except ‘Basic. This one has enabled explicitly.cainfo
- file holding certificate used to sign server key.timezone
- Your time zone e.g. Europe/Vienna, defaults to UTC.days_history
- How old entries to fetch.days_future
- How long in the future to look for entries.max_entries
- How many entries to fetch.
The config.cfg is within the .gitignore file, so you don’t publish it by accident. Now, run the script:
./ews-fetch-calendar.py
If everythings ok, you should see your exchange calendar in orgmode format as console output. You can redirect it into an orgmode file for using in your agenda. E.g. you could use something like this in a cronjob:
./ews-fetch-calendar.py -o ~/org/exchange.org
- create the docker image
# cd /cloned/directory
docker build --tag ews-orgmode .
- run the docker image
docker run ews-orgmode
The scheduler uses mantra to run scheduled jobs. Mantra is a simple job scheduler without much overhead. See https://github.com/pugnascotia/mantra
The scheduled job will run hourly (as configured in cron-setup/Dockerfile). The format is based on a cron-like setup, but also allows runs every second. The format is described here
The docker-compose.yml writes the output to the .ews-orgmode directory parallel to the root of this project and restarts the container automatically, if docker restarts.
# cd /cloned/directory
# build the ews-orgmode image
docker build --tag ews-orgmode .
# create output directory
mkdir ../.ews-orgmode
# initial creation of docker-compose services (run only once)
cd cron-setup
docker-compose build
docker-compose up
# cancel with ctrl-c
# start as background service
docker-compose start
Use the script at your own risk. Read it, understand it, modify it. But do not blame me if something goes wrong.