On every storage server a pcheckd program is running. It implements the server side of the MAILCHECK protocol. The client side is implemented in the pproxy program. There is a test program called pcheck, which fully implements the protocol. It can be called from the command line.
The MAILCHECK protocol uses a single UDP request packet and a single UDP packet with the answer. The request packet contains with an asterisk ('*') a single uppercase letter denoting the type of request, extra parameters and an optional carriage return (CR) and an optional line feed (LF) character.
Currently there are two types of requests defined:
The request contains only the letter 'L'. It asks the server to send back the current load of the machine. The value is returned as a floating point value formattet in ASCII. It is intended to be used by the proxy server to detect storage server overload. (Although, in the current version of the proxy, it is not used.)
Example: reqest: '*L' answer: '+OK 3.23\n'
The request contains the letter 'M' followed directly by the mailbox name including any directory names relative to the POP storage directory. It asks the server to return the current state of the mailbox, i.e. whether there are any mails in the mailbox.
Example: request: '*M3/2d/joe.doe' answer: '+OK 0 no mails\n'
Note: For compatibility with earlier versions of this programm a slightly different syntax is allowed. If the first character is not an asterisk ('*'), the request is assumed to be a mailbox check and the only content of the packet is the mailbox. Support for this format will be discontinued in a future version.
The answer is a single UDP packet formatted as follows: If an error has occured on the server side it will return '-ERR ', an error message and a line feed character. If there was no error the server will return '+OK ' and an additional message as follows:
This is the answer from the Load command.
There are no mails in this mailbox.
There is no new mail, but only read mail in this mailbox.
The is at least one new mail in this mailbox.
The load on the storage server is too high. The proxy will fake an empty mailbox to the client, so the storage server will not be overloaded.
The maximum number of pserv sessions is reached. The proxy will fake an emtpy mailbox to the client, so the storage server will not be overloaded.