stash page as header
authorDavid Bremner <bremner@unb.ca>
Sat, 19 Jul 2008 23:10:40 +0000 (20:10 -0300)
committerDavid Bremner <bremner@unb.ca>
Sat, 19 Jul 2008 23:10:40 +0000 (20:10 -0300)
filters/postal-filer.pl

index ac5a3a7c2f50f734679a13441e7953c2a81c9c46..0435151411c10827b31bea56eaab51441225aa29 100644 (file)
@@ -17,14 +17,22 @@ die "configuration file is mandatory" unless ($config_file);
 
 my %config=IkiWiki::Setup::load($config_file);
 
-my $maildir=$config{postal_maildir};
-my $prefix=$config{postal_prefix};
+my $maildir=$config{postal_maildir} || die "maildir not set";
+
+my $prefix=$config{postal_prefix} || die "prefix not set";
 
 $mail=Email::Filter->new(emergency => $maildir);
 
 my $to=$mail->to;
 if ($to =~ m/$prefix($Convert::YText::valid_rex)/){
     my $key=decode_ytext($1);
-    print $key;
+
+    print $key,"\n";
+    $mail->simple->header_set('X-IkiPostal-Key',$key);
+
+    my @path=split(qr{/},$key);
+
 };
 
+$mail->accept("testbox");