For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > October 2005 > Mail::Audit help plz









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Mail::Audit help plz
Rob

2005-10-26, 6:56 pm

Hi,

I've installed the Mail::Audit (ver 2.1) perl module
to my home directory as non-root user & I get a problem.

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

here's the forward_email:
#!/usr/bin/perl -w

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

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

my $mail = Mail::Audit->new(emergency=>"/home/rob/emergency_mbox");
my $from = $mail->from();
my $to = $mail->to();
my $subject = $mail->subject();
chomp($from, $to, $subject);

open(LOG, ">> /home/rob/mynewmail.log");
print LOG "from is $from";
print LOG "to is $to";
print LOG "subj is $subject";
close(LOG);

$mail->accept('/home/rob/dead.lettters');



However, nothing is written to mynewmail.log. Plus the first line
of the dead.lettters is:
From root@localhost Wed Oct 26 16:06:27 2005
<<and then we have the body of the mail here>>


In addition, this email is sent back to the user:

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@domainname.com

The following text was generated during the delivery attempt:

------ pipe to |/home/rob/bin/forward_email
generated by rob@domainname.com ------

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. ------
<<the headers + body of email is here>>


Has anyone seen this problem? What do you think I should do?

--Rob
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com