Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I have recently hacked at Exchange 2000/2003 to make SpamAssassin work with it via an EventSink, obviously on a Win32 platform.

Now that I have it working, I want to run some stats on the amount of spam that each user is getting.

The code I have written to run the stats all works... sort of - I narrowed down my issue to the issue being with the Mail::Internet code. I looked around on PerlMonks as well as on O'Reilly ( and found various usage examples.

When I try the code that I have below as an example (in "readmore" tags), I just get no response at all. No errors, but no output either (if I add in print statements in there just to see if they are getting hit, they do - just nothing that is related to the Mail::Internet. And yes, there are definitely a lot of files in that directory that it is trying to read, and it is seeing them.).

I am on Win2K SP3, running ActiveState Perl (v5.6.1). If I run PPM and do a query Mail, I get:
Email-Find (0.09) Find RFC 822 email addresses in plain text
Email-Valid (0.14) Check validity of Internet email addresses
MailTools (1.58) Various Mail related modules

are there known issues with MailTools under Win32? or am I doing anything obviously wrong in the code below?
use strict; use Mail::Internet; use Mail::Header; #variable declaration my $strSpamDir = 'D:/spam/SPAM_FINAL'; my $file; my $mail; opendir SPAM_DIR, $strSpamDir or die "could not opendir $strSpamDir:$! +\n"; foreach $file (readdir SPAM_DIR){ if($file ne '.' && $file ne '..'){ open(MY_FILE, "$strSpamDir/$file") or die "could not open the +file $strSpamDir/$file:$!\n"; $mail = Mail::Internet->new(\*MY_FILE); $mail->print_header(); close(MY_FILE) or die "could not close $strSpamDir/$file:$!\n" +; } } closedir SPAM_DIR;

There are some odd things afoot now, in the Villa Straylight.

In reply to Mail::Internet on Win32? by AssFace

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2022-05-24 12:35 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (82 votes). Check out past polls.