Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 23 lines (16 sloc) 0.427 kb
#!/usr/bin/perl -w
# Read an mbox, and spit out sql statements for adding from address to optout
use strict;
use Mail::Address;
use Data::Dumper;
while(<>) {
next if !m/^From: (.*)/;
$_= $1;
next if m/pmreply\@petitions.pm.gov.uk/;
($_) = Mail::Address->parse($1);
$_ = $_->address();
next if !m/\@/;
next if m/'/;
next if m/"/;
print "insert into optout (email) values ('$_'); \n";
}
Jump to Line
Something went wrong with that request. Please try again.