]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/mailnotification.mdwn
web commit by JoshTriplett: Plural fix.
[ikiwiki.git] / doc / todo / mailnotification.mdwn
1 Should support mail notification of new and changed pages.
2
3   Hmm, should be easy to implement this.. it runs as a svn post-coommit hook
4   already, so just look at the userdb, svnlook at what's changed, and send
5   mails to people who have subscribed.
6
7   A few details:
8   1. [[Joey]] mentioned that being able to subscribe to globs as well as
9      explicitly named pages would be desirable.
10   2. I think that since we're using Perl on the backend, being able to
11      let users craft their own arbitrary regexes would be good.
12
13      Joey points out that this is actually a security hole, because Perl
14      regexes let you embed (arbitrary?) Perl expressions inside them.  Yuck!
15
16 (This is not actually true unless you "use re 'eval';", without which
17 (?{ code }) is disabled for expressions which interpolate variables.
18 See perldoc re, second paragraph of DESCRIPTION. It's a little iffy
19 to allow arbitrary regexen, since it's fairly easy to craft a regular
20 expression that takes unbounded time to run, but this can be avoided
21 with the use of alarm to add a time limit. Something like
22
23     eval { # catches invalid regexen
24       no re 'eval'; # to be sure
25       local $SIG{ALRM} = sub { die };
26       alarm(1);
27       ... stuff involving m/$some_random_variable/ ...
28       alarm(0);
29     };
30     if ($@) { ... handle the error ... }
31
32 should be safe. --[[WillThompson]])
33
34      It would also be good to be able to subscribe to all pages except discussion pages or the SandBox: `* !*/discussion !sandobx`, maybe --[[Joey]]
35
36   3. Of course if you do that, you want to have form processing on the user
37      page that lets them tune it, and probably choose literal or glob by
38      default.
39
40      I think that the new globlist() function should do everything you need.
41      Adding a field to the prefs page will be trivial --[[Joey]]
42
43   The first cut, I suppose, could use one sendmail process to batch-mail all
44   subscribers for a given page.  However, in the long run, I can see users
45   demanding a bit of feature creep:
46
47   4. Each user should be able to tune whether they see the actual diff parts or
48      not.
49   5. Each user should be able to set a maximum desired email size.
50   6. We might want to support a user-specified shibboleth string that will be
51      included in the email they receive so they can easily procmail the messages
52      into a folder.
53
54   --[[BrandenRobinson]]
55
56   I'm deferring these nicities until there's some demonstrated demand
57   --[[Joey]].
58
59 [[todo/done]]