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

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

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

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

That is interesting...

When you say that the mail server you're using doesn't do imap or pop3,
are you saying that your mail server doesn't have a pop3 server
associated with it? How do you currently read your email? Are you using
an old Unix client program like mailx, elm, or pine?

There isn't a way to use Net:SMTP to read mail from an SMTP server.
Normally on Unix systems, mail is stored as a single text file in the
/var/mail/<username> or /usr/spool/mail/<username> or
/var/spool/mail<username> or something like that. It varies from system
to system. Sometimes the MAIL environment variable will point to the
MAIL file.

SMTP mail clients then simply parse that text file to give you the
feeling that this single text file are many separate individual email
messages. It shouldn't be too difficult to do this with Perl. The
format of this mail file is pretty straight forward. Just use standard
protocols to lock and unlock this mail file to prevent more than one
process changing it at the same time.

You say you can pull up your email via IE? And this isn't through a
POP3 or IMAP interface? It is possible that someone wrote a web based
mail client that takes the contents of the /var/mail/<username>
directory and allows you to manipulate this file via a web page
interface. I wrote something like this (in Perl in fact) about a dozen
years ago before POP3 became popular.

However, what you're asking is whether you can use HTTP calls to
actually pull off information from this web-based email interface. In
theory, you could, but I bet there's no published interface which means
you're on your own to figure it out.

You'll also have to figure out the URLs needed to do such things as
pull off an individual piece of email and how to delete or reply to an
email message. If the email webpage isn't doing anything too fancy or
obscure it is possible to figure all of this out too. However, I
imagine this would take a lot more time that you planned to waste on
all of this.

Another thought: Would it be possible to forward your mail to another
server which uses IMAP or POP3 access? That would make things a lot

Site Timeline