mail-tui client: main function code completed