The session have a max amount of time before they expire. Browing in /webmail will refresh this time, but when you're typing a message, if you take too long, the session will expire. This will end up giving you a login page instead of sending the message causing you to lose the message. To increase the time allowed, edit:
/var/www/html/webmail/inc/config.security.php
and set:
######################################################################## # Session timeout for inactivity ######################################################################## $idle_timeout = 10; //minutes
to a higher value.