Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Use JavaMail to access SquirrelMail?

Reply
Thread Tools

Use JavaMail to access SquirrelMail?

 
 
ngxfer001@gmail.com
Guest
Posts: n/a
 
      05-22-2008
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
 
Reply With Quote
 
 
 
 
RedGrittyBrick
Guest
Posts: n/a
 
      05-22-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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.

--
RGB
 
Reply With Quote
 
 
 
 
Wojtek
Guest
Posts: n/a
 
      05-22-2008
(E-Mail Removed) wrote :
> 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.

--
Wojtek


 
Reply With Quote
 
ngxfer001@gmail.com
Guest
Posts: n/a
 
      05-22-2008
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
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      05-22-2008
(E-Mail Removed) wrote:

> 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.

--
Nigel Wade
 
Reply With Quote
 
ngxfer001@gmail.com
Guest
Posts: n/a
 
      05-22-2008
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
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      05-22-2008
(E-Mail Removed) wrote:

> 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.

--
Nigel Wade
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-22-2008
On Thu, 22 May 2008 04:19:56 -0700 (PDT), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

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

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Donkey Hot
Guest
Posts: n/a
 
      05-22-2008
Roedy Green <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> On Thu, 22 May 2008 04:19:56 -0700 (PDT), (E-Mail Removed) wrote,
> quoted or indirectly quoted someone who said :
>
>>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


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.
 
Reply With Quote
 
ngxfer001@gmail.com
Guest
Posts: n/a
 
      05-22-2008
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
 
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
how to use javamail to handle a mail of mime typeapplication/vnd.ms-excel emrefan Java 9 12-07-2007 04:55 AM
JavaMail - Exclusive access to Pop3 Vijay Java 1 05-13-2005 06:04 AM
How to use javamail with Lotus Server? Zsolt Java 1 11-18-2004 05:59 PM
Re: Smtp Server error with JavaMail GaryM Java 8 07-21-2003 02:54 PM
Re: Smtp Server error with JavaMail Joseph Millar Java 0 07-16-2003 06:18 PM



Advertisments