Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

2shortplanks (968)

2shortplanks
  (email not shown publicly)
http://2shortplanks.com/
AOL IM: trelane2sp (Add Buddy, Send Message)
Yahoo! ID: trelane2sp (Add User, Send Message)

Mark Fowler has never been the same since he was elected leader of the London Perl Mongers. The strain manifests itself mainly in releasing various [cpan.org] modules [cpan.org] to CPAN, giving talks [2shortplanks.com], and use of the Trelane nick on #london.pm for endless procrastination. Doctors are still seeking a cure.
Sunday August 19, 2001
04:51 PM

Mail Filtering and Camels

[ #677 ]
I've been playing around with my mail filtering some more a lot recently. This is based on Simon's Mail::Audit module. Mail filtering in Perl is a risky business. One typo and your mail is assigned to oblivion. So I’ve been mailing learning to program very defensively. For example, the whole of my code is placed in a string eval so if it fails to compile some reason (like, I'm coding lamely again) then the code can at least panic and dump the mail in my inbox rather than bouncing the mail back as undeliverable to the sender.

So, delivering mail with Perl may be really crazy, but you can do really cool things with it. For example, whenever I register for a site I give them a reply address that is unique to them at 2shortplanks.com so when they start spamming me I can filter this off with a rule. Of course, you can do this with any mail filtering, but I’m feeling lazy (like all good Perl programmers); I have an address I can forward a mail to which will then add the address that the forwarded mail was sent to to my kill list. And an address that will cause the address sent from to be killed. And an address that will cause all mail from or to people to forever more be moved into another mail folder. So now I don’t ever edit my mail filter again. Yey. But wait…it gets better.

I have a rule set up that allows me to use the ‘one-day-only’ mail at 2shortplanks. These are of the format thingDDMMYY@twoshortplanks.com, and it only lets though mail for that one day. This is great for site registration and stuff where you just want a username and password, but you don’t want them spamming you for the rest of eternity. Isn’t Perl cool.

Oh, and as I was mucking about in Perl I implemented a quick hack to create a XML RSS document containing the name of the last person to post to the London Perl Mongers mailing list (try doing that in procmail) so that dipsy (the #London.pm infobot) can tell you this information.

Gah. All coded out now. See the filter for yourself at http://2shortplanks.com/temp/mailfilter.txt

What have us Perl lot been up to that doesn't involve coding? Well, we went and saw the camel at London Zoo yesterday. At least I assume we saw the camel that the London Perl Mongers sponsored…there were three and my ability to identify camels from one another is similar to my ability to program Python! In fact, we saw lots of other Perl and Open Source creatures. The llamas, the monkeys, owls, and the obligatory penguins. Oh, then we went to the pub.