JavaMail - Exclusive access to Pop3

Discussion in 'Java' started by Vijay, May 11, 2005.

  1. Vijay

    Vijay Guest

    hi all,

    I am using javamail to fetch messages from a pop3 server. I open my
    session in read-write mode as I delete the messages when I close the
    session.
    Is it possible to make sure that when I am fetching a message from the
    server, another similar copy of my same program would not be able to
    access the Inbox?
    I want that any other code(which tries to open in read-write mode)
    should wait while I have a session open in read-write mode with the
    pop3 server.

    Thanks for any help...
     
    Vijay, May 11, 2005
    #1
    1. Advertising

  2. Vijay

    Daniel Guest

    hi,
    To my knowledge pop3 does not have this kind of feature (but I must
    admit that my knowledge of pop3 is very limited). So that means that
    your code would have to do this kind of checking itself. The only way
    I can think of right away would be to create a "lock file" on the
    computer, and then at startup check if this lock file is present. (I
    know Eudora works this way) if the file is present, present a message
    to the user, and then abort startup. Of course, when your program
    closes it deletes the file.
    Of course, if someone starts an e-mail client on another computer, you
    won't know about it.

    regards
    Daniel


    >hi all,
    >
    >I am using javamail to fetch messages from a pop3 server. I open my
    >session in read-write mode as I delete the messages when I close the
    >session.
    >Is it possible to make sure that when I am fetching a message from the
    >server, another similar copy of my same program would not be able to
    >access the Inbox?
    >I want that any other code(which tries to open in read-write mode)
    >should wait while I have a session open in read-write mode with the
    >pop3 server.
    >
    >Thanks for any help...
     
    Daniel, May 13, 2005
    #2
    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. Daniel Albisser
    Replies:
    1
    Views:
    1,094
    GaryM
    Apr 7, 2004
  2. Charter
    Replies:
    2
    Views:
    37,409
    Roedy Green
    Sep 20, 2005
  3. Adam Messer
    Replies:
    0
    Views:
    1,490
    Adam Messer
    Sep 20, 2005
  4. cipher
    Replies:
    2
    Views:
    4,307
    Nigel Wade
    Feb 14, 2006
  5. Nikhil
    Replies:
    4
    Views:
    985
    Martin Gregorie
    Apr 15, 2007
Loading...

Share This Page