MailFeed

MailFeed is a PHP script that checks a POP3, IMAP, or NNTP mailbox on demand and returns an RSS feed containing the messages in the mailbox (including message bodies, if desired).

I wrote MailFeed after realizing that it would be convenient to read my email along with my morning RSS feeds. I find that it’s especially convenient for reading mailing lists.

Note: MailFeed is no longer being actively maintained.

Features

  • Works with any POP3, IMAP, or NNTP server.
  • Supports SSL and TLS for secure connections.
  • Produces standards-compliant RSS 2.0 XML.
  • Optionally retrieves message bodies into the RSS <description> field.
  • Supports multipart MIME messages (i.e., messages with attachments).
  • Integrates with the RSS aggregator of your choice, giving you complete freedom in how you read your email.
  • Lightweight and easy to use.
  • Free!

Requirements

Downloads

Links

Usage

Synopsis

After dropping the MailFeed PHP script somewhere on your web server, you can start retrieving email by browsing to it and specifying options in the URL query string.

You can set these options permanently by editing the MailFeed source code. At a minimum, you need to specify a server to connect to and a username and password to log in with.

Options

Name Example Description
server mail.example.com:143 POP3/IMAP/NNTP server to connect to, with optional port number.
protocol /imap/ssl/novalidate-cert Protocol specification. See PHP‘s documentation on the imap_open function for details on how this should be formatted.
mailbox INBOX Name of the IMAP mailbox to open. This has no effect if you’re using POP3.
username fakeuser Username to use to log into the mail server.
password fakepass Password to use to log into the mail server.
downloadBody 1 Whether or not to download message bodies and display them in the RSS <description> element. Specify 0 or 1.
markSeen 0 Whether or not to mark retrieved messages as seen on the server. Specify 0 or 1.
htmlLineBreaks 1 Whether or not to convert newlines to HTML line breaks in message bodies for display in HTML-based RSS readers. Specify 0 or 1.
bodyMaxLength 4096 If the message body is longer than this number of bytes, it will be trimmed. Set to 0 for no limit.

Example

http://www.example.com/mailfeed.php?server=mail.example.com:143&username=fakeuser&password=fakepass

Security Warning

If you decide to pass your username and password via URL parameters, be forewarned that this is a security risk. HTTP requests are sent in plain text and most web servers log requested URLs. In addition, the URL may be passed to another server as a referrer.

Be especially careful if you use a web-based RSS aggregator or one that publishes your feed listing publicly.

Copyright

Copyright © 2004 by Ryan Grove. All rights reserved.
MailFeed is open source software distributed under the terms of the GPL