Mail::Audit help plz

Discussion in 'Perl Misc' started by Rob, Oct 27, 2005.

  1. Rob

    Rob Guest

    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

    The following text was generated during the delivery attempt:

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

    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
    Rob, Oct 27, 2005
    #1
    1. Advertising

  2. Rob

    Guest

    Rob wrote:
    > use Mail::Audit;
    > my $mail = Mail::Audit->new(emergency=>"/home/rob/emergency_mbox");
    > my $from = $mail->from();


    You created a brand-new $mail object. When did you think the "from" (or
    other) method would get a value? Did you mean to say something like:
    $mail->from($from); #assuming $from has a value
    >
    > However, nothing is written to mynewmail.log.


    NOTHING is written? Or do you mean you get stuff like:
    from is
    to is
    subj is
    with nothing behind it (which is what I would expect, since you never
    passed any values to the object).
    , Oct 27, 2005
    #2
    1. Advertising

  3. Rob

    Rob Guest

    Sorry, by nothing I meant the values in the variables are empty....
    otherwise, yes, mynewmail.log file is created with:
    from is
    to is
    subject is

    I could not find good documentation on the module to know
    if $mail = Mail::Audit->new() would creates a new blank object
    or reads the incoming mail as new object?


    My objective is to read incoming data & store it
    in dbase by from, to, subject, body.....thanx.....

    --Rob


    wrote:
    > Rob wrote:
    >
    >>use Mail::Audit;
    >>my $mail = Mail::Audit->new(emergency=>"/home/rob/emergency_mbox");
    >>my $from = $mail->from();

    >
    >
    > You created a brand-new $mail object. When did you think the "from" (or
    > other) method would get a value? Did you mean to say something like:
    > $mail->from($from); #assuming $from has a value
    >
    >>However, nothing is written to mynewmail.log.

    >
    >
    > NOTHING is written? Or do you mean you get stuff like:
    > from is
    > to is
    > subj is
    > with nothing behind it (which is what I would expect, since you never
    > passed any values to the object).
    >
    Rob, Oct 27, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    377
  2. Replies:
    2
    Views:
    334
    Nick Keighley
    Nov 24, 2006
  3. Mark Wood-Patrick

    problem using Mail::Audit::Attach under cygwin

    Mark Wood-Patrick, Nov 8, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    121
    Mark Wood-Patrick
    Nov 8, 2003
  4. Ed Mansouri

    Mail::Audit::Attach

    Ed Mansouri, Feb 6, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    88
    Ed Mansouri
    Feb 6, 2004
  5. Replies:
    3
    Views:
    95
    Peter J. Holzer
    Apr 22, 2006
Loading...

Share This Page