Oh, maybe I misunderstood your question. Are you trying to deal with locking on the POP3 server end, or the client? If it's the client and all clients run on the same machine, again you can use filesystem locks. Just do open(LOCK,">>/tmp/lockfile"); flock(LOCK,LOCK_EX); before opening the POP connection, but with error checking and a lockfile that's not in a world-writable area.