From: David Bremner Date: Sat, 21 Jun 2008 06:50:17 +0000 (+0200) Subject: initial address decoder filter X-Git-Tag: 0.1~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1ebb614f33304d4e2fd4c53643642409d70b171;p=ikiwiki.git initial address decoder filter --- diff --git a/filters/expand-iki-address.pl b/filters/expand-iki-address.pl new file mode 100644 index 000000000..a11e6d9d0 --- /dev/null +++ b/filters/expand-iki-address.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use Mail::Internet; +use Compress::LZF ; +use MIME::Base64::URLSafe; + +my $prefix="-comment-"; +my $mail = Mail::Internet->new([<>]); + +my $to = $mail->get('To:'); + +if ($to =~ m/$prefix([A-Za-z0-9\-_]+)\@/){ + my $key=$1; + my $page=decompress(urlsafe_b64decode($key)); + $mail->replace('X-IkiWiki-Page:',$page); +} + +$mail->print(\*STDOUT); + + diff --git a/filters/test1.eml b/filters/test1.eml new file mode 100644 index 000000000..2dde8a351 --- /dev/null +++ b/filters/test1.eml @@ -0,0 +1,14 @@ +From: David Bremner +To: bremner-comment-AHNpdGVtYXA@mailhost.imaginary.org +Subject: I hate your sitemap +Fcc: %sent-mail +User-Agent: EMIKO/1.14.1 (Choanoflagellata) FLIM/1.14.9 (=?ISO-8859-4?Q?Go?= + =?ISO-8859-4?Q?j=F2?=) APEL/10.7 EasyPG/0.0.15 Emacs/22.2 + (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) +MIME-Version: 1.0 (generated by EMIKO 1.14.1 - "Choanoflagellata") +Content-Type: text/plain; charset=US-ASCII + + +It is stupid. + +Why don't you put more work into your blog?