improved hostname guessing when generating vm_email.inc