Enhanced implementation of the mailx command