Dave Currie’s weblog on Technology, Programming, Thoughts and Ideas

imap2rss.php

I like the idea of using blogs in the workplace as a way of keeping others informed of important or interesting facts, thus substituting the infamous email sent to the entire company. Unfortunately, I also think that unless everyone in the company is a serious blogger, you’re going to find some resistance to migrating towards blogs, especially if they don’t have a first-hand way of seeing the benefits of this approach.

I think that part of the problem resides in the complication of introducing blog software to people who have never even thought about blogging before. They just won’t see the advantage of using this software.

Thinking about this, I came up with the idea of meeting people half-way. A good way of doing this would be to remain doing things the old way, that is, using email to share interesting content. The difference would be that instead of sending these emails personally to everyone concerned, you can create one or several mailboxes specifically for holding this content.

The other difference is that instead of receiving these mails in their email inbox, the content would be viewed in an aggregator. Of course, the introduction of a new piece of software can be met with some resistance, but now that most email clients are able to understand RSS in some fashion, using these feeds is just a matter of adding another folder to the mail client in question.

I’ve put it online at http://www.noaxs.net/imap2rss/. Hopefully it can be of some use to someone else.

Update: I changed the download link because it was giving some people problems.

12 Responses to “imap2rss.php”

Moderation Active: Old stuff here... Therefore your comment on this post will be moderated (i.e. don't submit twice !)
  1. Alex B Says:

    download archive seems broken…
    Thanks

    Alex

  2. Alex B Says:

    download archive seems broken…
    Thanks

    Alex

  3. Dave Currie Says:

    Alex, I’ve changed the link, see if it works for you now.

    Dave

  4. Dave Currie Says:

    Alex, I’ve changed the link, see if it works for you now.

    Dave

  5. torgeir Says:

    I’ve just found this on freshmeat and must say I really like it. I’ve given it a test drive and run into the following error :

    ———————
    XML Parsing Error: undefined entity
    Location: http://***************/imap.php
    Line Number 399, Column 48:har lagt ved log4php i arkivet, men trenger også PEAR::Config.php
    ———————

    the letter it stopping on is the Norwegian “å”

    :torgeir

  6. torgeir Says:

    I’ve just found this on freshmeat and must say I really like it. I’ve given it a test drive and run into the following error :

    ———————
    XML Parsing Error: undefined entity
    Location: http://***************/imap.php
    Line Number 399, Column 48:har lagt ved log4php i arkivet, men trenger også PEAR::Config.php
    ———————

    the letter it stopping on is the Norwegian “å”

    :torgeir

  7. randy Says:

    Quite a good idea.

    Consider for linking (had problems with email addresses with periods in them):

    function renderPlainText($str) {
    $str =eregi_replace(”(([[:alnum:]]+://)|www\.)([^[:space:]]*)([[:alnum:]#?/&=])”, “\\1\\3\\4“, $str); // link URLS
    $str = eregi_replace(”href=\”www”,”href=\”http://www”, $str);// fix lazy URLs
    $str = eregi_replace(”(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))”, “\\1“, $str); // link mailtos
    $str = preg_replace(”/>(([[:alnum:]]+:\/\/)|www\.)([^[:space:]]{30,40})([^[:space:]]*)([^[:space:]]{10,20})([[:alnum:]#?\/&=])\\1\\3…\\5\\6<", $str); // truncate long urls that can cause display problems
    $str = stripslashes($str);
    $str = nl2br($str);// Throw in
    tags
    return $str;
    }

  8. randy Says:

    Quite a good idea.

    Consider for linking (had problems with email addresses with periods in them):

    function renderPlainText($str) {
    $str =eregi_replace(”(([[:alnum:]]+://)|www\.)([^[:space:]]*)([[:alnum:]#?/&=])”, “\\1\\3\\4“, $str); // link URLS
    $str = eregi_replace(”href=\”www”,”href=\”http://www”, $str);// fix lazy URLs
    $str = eregi_replace(”(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))”, “\\1“, $str); // link mailtos
    $str = preg_replace(”/>(([[:alnum:]]+:\/\/)|www\.)([^[:space:]]{30,40})([^[:space:]]*)([^[:space:]]{10,20})([[:alnum:]#?\/&=])\\1\\3…\\5\\6<", $str); // truncate long urls that can cause display problems
    $str = stripslashes($str);
    $str = nl2br($str);// Throw in
    tags
    return $str;
    }

  9. Philipp Keller Says:

    Thank you very much for the imap2rss!
    We have it running in our local Feedonfeeds installation. It runs pretty good!
    Now what was a problem was the encoding. Although the server served the rss as “application/xml” the feed has done some problems with German umlaut (ä, ö, ü) and so on.. I tried to fix that but it doesn’t work.
    We disabled the mail body for now..

  10. Philipp Keller Says:

    Thank you very much for the imap2rss!
    We have it running in our local Feedonfeeds installation. It runs pretty good!
    Now what was a problem was the encoding. Although the server served the rss as “application/xml” the feed has done some problems with German umlaut (ä, ö, ü) and so on.. I tried to fix that but it doesn’t work.
    We disabled the mail body for now..

  11. Martin Says:

    @Philipp Keller:

    use the php function “mb_decode_mimeheader()” to convert Umlaute just where the script accesses subject and author.

  12. Étienne Says:

    Hi Dave,

    Thanks for this nice application. I use it along with google custom homepage to bypass my company’s policy that prevents us to check our personal mails at work ;)

    Encoding was also an issue for french language, but Martin’s tip to use mb_decode_mimeheader mostly solved it, so everything’s fine !

    Cheers !
    Étienne

Leave a Reply

authimage