Use JavaMail to access SquirrelMail?

N

ngxfer001

Dear Experts,

I want to write an application to download document from my company
squirrelmail. I know that it is just a PHP web interface for accessing
mail located inside the company mail server.

I would like to know is there anyway to get the mail content directly
from the squirrelmail without connecting to the company mail server.
Cause my program plan to use outside the company, I am worried that I
will have a problem for connecting to the company's mail server
directly.

Best Regards
Ferdinand Ng
 
R

RedGrittyBrick

Dear Experts,

I want to write an application to download document from my company
squirrelmail. I know that it is just a PHP web interface for accessing
mail located inside the company mail server.

I would like to know is there anyway to get the mail content directly
from the squirrelmail without connecting to the company mail server.

Sure, since AIUI SquirrelMail presents a web-based mail interface using
HTTP and HTML, those are the methods your Java program would have to
use. See HttpUrlConnection etc. You'll probably need an (X)HTML parser too.
Cause my program plan to use outside the company, I am worried that I
will have a problem for connecting to the company's mail server
directly.

Then you're likely to have similar problems accessing internal HTTP
servers (such as SquirrelMail) from the outside too.

For programmatic access to mail, SMTP must be a lot easier than HTTP.
 
W

Wojtek

Dear Experts,

I want to write an application to download document from my company
squirrelmail. I know that it is just a PHP web interface for accessing
mail located inside the company mail server.

I would like to know is there anyway to get the mail content directly
from the squirrelmail without connecting to the company mail server.
Cause my program plan to use outside the company, I am worried that I
will have a problem for connecting to the company's mail server
directly.

Best Regards
Ferdinand Ng

Dear Experts,

I need to be able to hack squirrelmail.
 
N

ngxfer001

Thank you, RedGrittyBrick

I was planning to use JavaMail API to access the mail server. my
company's squirrelMail can be access from normal web browser anywhere,
even at home. I try to look at my squirrelMail box and I can't find
the mail server address, but I can't find it, is there anyway to find
it out? query the administrator involve alot of steps in my company
and time consuming.

Do you think JavaMail will work in this case? actually I am not sure
if the mail server can access from outside world or not? This mail
thing is new to me, is it general practice for squirrelMail mail
server to block out direct access from outside?

Thank you very much for your valuable time.

Best Regards
Ferdinand ng
 
N

Nigel Wade

Thank you, RedGrittyBrick

I was planning to use JavaMail API to access the mail server. my
company's squirrelMail can be access from normal web browser anywhere,
even at home. I try to look at my squirrelMail box and I can't find
the mail server address, but I can't find it, is there anyway to find
it out? query the administrator involve alot of steps in my company
and time consuming.

You won't be able to find the mail server address from SquirrelMail. It's not a
user configurable option in SquirrelMail. SquirrelMail is not a SMTP or
IMAP/POP server. It is merely a mail client with a Web interface which itself
requires SMTP and IMAP servers.
Do you think JavaMail will work in this case?

Not to access SquirrelMail. They are two entirely different things. JavaMail is
an API for talking directly to an SMTP server for mail submission and to an
IMAP/POP server for reading mail. You would need to be able to communicate with
those servers to use JavaMail.
actually I am not sure
if the mail server can access from outside world or not? This mail
thing is new to me, is it general practice for squirrelMail mail
server to block out direct access from outside?

It's nothing to do with SquirrelMail. SquirrelMail uses SMTP/IMAP services but
it doesn't control access to them. That is up to those servers themselves, and
other policies within the border firewall.

It is quite common, however, for an organization to only allow external access
to mail via a Webmail interface.
 
N

ngxfer001

Thank you so much for your help, Nigel

Your explanation is very helpful to me. So there is no way to
implement such program, cause the intention for doing this is because
I will receive alot of email containing data everyday, which currently
I have to manually open the email and convert to Excel. which waste
alot of my time. so I would like to implement something that
automatically check the email for new mail and convert it to excel in
a folder, I am really desperate need your valuable suggestion? >.<

Thank you for your help.

Best Regards
Ferdinand Ng
 
N

Nigel Wade

Thank you so much for your help, Nigel

Your explanation is very helpful to me. So there is no way to
implement such program, cause the intention for doing this is because
I will receive alot of email containing data everyday, which currently
I have to manually open the email and convert to Excel. which waste
alot of my time. so I would like to implement something that
automatically check the email for new mail and convert it to excel in
a folder, I am really desperate need your valuable suggestion? >.<

There is no way that you can perform that operation with SquirrelMail/JavaMail.
You might be able to do something as outlined by RedGrittyBrick with HTTP. But
that would require you figuring out how to authenticate with SquirrelMail, then
check your mail and download it. Not trivial, and not something I can assist
with.

What you really need to do is talk to your mail admins. about your requirements
and how they can be met. Direct IMAP access would be best, then you can use
JavaMail to access your mail.
 
R

Roedy Green

I would like to know is there anyway to get the mail content directly
from the squirrelmail without connecting to the company mail server.
Cause my program plan to use outside the company, I am worried that I
will have a problem for connecting to the company's mail server
directly.

JavaMail is designed to connect to SMTP or POP3 server and perhaps one
other. Presumably SquirrelMail uses a different protocol. If so,
JavaMail would likely be useless, though you might cannibalise parts
of it, for taking message apart if they use the same way of
compounding messages.

Use a packet sniffer to see how similar the protocols are.

http://mindprod.com/jgloss/sniffer.html
 
D

Donkey Hot

JavaMail is designed to connect to SMTP or POP3 server and perhaps one
other. Presumably SquirrelMail uses a different protocol. If so,
JavaMail would likely be useless, though you might cannibalise parts
of it, for taking message apart if they use the same way of
compounding messages.

Use a packet sniffer to see how similar the protocols are.

http://mindprod.com/jgloss/sniffer.html

Squirrelmal is an smtp/imap email client written in PHP.
JavaMail is an smtp/pop3/imap email client written in Java.

The mail protocols used by those are similar, common email protocols pop,
imap and smtp.

It's not possible to access SquirrelMail with JavaMail, excactly as it's
not possible to access Outlook Express or KMail on Pine with JavaMail (or
SquirrelMail).

It is possible to access SquirrelMail by using a HTTP client (like Apache
Commons http-client) and a HTML-parser.

OP asked ways to access SquirrelMail with JavaMail, and the answer is
definitely NO.
 
N

ngxfer001

Thank you for all your helps, everyone.

I appreciate with your valuable time for helping me to sort out this
problem. So the conclusion is that there is no way to use JavaMail.
the fallback solution beside asking permission from the administrator
(unlikely I will gain permission). The other way is to find a way to
implement the program acting like a browser, but all the entering
password and download the email?

I have a look into the Apache HttpClient, http://hc.apache.org/httpclient-3.x/,
it seems that allows me to access a webpage and also login to the
page? afterward I just need to find way to open the email?

What other tools avaliable for this me to write a program to allow me
to execute login and clicking in a webpage beside Apache HttpClient?

Thank you very much for your help.

Best Regards
Ferdinand Ng
 
D

Donkey Hot

(e-mail address removed) wrote in

Thank you for all your helps, everyone.

I appreciate with your valuable time for helping me to sort out this
problem. So the conclusion is that there is no way to use JavaMail.
the fallback solution beside asking permission from the administrator
(unlikely I will gain permission). The other way is to find a way to
implement the program acting like a browser, but all the entering
password and download the email?

I have a look into the Apache HttpClient,
http://hc.apache.org/httpclient-3.x/, it seems that allows me to
access a webpage and also login to the page? afterward I just need to
find way to open the email?

What other tools avaliable for this me to write a program to allow me
to execute login and clicking in a webpage beside Apache HttpClient?

Thank you very much for your help.

Best Regards
Ferdinand Ng

Well, you need the HTML-parser, for the stuff you download with http-
client. Jericho is pretty good, while there are lots of them: google "html
parser".

http://jerichohtml.sourceforge.net/doc/index.html
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top