Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Directly accessing inbox & file locking

Discussion in 'General Discussion' started by MrZaphodQB, Feb 13, 2005.

  1. MrZaphodQB

    MrZaphodQB Registered

    Feb 13, 2005
    Likes Received:
    Trophy Points:
    Greetings everyone.

    Sorry if this has already been addressed and I missed it while i was searching the archives.

    I am writing a Perl script to run as a cron, which will directly access the inbox and process the messages contained therein, using the Perl Mail::Box module.

    This inbox is a mail box that is NEVER checked via a POP account and is only ever accesed through this script (and ofcourse mail server delivering mail to the inbox)

    My question then is this;
    What file locking system does cpanel's mail server respect to keep it out of the inbox while my script is processing the inbox?

    I am under the impression that the inbox.lock file is just to keep there from being two(2) pops to the box and does nothing to keep the server out.


    Is keeping the server out, really not an issue while I am reading emails and marking them for deletion?

  2. chirpy

    chirpy Well-Known Member

    Jun 15, 2002
    Likes Received:
    Trophy Points:
    Go on, have a guess
    You need to separate out two things. One is POP3 server access to the file (retrieving and deleting email) the other is SMTP access to the file (writing to it).

    If you're saying that you are never going to pop the mailbox, then you need to check whatever the SMTP server (Exim) uses -

    The simplest way to do this would really be to use the POP3 protocol and login to the POP3 account through the POP3 server using something like Mail::POP3Client (excellent perl module):

    The only thing I don't understand is your last line:
    You cannot "mark them for deletion" by opening the file - you have to actually delete them yourself from the file. There's not concept of marking emails for deletion except in the POP3 protocol.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice