Skip to content

Instantly share code, notes, and snippets.

@willert
Created March 29, 2010 08:32
Show Gist options
  • Select an option

  • Save willert/347603 to your computer and use it in GitHub Desktop.

Select an option

Save willert/347603 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Mail::Box::Mbox;
use Encode;
use open ':std' => ':utf8';
my $inbox = Mail::Box::Mbox->new(
access => 'rw',
folder => '/var/mail/willert',
lock_type => 'NONE',
);
my @messages = $inbox->messages;
my $i = 0;
for ( @messages ) {
$_->head->set( 'X-Export-Status' => '1' )
unless $_->head->get('X-Export-Status') or $i++;
printf STDERR "Subject: %s [%s]\n", $_->subject,
$_->head->get('X-Export-Status') || 'N/A';
}
$inbox->close;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment