-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
174 lines (117 loc) · 5.78 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Radicale Email Reminder
=======================
A standalone script designed to run repeatedly against a Radicale
collection to send email reminders that match VALARMs nested in
ICS/iCalendar files.
The objective is to simply send emails along with any alert/alarm that
is specified in any calendar event or to-do item. Very few open source
CalDAV servers support such email notifications out-of-the-box. This
project effectively allows any iCalendar VALARM to double as an email
alert.
This script supports *all* RFC 5545 VALARM use cases, and properly
implements email reminders for both repeating and expiring events.
Requirements
------------
- Radicale <https://radicale.org/>
- icalendar <https://pypi.org/project/icalendar/> (should have already
installed alongside Radicale)
- Cron or Schtasks
Setup
-----
There really isn't much to lay out. When setting up Cron or Schtasks,
simply specify the proper Python command. For Cron:
* * * * * radicale python /var/lib/radicale/radicale_email_reminder.py /var/lib/radicale/collections/collection-root 1 ::1 25 'Radicale Reminder <[email protected]>' > /dev/null
This will run "radicale_email_reminder.py" (which happens to be
located in "/var/lib/radicale/") once a minute. Read further for
information about the script's arguments. It might also be cleaner to
move that bulky command into its own shell script where you can break
lines and make other improvements.
CLI Usage
---------
python radicale_email_reminder.py <directory> <minutes ahead> <mail server host> <mail server port> <from address>
<directory>
Ideally this should be the path to the root Radicale collection. This
script is actually agnostic to the CalDAV server itself. The given
directory must simply contain the ICS/iCal files that are managed by
any server.
<minutes ahead>
When the script runs, it must calculate the window in which VALARMs
must fall so that their emails are sent. The window always starts at
the zeroth second of the minute it runs. E.g. if the script starts at
2019-03-06T09:00:32.856Z (bear with me), and <minutes ahead> is "2",
then it will send emails for all VALARMs that fall exactly *at* or
*later* than 2019-03-06T09:00:00Z, and exactly *earlier* than
2019-03-06T09:02:00Z. VALARMs *at* exactly 2019-03-06T09:02:00Z will
*not* be sent. This is to eliminate the possibility of duplicate
emails when the script runs again at say 2019-03-06T09:02:15.283Z, in
which case the window will be greater than or equal to
2019-03-06T09:02:00Z and strictly less than 2019-03-06T09:04:00Z. So
yeah, every 2 minutes without repetition.
<mail server host>
So in order for emails to go out at all, an SMTP server must be
specified. This script is meant to be as simple as possible, so
chances are you will be deploying this with some cookie-cutter mail
setup over a local network/host.
- SMTPS and other historical protocols are *not* supported.
- Authentication of any kind is *not* supported.
- STARTTLS *is* supported it's easy.
<mail server port>
Port for the aforementioned host. As this script does not support
authentication, this will likely be "25".
<from address>
The sender of the notification emails. Should follow the standard
<https://tools.ietf.org/html/rfc5322#section-3.4>. E.g.:
Radicale Reminder <[email protected]>
In other words, should simply follow all the best practices for
outgoing email.
Setting an Email Reminder
-------------------------
By now you're wondering where to specify the recipients of email
reminders. In technical terms, a special syntax must be entered at the
*top* of the "DESCRIPTION" in the VEVENT or VTODO closures in an iCal
file, like so:
DESCRIPTION:Notify:\[email protected]\nSomeone <[email protected]>\n-\n\nTh
is is a note/description/detail of the event.
From a UI like InfCloud, it will be the "Note" section when creating a
new calendar event or to-do item. The example above was generated by
the following "Note":
Notify:
Someone <[email protected]>
-
This is a note/description/detail of the event.
Notice the "Notify:" (yes, with the colon), followed by a new-line,
followed by new-line separated email addresses, followed by a final
new-line, then a dash. An email will be sent for this event containing
the description "This is a note/description/detail of the event." and
omitting the notify section.
Don't forget to also set the actual alerts/reminders. Specifying a
notify section without adding any actual VALARMs will obviously do
nothing. In InfCloud they are each called "Alert".
Contributing
------------
Please communicate changes over this project's GitLab/GitHub
pages. Bear in mind that this is not and never will be a large-scale
project, and the GitLab/GitHub pages are merely mirrors of a separate
"official" repository. Any accepted changes will get due authorship
and credit.
https://gitlab.com/nzeid/radicale-email-reminder
https://github.com/nzeid/radicale-email-reminder
License
-------
Copyright (c) 2019 Nader G. Zeid
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/gpl.html>.
Acknowledgments
---------------
Special thanks to the awesome work by the Radicale <https://radicale.org/>
and icalendar <https://pypi.org/project/icalendar/> teams. And a
thanks-as-always to the Python Software Foundation.