/[scripts]/trunk/re-bounce.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/re-bounce.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (hide annotations)
Thu Jan 17 17:05:45 2008 UTC (16 years, 3 months ago) by dpavlin
File MIME type: text/plain
File size: 808 byte(s)
old script from 2006 to re-send bounces from postmaster

1 dpavlin 58 #!/usr/bin/perl -w
2    
3     # re-bounce message from mbox
4     #
5     # Dobrica Pavlinusic <dpavlin@rot13.org>
6    
7     use strict;
8    
9     use Email::Folder::Mbox;
10     use Email::MIME::Attachment::Stripper;
11     use Email::Send;
12     use Data::Dumper;
13    
14     my $mbox = shift || die "usage: $0 mbox_with_bounces\n";
15     my $smtp_server = shift || 'dmz1.pliva.hr';
16    
17     my $box = new Email::Folder::Mbox($mbox) || die "can't open folder $mbox: $!";
18    
19     print "working on $mbox\n";
20    
21     while ( my $mail = $box->next_message ) {
22    
23     my $stripper = Email::MIME::Attachment::Stripper->new($mail);
24    
25     if (! $stripper) {
26     warn "WARNING: can't parse message:\n$mail\n";
27     next;
28     }
29    
30     foreach my $att ( $stripper->attachments ) {
31     if ($att->{content_type} eq 'message/rfc822') {
32     #print $att->{payload},"\n", '-' x 76, "\n";
33     send SMTP => $att->{payload}, $smtp_server;
34     }
35     }
36    
37     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26