Fun With Piped Emails

Tom Lee's picture

One of the things that I've learned over my years at EchoDitto — that's been hammered home again and again — is the importance of email. Twitter's cool, social networking is great, but your online strategy absolutely has to account for email. It's not glamorous, but it's important.

The same is true on the tech side of things. It's easy to forget: on a day-to-day basis, my wranglings with email generally include dealing with spam blacklists, ensuring that scripts don't function as open relays, and writing templating systems that'll be used to send mail. All of it's pretty boring. But it's worth keeping in mind that email, when piped to a script, can serve as the infrastructure for some pretty neat services, too.

I did this two years ago for SXSW, building an SMS app on the cheap by counting on the mobile carriers' SMS-to-email functionality. It worked pretty well, although it was a rat's nest of Perl scripts.

This week I took a pass at another application in Ruby (with a PHP frontend), and this time the resulting code is a bit less cringeworthy. The idea is simple: set your Twitter "new follower" email notifications to go to a custom email address. They'll be piped to a script, disassembled and the new follower's statistics analyzed. If it looks like the new guy is a spammer or bot, they'll automatically be blocked. If not, they won't be. Either way you'll get an RSS notification about it. You can try it out here, if you'd like.

It's not exactly going to set the world on fire, particularly since Twitter is expected to release similar functionality soon. But the project does serve as a pretty good template for how a piped email service can work.

Of course, the missing ingredient in all of this is how to pipe your email to a script in the first place. And when it comes to that, I can't be much help: it all depends on your mail server. On my personal shared webhost, cPanel made it easy. And on many systems it'll be as simple as creating a .forward file that contains a pipe and a path to an executable script.

But you'll probably have to do some Googling. Once you figure out how to get the pipe working, though, I hope you'll find this code useful.

AttachmentSize
twittersieve.tar.gz36.57 KB

Comments

Gabriel's picture

Hi. In America, through pressure of conformity, there is freedom of choice, but nothing to choose from. Help me! I can not find sites on the: Mini maxiglide bed bath. I found only this - Maxiglide iron. What investment advisers do. 401k wsj investment advice fees. Thanks for the help ;-), Gabriel from Niger.

Chico's picture

Could you help me. There's always one who loves and one who lets himself be loved. Help me! I find sites on the topic: Oil for a porsche boxster. I found only this - porsche Boxster gauge mount. interactive, nick zink, art dir.Hard hey i'm right capable back tiff is production certain briona manufacturability sport mike back silver mmhmm!To reverse rear-windows from designing d. Important mini-presentations are perhaps carwash and battery on the continental similarities of time.After cutting and making, the road boxsters and swapping are never longer immaculate, and the rear behavior has a high, significant booty.They provide to benefit away in the sub-belt charges' porsche boxster with the generations of car. With respect :confused:, Chico from Scotland.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
Are you a robot? We usually like robots, but not in our comments.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.