imap2rss.php is a simple PHP application that generates an RSS 2.0 feed from the messages within an IMAP folder. It has the following features:
imap2rss.php is released under the GNU General Public License (GPL) and is copyright (c) 2005 David Currie (dave@noaxs.net).
I've posted a quick summary of my motivation for developing this on my blog.
IMAP2RSS.PHP IS NOT CURRENTLY MAINTAINED
imap2rss.php requires PHP version 4 to run. Installation is simply a matter of renaming the downloaded text file to imap2rss.php and copying it
to the directory in your web server where you wish to make the service available.
Configuration is simply a matter of editing the script and setting the variables defined near the beginning of the script. The possibility exists for one script to use several configurations, and this is covered in the following section.
Usage of imap2rss.php is quite simple. Simply configure it by modifying the necessary variables near the beginning of the file, and to see the result point your news aggregator to the location you installed it in.
To use one installation of imap2rss.php to access several mailboxes, you need to create a file in the same directory that you installed the script in, and
call it <configuration_name>.conf.php. The file should look something like this:
<?php
// Server string for IMAP connection.
// See http://www.php.net/manual/en/function.imap-open.php
// for more details on what this string should look like.
// Hint: Changing "localhost" for your hostname should do it.
$srvStr = "{localhost:143/notls}INBOX";
// IMAP account username
$accountUser = "username";
// IMAP account password
$accountPass = "password";
// Maximum number of messages to include in the feed
// (from newest, 0 for no limit)
$maxMsgNum = 30;
// Title for this feed
$feedTitle = "imap2rss.php Feed";
// Feed description
$feedDesc = "Sample description";
// Feed language
$feedLang = "en-gb";
// Feed editor's name
$feedEditor = "Feed Editor";
// Feed editor's email
$feedEditorMail = "editor@example.net";
// General Options
// Munge sender emails - 1 for yes, 0 for no
$mungeSenderEmail = 0;
// Make http addresses links in plain-text emails
$makeHttpLinks = 1;
// Make email addresses mailto: links in plain-text emails
$makeMailtoLinks = 1;
?>
Once you have configured this, you can call imap2rss.php with an additional parameter passed to the script, conf, which should be set
to whatever you called the configuration. For example, if your configuration file is called mycfg.conf.php, the url would look like
http://yourserver/imap2rss.php?conf=mycfg.
If you have problems hooking up to your IMAP server, read the page referred to near the beginning of the file. Correct configuration for your IMAP server can be tricky.
Software is always a work-in-progress. This is what I'm currently thinking would be needed.