Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl as email client

Reply
Thread Tools

perl as email client

 
 
Larry Gates
Guest
Posts: n/a
 
      03-06-2009


I've used perl as a usenet client before, but now that I have a site out
there with an email address that is supposed to get to me, and I wanted to
look at it through the rubric of perl.

How would a person use perl to simulate what OE does?

What activestate modules are required for a given method? I would have to
think there would be as many ways to do this in perl as building a wall for
a carpenter.
--
larry gates

Chip Salzenberg sent me a complete patch to add System V IPC (msg, sem and
shm calls), so I added them. If that bothers you, you can always undefine
them in config.sh. -- Larry Wall in <(E-Mail Removed)>
 
Reply With Quote
 
 
 
 
Peter Wyzl
Guest
Posts: n/a
 
      03-06-2009
"Larry Gates" <(E-Mail Removed)> wrote in message
news:r1gfh4xu6pwi.11rqztaxprs4$(E-Mail Removed)...
>
>
> I've used perl as a usenet client before, but now that I have a site out
> there with an email address that is supposed to get to me, and I wanted to
> look at it through the rubric of perl.
>
> How would a person use perl to simulate what OE does?
>
> What activestate modules are required for a given method? I would have to
> think there would be as many ways to do this in perl as building a wall
> for
> a carpenter.


Anything with POP3 in it would be a starting point. But Perl is a language,
not a usenet client -- you mean you wrote a usenet client in Perl.

You can do POP3 with a telnet client if you wish, which would be a good
place to start how e-mail clients commincate with the servers.

P


 
Reply With Quote
 
 
 
 
Tim Greer
Guest
Posts: n/a
 
      03-06-2009
Larry Gates wrote:

>
>
> I've used perl as a usenet client before, but now that I have a site
> out there with an email address that is supposed to get to me, and I
> wanted to look at it through the rubric of perl.
>
> How would a person use perl to simulate what OE does?
>
> What activestate modules are required for a given method? I would
> have to think there would be as many ways to do this in perl as
> building a wall for a carpenter.


I believe you mean that you've used a usenet client coded in Perl.
Someone asked a similar question a month or two ago, and then stated
they wanted to actually do something else in the end. I assume you
mean exactly what your subject says, and that you want to use Perl to
code an email client? I don't know of any, but it's certainly
possible. I don't know where to suggest you start for Windows (using
ActiveState) though.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
Larry Gates
Guest
Posts: n/a
 
      03-07-2009
On Fri, 06 Mar 2009 09:59:49 -0800, Tim Greer wrote:

> Larry Gates wrote:
>
>>
>>
>> I've used perl as a usenet client before, but now that I have a site
>> out there with an email address that is supposed to get to me, and I
>> wanted to look at it through the rubric of perl.
>>
>> How would a person use perl to simulate what OE does?
>>
>> What activestate modules are required for a given method? I would
>> have to think there would be as many ways to do this in perl as
>> building a wall for a carpenter.

>
> I believe you mean that you've used a usenet client coded in Perl.
> Someone asked a similar question a month or two ago, and then stated
> they wanted to actually do something else in the end. I assume you
> mean exactly what your subject says, and that you want to use Perl to
> code an email client?


Yeah.
> I don't know of any, but it's certainly
> possible. I don't know where to suggest you start for Windows (using
> ActiveState) though.


Gosh, I would have thought that writing an e-mail client in perl would be
as commonplace as ways to calculate pi with fortran.
--
larry gates

Anybody want a binary telemetry frame editor written in Perl?
-- Larry Wall in <(E-Mail Removed)>
 
Reply With Quote
 
Peter Wyzl
Guest
Posts: n/a
 
      03-07-2009
"Larry Gates" <(E-Mail Removed)> wrote in message
news:q98xh61wmkc$.1k26eqqyvwvc0$(E-Mail Removed)...
> On Fri, 06 Mar 2009 09:59:49 -0800, Tim Greer wrote:
>> Larry Gates wrote:

<snip>
> Gosh, I would have thought that writing an e-mail client in perl would be
> as commonplace as ways to calculate pi with fortran.


Net:OP3

From the docs:

SYNOPSIS
use Net:OP3; # Constructors
$pop = Net:OP3->new('pop3host');
$pop = Net:OP3->new('pop3host', Timeout => 60); if
($pop->login($username, $password) > 0) {
my $msgnums = $pop->list; # hashref of msgnum => size
foreach my $msgnum (keys %$msgnums) {
my $msg = $pop->get($msgnum);
print @$msg;
$pop->delete($msgnum);
}
} $pop->quit;

--------------------------------------------------------------------------------

DESCRIPTION
This module implements a client interface to the POP3 protocol, enabling a
perl5 application to talk to POP3 servers. This documentation assumes that
you are familiar with the POP3 protocol described in RFC1939.

A new Net:OP3 object must be created with the new method. Once this has
been done, all POP3 commands are accessed via method calls on the object.


Surely you can read the rest yourself...

P


 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      03-07-2009
Larry Gates <(E-Mail Removed)> wrote in
news:q98xh61wmkc$.1k26eqqyvwvc0$(E-Mail Removed):

> Gosh, I would have thought that writing an e-mail client in perl would
> be as commonplace as ways to calculate pi with fortran.


http://www.unur.com/comp/ppp/delallspam.html

might help you get started.

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
Reply With Quote
 
M.O.B. i L.
Guest
Posts: n/a
 
      03-08-2009
Larry Gates wrote:
>
> I've used perl as a usenet client before, but now that I have a site out
> there with an email address that is supposed to get to me, and I wanted to
> look at it through the rubric of perl.
>
> How would a person use perl to simulate what OE does?
>
> What activestate modules are required for a given method? I would have to
> think there would be as many ways to do this in perl as building a wall for
> a carpenter.


I would use an IMAP client:
<http://search.cpan.org/search?query=imap&mode=all>.

It would enable me to transfer mails from one account to a GMail account
for backup. GMail uses IMAP with SSL (imap.gmail.com, port 993). I have
not done this myself yet and would also appeciate recommendations of
which modules actually work.
 
Reply With Quote
 
M.O.B. i L.
Guest
Posts: n/a
 
      03-08-2009
M.O.B. i L. wrote:
> Larry Gates wrote:
>> I've used perl as a usenet client before, but now that I have a site out
>> there with an email address that is supposed to get to me, and I wanted to
>> look at it through the rubric of perl.
>>
>> How would a person use perl to simulate what OE does?
>>
>> What activestate modules are required for a given method? I would have to
>> think there would be as many ways to do this in perl as building a wall for
>> a carpenter.

>
> I would use an IMAP client:
> <http://search.cpan.org/search?query=imap&mode=all>.
>
> It would enable me to transfer mails from one account to a GMail account
> for backup. GMail uses IMAP with SSL (imap.gmail.com, port 993). I have
> not done this myself yet and would also appeciate recommendations of
> which modules actually work.


I found one start to this:

#!/usr/bin/perl

# Based on a script on <http://www.perlmonks.org/?node_id=649742>.

use strict;
use warnings;
use Mail::IMAPClient;
use IO::Socket::SSL;

my %settings = (
IMAP => 'imap.gmail.com',
PORT => 993,
);
@ARGV == 2
or die 'Provide username and password for the IMAP server,'
. " on the command line.\n";
@settings{qw( USER PASS )} = @ARGV;

my $socket = IO::Socket::SSL->new(
PeerAddr => $settings{IMAP},
PeerPort => $settings{PORT},
) or die "socket(): $@";

my $client = Mail::IMAPClient->new(
Socket => $socket,
User => $settings{USER},
Password => $settings{PASS},
) or die "new(): $@";

print "Logged in\n" if $client->IsAuthenticated();
my @folders = $client->folders();
print join( "\n* ", 'Folders:', @folders ), "\n";

$client->logout();
 
Reply With Quote
 
Larry Gates
Guest
Posts: n/a
 
      03-09-2009
On Sun, 08 Mar 2009 15:41:26 +0100, M.O.B. i L. wrote:

> use strict;
> use warnings;
> use Mail::IMAPClient;
> use IO::Socket::SSL;


Thanks for your response, mo. One of the hardest parts of getting one of
these projects rolling is figuring out how you're going to imitate the
modules that others use.

The trick for me is to get what I read here on usenet and my actual choices
with activestate to gybe.

When I google for "cpan email pop3" I can't get away from this page
http://kobesearch.cpan.org/htdocs/Em...lder/POP3.html

I do not have this module:

C:\MinGW\source> perl eml1.pl
Can't locate Email/Folder.pm in @INC (@INC contains: C:/Perl/site/lib
C:/Perl/li
b .) at eml1.pl line 1.
BEGIN failed--compilation aborted at eml1.pl line 1.

C:\MinGW\source>type eml1.pl
use Email::Folder;
use Email::FolderType::Net;

my $folder = Email::Folder->new('pop://user(E-Mail Removed):110');

print $_->header('Subject') for $folder->messages;

# perl eml1.pl
C:\MinGW\source>

What I do have is Mail:OP3Client

http://lomas-assault.net/usenet/z10.jpg

I do now have POP3Client.pm in /site/lib/mail/.

Does anyone have experience with mail:OP3Client? It's 42 k long as a .pm
file. If I'm trying to figure out how to use it without any better
documentation, how would I determine the methods?
--
larry gates

...sometimes collections of stupid utterances can be rather clever. If
my writings are ever published posthumously, they should probably be
called "A Collection of Stupid Utterances", or some such...
-- Larry Wall in <(E-Mail Removed)>
 
Reply With Quote
 
Larry Gates
Guest
Posts: n/a
 
      03-09-2009
On Sat, 07 Mar 2009 08:12:58 GMT, Peter Wyzl wrote:

> "Larry Gates" <(E-Mail Removed)> wrote in message


>> Gosh, I would have thought that writing an e-mail client in perl would be
>> as commonplace as ways to calculate pi with fortran.

>
> Net:OP3
>
> From the docs:
>
> SYNOPSIS
> use Net:OP3; # Constructors
> $pop = Net:OP3->new('pop3host');
> $pop = Net:OP3->new('pop3host', Timeout => 60); if
> ($pop->login($username, $password) > 0) {
> my $msgnums = $pop->list; # hashref of msgnum => size
> foreach my $msgnum (keys %$msgnums) {
> my $msg = $pop->get($msgnum);
> print @$msg;
> $pop->delete($msgnum);
> }
> } $pop->quit;


I had to download the Email::Folder:OP3, but now I've got it and we're
rolling:

C:\MinGW\source>perl eml2.pl
Can't call method "login" on an undefined value at eml2.pl line 3.

C:\MinGW\source>


>
> --------------------------------------------------------------------------------
>
> DESCRIPTION
> This module implements a client interface to the POP3 protocol, enabling a
> perl5 application to talk to POP3 servers. This documentation assumes that
> you are familiar with the POP3 protocol described in RFC1939.



What is Perl5?

>
> A new Net:OP3 object must be created with the new method. Once this has
> been done, all POP3 commands are accessed via method calls on the object.
>
>
> Surely you can read the rest yourself...


I'll get on it.
--
larry gates

And other operators aren't so special syntactically, but weird
in other ways, like "scalar", and "goto".
-- Larry Wall in <(E-Mail Removed)>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Email the content of an ASP page using the email client NickH Javascript 9 01-22-2004 05:46 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments