Howdy,

I'm looking at various ways to set up an HTTP/FTP email gateway,
preferably using a simple .qmail file. Here's what I've got so far:

[root][/var/qmail/alias]# cat .qmail-webgate
# This alias is a simple (and probably easy-to-break) web/email gateway
#
# Future note for wget options: -Q1M for a file quota of 1 Megabyte
#
| /usr/local/bin/822field > ./auto/webgate.temp; /usr/bin/wget -O- -i
./auto/webgate.temp > ./auto/webgate.retrieved;
/var/qmail/bin/qmail-inject -- "$SENDER"< ./auto/webgate.retrieved

(The last line wrapped; it's actually all one line).

Note that I'm not cleaning up the temporary files so that I can see what
they're doing before they disappear.

This works in a very simple fashion, in that the user gets the raw HTML
of the page returned to them. Files (whether via HTTP or FTP) don't
work, however. They are retrieved into the temp file, and a blank
message is sent.

I noticed that even when a simple HTML page is retrieved, users can't
use HTML-capable email clients to view it. I suspect, although I'm by no
means an expert in this area, that it has to do with sending the
content-type.

Any idea's on how to implement this, and various ways to make it a
little less "open" (such as requiring a magic key in the body, and
restricting by $SENDER) much appreciated.

- Tillman Hodgson



Reply via email to