Change mailx mailbox location

mailx

On my computer, mail is stored in ~/Mailbox, not in a centralized directory. Is there a way to get bsd-mailx to read mail from there, instead of looking in /var/mail?

Best Answer

You can change the location of the mailbox in two ways. The first is using the MAIL environment variable:

export MAIL=$HOME/Mailbox

The other method is to use the -f option to mailx to specify a mbox file manually:

mailx -f ~/Mailbox
Related Question