[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Making 'MD5' Object File.



My original post on 'comp.lang.perl.modules'

----- original Post starts here -----

I have written the following:

----- Code starts here -----

#!perl #-w              # the Hash is purposely added before '-w'

# First Time attemp to use Mail::POP3 Object Methods.
# 08.10.1999 Samuel J. W. Leidy

use strict;
use Mail::POP3Client;

my ($myUserID) = "USER"; # Enter a valid User ID in place of USER.
my ($myPassword) = "PASS"; #Enter a valid Users Password in place of
PASS.
my ($myPopMail) = "POP"; # Enter a valid POP Mail Account in place of
POP.

my ($pop, $num_Of_Messages, $i, $port, $socket, $state, $user, $pass,
$last, $size, @list);

print ("\nAttempting Connection....");
$pop = Mail::POP3Client->new($myUserID, $myPassword);

    $state = $pop->State;                   # State of Connection.
    print ("\nState of Connection: " . $state . "\n");

$port = $pop->Port;     # Port

$pop->Connect($myPopMail, $port);

    $state = $pop->State;                   # State of Connection.
    print ("\nState of Connection: " . $state . "\n");

#$pop->Login();
#$pop->User($myUserID);
#$pop->Pass($myPassword);

if ($pop->Alive()){

    print ("\nConnection is 'alive'!\n");

    $state = $pop->State;                   # State of Connection.
    print ("State of Connection: " . $state . "\n");

    $num_Of_Messages = $pop->Count; # Number of Messages
    print ("\nNumber of Messages: " . $num_Of_Messages . "\n");

    print ("Port: " . $port . "\n");

    $socket = $pop->Socket;                 # Socket.
    print ("Socket: " . $socket . "\n");

    $user = $pop->User;                 # User.
    print ("User: " . $user . "\n");

    $pass = $pop->Pass;                 # Password.
    print ("Password: " . $pass . "\n");

    $last = $pop->Last;                 # Last Number of Messages.
    print ("Last Number of Messages: " . $last . "\n");

    $size = $pop->Size;                 # Mailbox Size.
    print ("Mailbox Size: " . $size . "\n");

    @list = $pop->List;                 # List Size.
    #print ("List Size: " . $list . " Bytes.\n");

    for ($i = 1; $i <= $num_Of_Messages; $i++){
        foreach ($pop->Head($i)) {
    #       print $_ ."  " if /^(From|Subject)/;
            print $pop->HeadAndBody($i);
        }
        print "\n";
    }
}
else{
    print ("\nConnection was not 'alive'!\n");
    print ("\a");           # Sound the Beep to get Users attention.
}

print ("Finished.\n");

----- Code ends here -----

Results of running the above Code:

----- Results starts here -----

Attempting Connection....
State of Connection: DEAD

Connection is 'alive'!
State of Connection: AUTHORIZATION

Number of Messages: -1
Port: 110
Socket: Mail::POP3Client::SOCK0
User: ----- My User ID is printed correctly here -----
Password: ----- My Password is printed correctly here -----
Last Number of Messages:
Mailbox Size: -1
Finished.

----- Results ends here -----

As one can see from the 'Source Code' I even tried, and 'commented out':
#$pop->Login();
#$pop->User($myUserID);
#$pop->Pass($myPassword);

Using these Object Methods made not difference.

Question(s):
I have many e-Mail Messages sitting on the Server - so why am I
receiving a 'Number of Messages: -1 Reply?

Am I actually conversing with the Server at all?

What am I obviously missing from the above 'Source Code' to make it
actually work?


Please do not just Reply - try 'MacPerl ListServers'...

-----

System:
Macintosh IIci,
MacOS 7.6.1,
98+ MB RAM,
3 GB+ Storage,

MacPerl:
MacPerl [cfm68k] Version 5.20r4.

Perl Sources:
'Perl 5 for Dummies',
'CGI Programming with Perl 5',
'The PERL CD Bookshelf' - ['Perl in a Nutshell', 'Programming Perl',
'Perl Cookbook', 'Advanced Perl Programming', 'Learning Perl', 'Learning
Perl on Win32 Systems (gag, gag, cough cough - only kidding!)]

-----

Any guidance is appreciated,

Samuel

----- original Post ends here -----


I received the following Reply:

----- Reply starts here -----

Get version 2.2.  It fixes this problem for MacPerl (having to do with
extra CRs sitting on the socket connection, causing matches to fail).

It should be on CPAN soon.  If you can't wait, you can grab it from
http://www.dowds.net/POP3Client

----- Reply ends here -----

I did download 'POP3Client.tar.gz' and after de-encoding and
de-compressing it I placed only the newly created 'POP3Client.pm' into
the 'lib:Mail' Folder as per 'Choice 2' in the accompanying 'README'
File.

----- 'Choice 2' reprinted - starts here -----

Or you can create a directory called Mail somewhere and just put
POP3Client.pm in there.  You will then have to put this directory into
your include path (@INC) either on the command line or in you code
(i.e. push(@INC,"/path/to/directory"); ).  You need to include the
directory above Mail.

----- 'Choice 2' reprinted - ends here -----


However, the new 'POP3Client' requires 'MD5'.  Inside the new
'POP3Client.pm' File is a 'require MD5' Statement.

I found, on the 'MacPerl Power and Ease' CD-ROM Disk, a few Folders
whose titles began with 'MD5'. I chose the one titled 'MD5-1.7' and
dragged it to the 'ext' Folder - which is located in the 'MacPerl
<option>-f' Folder where my 'MacPerl', 'MacPerl [Big]', and 'MacPerl
[CFM68k]' Applications reside.
I use the 'CFM68K' Version of MacPerl.

I then renamed the Folder from 'MD5-1.7' to 'MD5'.

This is from the 'README' File in the 'MD5' Folder:

----- README File Instructions starts here -----

To build the extension, unpack this distribution under the ext/
directory of your Perl source distribution, create the Makefile using
'perl Makefile.PL' and do a 'make'.

----- README File Instructions ends here -----


When trying to 'Run' the 'MD5' supplied 'MakeFile.PL' File 'MacPerl
[CFM68K]' reports:

----- MacPerl [CFM68K] Report starts here -----

Checking if your kit is complete...
Looks good
# On MacOS, we need to build under the Perl source directory or have the
MacPerl SDK installed in the MacPerl folder.

----- MacPerl [CFM68K] Report ends here -----


Naturally, without the 'MD5' Object File I cannot run the new
'POP3Client.pm' File.

--------

Question(s):
Question 01:
What do I do now? - with respect to 'make'ing 'MD5'.... and where does
the created File go?

Question 02:
Is not the 'MacPerl <option>-f' [Please read <option>-f as the fancy 'f'
created when the <option> Key is pressed and the 'F' Key tap'ed] Folder
the 'Perl source distribution' Folder? - as per the '----- MacPerl
[CFM68K] Report...' states above?  I did drag the 'POP3Client' Folder to
the 'MacPerl <option>-f' and tried 'Choice 1' there, with no success.
See the above '----- MacPerl [CFM68K] Report...' for what was displayed.
That is why I just dragged the new 'POP3Client.pm' File to the
'lib:Mail' Folder.
I even dragged all the Files in the 'MD5-1.7' Folder into the 'MacPerl
<option>-f' Folder and tried running the respective 'MakeFile.PL' File; no
success!

Note: I created an "Old '.pm's" Folder in the 'MacPerl <option>-f'
Folder.  In it I created a 'lib' Folder. In it a 'Mail' Folder. In which
I placed my origianl 'POP3Client.pm' File.  Now I have a Place to
relocate old '.pm' Files - mirroring where they came from.... just in
case I need them again.

Question 03:
Nowhere on the 'MacPerl Power and Ease' CD-ROM Disk is a 'MacPerl SDK'
File or Folder. [Please see '----- MacPerl [CFM68K] Report....' above].
Nor any places on the Internet I tried, with repect to 'MacPerl' did I
find a 'MacPerl SDK'.  Can you supply any Information [a WebSite, Book,
CD-ROM...] as to where such ['MacPerl SDK'] exists?


Any assistance is greatfully appreciated,

Samuel

P.S. I have had success in sending e-Mail with 'Net::SMTP'!



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org