object oriented module help



Hi,

In this case, my objective is to read incoming emails, parse
them by To,From,Subject,Body & store them in a dbase. That's it.

I've installed a local copy of Mail::Audit and it seems
to partially fail....well here:

here's my .forward:
|/home/rob/bin/forward_email

here's my forward_email:

#!/usr/bin/perl -w

BEGIN{
 unshift @INC, '/home/rob/lib/lib/perl5/site_perl/5.8.3';
 unshift @INC, '/home/rob/lib/lib/perl5/5.8.3'
}

$\ = "\n";
select(STDERR); $| = 1;
select(STDOUT); $| = 1;
use warnings;
use Mail::Audit;


$self = Mail::Audit->new(emergency=>"/home/rob/emergency_mbox",log=>"/home/rob/audit.log",loglevel
=>4);
$from = $self->from();
$to = $self->to();
@too = @{$to};
$subject = $self->subject();
@body = @{$self->body};
#chomp($from, $to, $subject);


open(FILE, ">> /home/rob/mynewmail.log");
    print FILE "from is $from;$self";
    print FILE "to   is $to;@too";
    print FILE "subj is $subject";
    print FILE "body is @body";
close(FILE);

$self->accept('/dev/null');


The only thing that prints in mynewmail.log is: from is ; to is subj is hdr is body is This September<and the full body>


The odd thing is it prints the headers in audit.log. Plus it sends a reply back that:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  pipe to |/home/rob/bin/forward_email
    generated by rob@xxxxxxxxxx

The following text was generated during the delivery attempt:

------ pipe to |/home/rob/bin/forward_email
       generated by rob@xxxxxxxxxx ------

Use of uninitialized value in pattern match (m//) at /home/rob/lib/lib/perl5/site_perl/5.8.3/Mail/Audit.pm line 431.

------ This is a copy of the message, including all the headers. ------



Am I missing something?
....thanx for any reply....
.



Relevant Pages

  • Re: help with awk command in perl
    ... use strict; ... use warnings; ... my @vob_list1 = `$CT lsvob`; ... print FILE @vob_list1; ...
    (perl.beginners)
  • Re: help with awk command in perl
    ... use strict; ... use warnings; ... my @vob_list1 = `$CT lsvob`; ... print FILE @vob_list1; ...
    (perl.beginners)
  • Proper output
    ... # Perl script to change the replica name ... use strict; ... use warnings; ... print FILE @vob_list; ...
    (perl.beginners)
  • Re: file help
    ... Sayed, Irfan wrote: ... use warnings; ... foreach ... print FILE while; ...
    (perl.beginners)
  • Re: Page counter error from Unix/Linux to Windows 2000 queue
    ... Your only options are to parse the print file to calculate the number of ... All it's ok BUT windows doesn't know jobs size ... > I try with a Raw and LPR policy, ...
    (microsoft.public.win2000.printing)