in reply to Filtering mail attachments
Have you looked at Mail::MboxParser? It seems from the examples that you could open the users mbox, extract everything except the attachments, and then forward.
#!/usr/bin/perl use Mail::MboxParser; $mbox= 'var/spool/mail/zentara'; my $mb = Mail::MboxParser->new($mbox, decode => 'ALL'); # slurping for my $msg ($mb->get_messages) { print "###########################################################\n"; print $msg->header->{subject}, "\n"; print $msg->header->{from}, "\n"; print "###########################################################\n"; #$msg->store_all_attachments('tmp'); my ($body) = $msg->body($msg->find_body,0); print ($body->as_string); print "###########################################################\n"; } # we forgot to do something with the messages $mb->rewind; while (my $msg = $mb->next_message) { # iterate again # ... }
|
|---|