How do you handle the "pause" command ? I don't see a registered coroutine.
Also, I don't see QueueStatus() returning a value, and queueStatus var is never read on mailOpen(k).
May I give you a suggestion ? Always start functions with Capital letter and avoid naming variables with the same name as functions, just differing on letter capitalization