Using Pine 4.21-23 as supplied with Red Hat Linux 7.0 the program hangs when switching from a folder such as sent-mail back to the INBOX. The INBOX is an IMAP folder on a Red Hat Linux 5.1 running imap 4.1.final-1. The bug is very reproducible, and independent of the local folder that is closed.
Can't reproduce from Red Hat Linux 7 to Red Hat Linux 7, so this looks like some weirdish interaction between new pine and old imap-server... Can you at least try the one in Red Hat Linux 5.2? (5.1 isn't supported anymore)
The problem does not have to do with the IMAP server, but with the NFS locking problems between RedHat 7 and older versions of RedHat.
Oops, forgot. The local folders are on an NFS-mounted homedirectory. That is why the NFS locking bug gets triggered in the first place. See bug #18097.
So the Red Hat 5.1 system is running IMAP, and it is mounting an NFS mail spool from elsewhere? What is the NFS server running on? All I can recommend is to upgrade to a newer version of Red Hat Linux on the affected systems. 5.1 isn't supported as Trond mentioned. This bug doesn't appear to be imap related, but as you say NFS related so I'm closing it.