how to read email automatically without POP3 and IMAP servers in perl?

D

dale

Hi Everyone,

I am trying to use perl to read my emails from mail server (SMTP only)
automatically. But we do not have pop3 and imap servers. Is this
possible?

If not, I can use internet explorer to access my emails, could I use
web server to do this?
Any suggestions are greatly appreciated.

-Dale
 
G

Gunnar Hjalmarsson

dale said:
I am trying to use perl to read my emails from mail server (SMTP only)
automatically. But we do not have pop3 and imap servers. Is this
possible?

Maybe.

perldoc -f open
If not, I can use internet explorer to access my emails, could I use
web server to do this?

What has the latter question to do with Perl?

Btw, how can you use IE without POP3 or IMAP?

Anyway, you multi-posted (http://www.uwasa.fi/~ts/http/crospost.html),
so I'm disinclined to help you.
 
D

dale

I am sorry for dual posting since I am new here and not sure where I
should post.

If the answer to the first question is possible, can you provide an
example?

Thanks. -Dale
 
D

dale

I am sorry for dual postings since I am new here and not sure where I
should post.

If the answer to the first question is possible, can you provide an
example?

Thanks. -Dale
 
A

AaronJSherman

I think the short answer to your question is, no you cannot fetch your
mail without a mail client protocol to talk to. The previous responder
suggested "open", but that assumes you have local access to the mail
spool, and you probably did not mean to suggest that that was the case.

SMTP is a protocol designed to send mail. There's no provision in the
protocol for fetching mail.

As far as a Web server goes... if you have a Web server running on the
machine that you want to fetch mail from, then you could run any of the
widely available web-mail packages and use a browser to read your mail.
However, almost none of this has anything to do with Perl.
 
D

dale

Our company is using SMTP on the mail server. The help desk told me
that this is the only one we use to receive and send mails. We use
microsoft outlook to read and send emails. Outlook has web access as
well.

I am wondering how I could come up a perl script to read emails from
out mail server automatically?

Thanks. -Dale
 
S

Sherm Pendley

dale said:
I am wondering how I could come up a perl script to read emails from
out mail server automatically?

Simple, just follow three easy steps:

1. Find out what protocol the server you want to talk to supports. This
will probably be POP or IMAP for receiving mail, and SMTP to send it.

2. Search CPAN for modules that implement the protocol(s) you need.

3. Install those modules and use them to write your script.

sherm--
 
A

Alan J. Flavell

That would depend on the protocols available. And no, SMTP won't do.
SMTP is for *sending* mail - not for retrieving it. POP3 and IMAP are
the common protocols for that.

Right; however, the questioner did also mention web access, which
might (or might not - I'm not pre-judging the question) prove to be an
alternative approach.

Nevertheless, this isn't really the right group for mail protocol
discussions. Once the questioner knows what the task is that they
want to program, they'd be welcome back here to discuss any problems
they might have with programming that task in Perl, right?

On the other hand, I understand there's a Perl interface to Windows
automation, so they could go drive their favourite Windows application
from Perl, and not worry what it's doing under the covers? That's
pure theory for me - it's not something I've ever tangled with. I did
once find myself in a situation where it seemed as if it'd be a useful
thing to do, but I managed to put it off long enough that the need
went away ;-)

But anyway, the hon Usenaut could look at ActivePerl and Win32::OLE
if the latter idea seems to appeal.
 
M

Matt Garrish

dale said:
Our company is using SMTP on the mail server. The help desk told me
that this is the only one we use to receive and send mails. We use
microsoft outlook to read and send emails. Outlook has web access as
well.

Outlook has a web interface to the mail stored on the server so that
employees can check their mail remotely. This is not terribly uncommon, as
most decent ISPs seem to provide web-based mail readers these days, too. One
problem springs to mind if you want to use the web interface, and that is
that you normally have to authenticate yourself using Windows authentication
(never tried it in Perl myself, so not certain how hard it would be to
automate).

I suspect what your helpdesk meant to tell you was that they have an
Exchange server running with the smtp service enabled. They can be excused
for being stupid, however, as they're probably M$ certified not to know the
difference.

Why do you think you have to use the web interface to send mail, though? The
interface is just a web app that reads what's in your inbox on the server
(i.e., an extra level of indirection, and an unnecessarily complicated means
of accessing your mail). You should find out what the name of your mail
server is and use it directly to send and receive mail, instead (which is
all that the web app is doing, by the way). There are plenty of mail modules
available on cpan that will allow you to send and receive mail, and I
believe some can be used for connecting to Exchange servers.

Matt
 
G

Gunnar Hjalmarsson

dale said:
I am sorry for dual postings since I am new here and not sure where I
should post.

Okay, now you know. You should also know that bottom-posting is the
preferred style, i.e. you should only quote as much of the post you are
replying to as is needed for context, and you should type your comments
*below* the quoted part(s).
If the answer to the first question is possible,

You haven't provided enough info to tell, and the info you did give us
is contradictory. As Aaron pointed out, my suggestion to use open()
presupposes that you have read access to the mail spool file. Otherwise
there must be a protocol available for fetching mail.
 
D

dale

I have verizon dsl service at home. I guess that they have pop3 server
for receiving mails. I tried to telnet or ping to incoming.verizon.net.
None of them works.

Any idea? -Dale
 
S

Sherm Pendley

dale said:
I have verizon dsl service at home. I guess that they have pop3 server
for receiving mails. I tried to telnet or ping to incoming.verizon.net.
None of them works.

Why are you asking us? Ask Verizon. This is a Perl group, not a Verizon
help desk.

sherm--
 
X

xhoster

dale said:
Our company is using SMTP on the mail server. The help desk told me
that this is the only one we use to receive and send mails.

Well, they are almost certainly wrong.
We use
microsoft outlook to read and send emails.

I think that MS Outlook speaks some propietary protocol(s) to communicate
with the MS Exchange server. The server has to be running this protocol(s)
or else Outlook would not work. Perhaps your helpdesk meant that,
other than propietary protocols, they run only SMTP.

I cannot find any perl module that emulates this protocol, but I may
have overlooked it. There is a Evolve program which runs on Linux
and I think is supposed to support Exchanges protocols. I don't
think it has anything to do with Perl, but you may be able to link into
it from Perl. I can't figure out whether it is commercial or open source.

(Earlier)
If not, I can use internet explorer to access my emails, could I use
web server to do this?

Perhaps. I can use Mozilla to access (at least one version of) Outlook Web
Access, so it doesn't seem to be highly propietary on the browser side.
You might be able to use LWP or WWW::Mechanize or something like that to
get your mail from the mail/web server. I don't know enough about using
those modlules to give any more detailed advice, however.

Good Luck,

Xho
 
M

Matt Garrish

dale said:
I have verizon dsl service at home. I guess that they have pop3 server
for receiving mails. I tried to telnet or ping to incoming.verizon.net.
None of them works.

Any idea? -Dale

Why not just use their web interface...

http://netmail.verizon.net/

How about writing some actual code now to do whatever it is you're trying to
do and then come back with any specific problems you have. Sorry, but I see
nothing useful coming of this thread anymore.

Matt
 
B

Brandon Metcalf

I have verizon dsl service at home. I guess that they have pop3 server
for receiving mails. I tried to telnet or ping to incoming.verizon.net.
None of them works.

Any idea? -Dale


Although this is way off topic, I can ping this host and telnet to port
110 which is where the POP3 server is listening:

$ ping -c 2 incoming.verizon.net
PING mail.verizon.net (206.46.170.10): 56 data bytes
64 bytes from 206.46.170.10: icmp_seq=0 ttl=235 time=28.8 ms
64 bytes from 206.46.170.10: icmp_seq=1 ttl=235 time=24.7 ms

--- mail.verizon.net ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 24.7/26.7/28.8 ms
$ telnet incoming.verizon.net 110
Trying 206.46.170.10...
Connected to mta1pub.gte.net.
Escape character is '^]'.
+OK InterMail POP3 server ready.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top