move to roundcube

This commit is contained in:
Neale Pickett 2012-10-09 15:55:35 -05:00
parent 06da0a46ca
commit 32f034bb80
6 changed files with 122 additions and 14 deletions

View File

@ -1 +1,5 @@
PLAIN += $(wildcard derby/*.mdwn)
PLAIN += derby
COPY += derby/scrimmage.pdf
$(DESTDIR)/derby/scrimmage.pdf: derby/scrimmage.ps
ps2pdf $< $@

View File

@ -13,9 +13,9 @@ The Woozle Promise
Software
--------
* [Scoreboard](/scoreboard/), works in any web browser
* [Penalty Timer (Android)](https://play.google.com/store/apps/details?id=org.woozle.penaltytimer)
* [Track](/track/) with movable players
* [Scoreboard](/scoreboard/), works in any web browser -- [source](http://woozle.org/~neale/g.cgi/scoreboard/)
* [Penalty Timer for Android](https://play.google.com/store/apps/details?id=org.woozle.penaltytimer) -- [source](http://woozle.org/~neale/g.cgi/ptimer/)
* [Track](/track/) with movable players -- [source](http://woozle.org/~neale/g.cgi/track/)
Forms
-----

25
ilohamail.cgi.c Normal file
View File

@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
const char *basepath = "/usr/share/IlohaMail/source";
int
main(int argc, char *argv[])
{
char *pathinfo = getenv("PATH_INFO");
char filename[512];
if ((! pathinfo) ||
(! strcmp(pathinfo, "/")) ||
(0 == strcmp(pathinfo, "/index.html"))) {
pathinfo = "/index.php";
}
snprintf(filename, sizeof filename, "%s%s", basepath, pathinfo);
setenv("SCRIPT_FILENAME", filename, 1);
setenv("REDIRECT_STATUS", "fuck me", 1);
execl("/usr/bin/php-cgi", filename, NULL);
return 0;
}

View File

@ -7,3 +7,30 @@ held by folks who know the right person to ask.
<!--
ssh fingerprint for woozle.org: 63:ac:b0:e9:ee:9f:a9:4f:55:0a:4a:42:5d:45:47:06
-->
October 9: New Webmail
----------------------
The October 2 change broke webmail. Again. Rather than fix it again,
I thought everyone would enjoy a more modern webmail client. You can
still get to [the old one](https://woozle.org/ilohamail.cgi) if you
want to pull your address book out or something, but I'm planning on
removing it in a few months unless someone asks me not to.
Mail filtering is now available. You can
get to that under Settings. This uses a standard filtering language,
so your filters will stick around if I have to change the webmail
program again. These filters also apply to IMAP clients (like your
Android or iPhone, or Thunderbird).
October 2: Kerboom
------------------
In trying to get my 2006 cell phone to sync with Google Calendar, I broke
(among other things) mail. I think it's all back up now. If you see any
other problems, please give me a call.
I should mention that [eris HTTPd](http://woozle.org/~neale/src/eris.html)
was the only service that never went down; not even for a nanosecond.

View File

@ -3,22 +3,74 @@
#include <unistd.h>
#include <string.h>
const char *basepath = "/usr/share/IlohaMail/source";
const char *baseurl = "https://woozle.org/mail.cgi/";
const char *basepath = "/opt/roundcubemail";
int
main(int argc, char *argv[])
{
char *pathinfo = getenv("PATH_INFO");
char *remaddr = getenv("REMOTE_ADDR");
size_t pathlen = pathinfo?strlen(pathinfo):0;
char filename[512];
char *ext;
if ((! pathinfo) ||
(! strcmp(pathinfo, "/")) ||
(0 == strcmp(pathinfo, "/index.html"))) {
pathinfo = "/index.php";
if ((! pathinfo) || (! remaddr) || (0 != strncmp(remaddr, "127.0.0.1:", 10))) {
printf("%s\n", baseurl);
return 0;
} else if (0 == strcmp(pathinfo, "/index.html")) {
snprintf(filename, sizeof filename, "%s/index.php", basepath);
} else if (pathinfo[pathlen-1] == '/') {
snprintf(filename, sizeof filename, "%s%sindex.php", basepath, pathinfo);
} else {
snprintf(filename, sizeof filename, "%s%s", basepath, pathinfo);
}
snprintf(filename, sizeof filename, "%s%s", basepath, pathinfo);
setenv("SCRIPT_FILENAME", filename, 1);
execl("/usr/bin/php-cgi", filename, NULL);
ext = strrchr(filename, '.');
if (! ext) {
ext = "";
}
if (0 == strcmp(ext, ".php")) {
setenv("SCRIPT_FILENAME", filename, 1);
setenv("REDIRECT_STATUS", "fuck me", 1);
execl("/usr/bin/php-cgi", filename, NULL);
} else if (strstr(filename, "/config/") ||
strstr(filename, "/logs/") ||
strstr(filename, "/temp/")) {
printf("Content-type: text/plain\n\n[MESSAGE REDACTED]\n");
} else {
FILE *f = fopen(filename, "r");
char *ct = "application/octet-stream";
if (0 == strcmp(ext, ".css")) {
ct = "text/css";
} else if (0 == strcmp(ext, ".html")) {
ct = "text/html";
} else if (0 == strcmp(ext, ".js")) {
ct = "application/javascript";
} else if (0 == strcmp(ext, ".png")) {
ct = "image/png";
} else if (0 == strcmp(ext, ".jpg")) {
ct = "image/jpeg";
} else if (0 == strcmp(ext, ".gif")) {
ct = "image/gif";
}
printf("Content-type: %s\n\n", ct);
while (! feof(f)) {
char buf[4096];
size_t len;
len = fread(buf, 1, sizeof buf, f);
if (len) {
fwrite(buf, 1, len, stdout);
}
}
}
fflush(stdout);
return 0;
}

View File

@ -1,11 +1,11 @@
PLAIN += .
COPY += icon.png style.css style-black.css lists.cgi wishlist.cgi set.cgi $(TEMPLATE)
COPY += mail.cgi
COPY += mail.cgi ilohamail.cgi
COPY += google7f698b9893809122.html
HTML += people.html
$(DESTDIR)/people.html: people.sh template.html.m4
sh $< | $(MDWNTOHTML) > $@
$(DESTDIR)/mail.cgi: mail.cgi.c
$(DESTDIR)/%.cgi: %.cgi.c
$(CC) -Wall -Werror -o $@ $<