Use JavaMail to access SquirrelMail?

Discussion in 'Java' started by ngxfer001@gmail.com, May 22, 2008.

  1. Guest

    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
     
    , May 22, 2008
    #1
    1. Advertising

  2. 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
     
    RedGrittyBrick, May 22, 2008
    #2
    1. Advertising

  3. Wojtek Guest

    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 :)
     
    Wojtek, May 22, 2008
    #3
  4. Guest

    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
     
    , May 22, 2008
    #4
  5. Nigel Wade Guest

    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
     
    Nigel Wade, May 22, 2008
    #5
  6. Guest

    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
     
    , May 22, 2008
    #6
  7. Nigel Wade Guest

    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
     
    Nigel Wade, May 22, 2008
    #7
  8. Roedy Green Guest

    On Thu, 22 May 2008 04:19:56 -0700 (PDT), 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
     
    Roedy Green, May 22, 2008
    #8
  9. Donkey Hot Guest

    Roedy Green <> wrote in
    news::

    > On Thu, 22 May 2008 04:19:56 -0700 (PDT), 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.
     
    Donkey Hot, May 22, 2008
    #9
  10. Guest

    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
     
    , May 22, 2008
    #10
  11. Donkey Hot Guest

    wrote in
    news::

    > 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
     
    Donkey Hot, May 23, 2008
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zsolt
    Replies:
    1
    Views:
    1,511
    Tor Iver Wilhelmsen
    Nov 18, 2004
  2. Vijay
    Replies:
    1
    Views:
    669
    Daniel
    May 13, 2005
  3. Bengt Richter
    Replies:
    3
    Views:
    395
    Bengt Richter
    Oct 5, 2003
  4. Guest
    Replies:
    1
    Views:
    365
    Paul Rubin
    Feb 25, 2006
  5. Guest
    Replies:
    1
    Views:
    455
    Paul Rubin
    Feb 25, 2006
Loading...

Share This Page