[thelist] Dynamically 'Piping' the contents of an email account to a web page?

Timothy J. Luoma luomat at operamail.com
Mon Sep 15 18:29:24 CDT 2003


Do you have access to procmail?

Will the email be in HTML (as in the email will have the proper HTML codes 
in it, not that it will be sent as HTML.

If so, I could see doing something like this (note this is meant to be 
basic, so no DOCTYPE etc in the example)

<html>
<head>
<title>My Travels</title>
</head>
<body>

<?php include('mytravels.html'); ?>

</body>
</html>

Then you'd just need a procmail script that would look something like this:

:0
* ^To:.*dfd7fgg6gh5 at mydomain\.com
{
	# Always make a backup
	:0c
	Backup

	# FB = filter body (not headers)
	# cat - = send STDIN to /path/to/mytravels.html
	#
	# NOTE: you might want to do some locking
	# if you were really nervous about 2
	# messages arriving at the same time
	:0 fb
	|cat - >> /path/to/mytravels.html

	# Throw away whatever is left over
	:0
	/dev/null

}

TjL
Procmail lover since 1995



More information about the thelist mailing list