http://qs321.pair.com?node_id=502711

blm has asked for the wisdom of the Perl Monks concerning the following question:

Begging your indulgence fellow monks,

I did my own mail filter sorter perlscript using Mail::Audit. For the most part it seems to run fine but every so often I get an email about a returned message because my sortmail.pl script failed to run. The error message:

----- The following addresses had permanent fatal errors ----- |/home/blm/Mail/sortmail.pl (reason: 255) (expanded from: blm) ----- Transcript of session follows ----- Can't locate auto/Mail/Audit/MailInternet/effective_t.al in @INC (@INC + contains: /usr/libdata/perl5/i386-openbsd/5.8.6 /usr/local/libdata/perl5/i386-openbsd/5.8.6 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openb +sd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/sit +e_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl .) at /home/blm/Mail/sortmail.pl line 50 554 5.3.0 unknown mailer error 255

So it seems that I am missing the file effective_t.al

Now I know that I could email the author (still Simon Cozens?) but he is probably busy and I would like to work on the problem myself. I just haven't come across a file to do with perl that ends in .al. Is it something to do with AUTOLOADER? I tried rebuilding Mail::Audit from source and I get no effective_t.al. I tried searching the entire filesystem and google for evidence of this file with no luck.

I have googled with no luck but I am not perfect so the answer could be simple and findable in google. If so I am sorry for wasting time.

Replies are listed 'Best First'.
Re: Mail::Audit and effective_t.al (autoloader--)
by tye (Sage) on Oct 25, 2005 at 19:26 UTC

    You mispelt a method name on "/home/blm/Mail/sortm­ail.pl line 50". Your mispelling starts with "effective_t­". You've been fooled by a very poor error message from autoloader.

    Or, perhaps you didn't strictly mispell it, but you've tried to use a method that doesn't exist for the type of object you tried to use it on (perhaps because it isn't implemented in the version of the module you have installed). (There is a tiny chance that you used the proper method name but your installation is broken such that there really is supposed to be an effective_t.al but it is missing; but the odds of that are quite small in comparison.)

    - tye        

      Actually I think my spelling is fine. The line in question is:

      print BLAH "Effective-Content-Type " . $mail->effective_type . "\n";

      It has been a while since I wrote this. The script runs fine for 98% of the mail I get just two messages a day that I get from the system about security of the box cause the error message that I quoted. So I looked into my I thought $mail->effective_type was valid. My impression of what the documentation say is that $mail is a subclass of Mime::Entity. It turns out that on further reading of the Mail::Audit docos I understand that it is only a subclass of Mime::Entity if appropriate. So basically something about these emails say that it is not appropriate to subclass Mime::Entity so the call to $mail->effective_type is not valid

      If you are wondering why I do

      print BLAH "Effective-Content-Type " . $mail->effective_type . "\n";

      I am trying to work out how to suck all the attachments out of an email and save them in a directory separate from the message

Re: Mail::Audit and effective_t.al
by Tanktalus (Canon) on Oct 25, 2005 at 16:56 UTC

    I would start by looking where a function named "effective_t" is being called in the entire program, including the Mail::Audit module. It may not be obvious, so be thorough - for example, $obj->$func() may be doing it because $func is set based on some mail header or something. If that becomes difficult, perhaps overload AUTOLOAD yourself, and anytime $AUTOLOAD is set to /::effective_t/, croak (with stack traceback). Otherwise, set your parent's $AUTOLOAD, unshift $self back onto @_, and then goto &SUPER::AUTOLOAD (or something like that). It's a bit tricky, but the point is to insert a traceback which may help narrow down where effective_t is being called from.

    Good luck!

      Thanks very much for your reply. This afternoon I will be doing what you say. The function that I am calling is effective_type. See my reply to tye as to what I have found so far. Thanks again.