object oriented module help
- From: Rob <me@xxxxxxxxxxx>
- Date: Sat, 29 Oct 2005 21:13:29 GMT
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@xxxxxxxxxxThe 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.... .
- Prev by Date: MSAccess Problem solved (was RE: Simultaneous access: Perl (DBD::ODBC) and C# (ODBC))
- Next by Date: Re: Perl/sh/bash scripts and emacs
- Previous by thread: Re: Perl/sh/bash scripts and emacs
- Next by thread: ftp script in perl
- Index(es):
Relevant Pages
|