Using mailx

Mailx is a command line utility for sending and receiving mail. While I use a graphical client to check external mail, mailx is useful for checking local system mail.

Mailx is an improved version of the mail utility and is intended to be a drop-in replacement for it. For this reason, on some systems mail is a link to mailx or vice versa.

Many systems have mailx already installed. Those that don’t invariably have it available in their distribution’s package manager, sometimes as part of a package bundle. Common package bundle names include heirloom-mailx (the one I choose if available), bsd-mailx, or mailutils.

Once installed, start mailx:

$ mailx

You will enter a mailx session, which works similar to a vi session. The initial view is of your inbox, with a > indicating the current message. The inbox is followed by a ? prompt. A few useful commands that can be given at the ? prompt are:

To start, send yourself a test message. You will be prompted for a subject, which should end with a return. Then enter your message. A single period followed by a return ends and sends the message.

mailx USER

Now display the inbox and insure your test message is there:


Display message number 5. The message can be scrolled, less-like:


Mark messages 1 through 4 for deletion:

d 1-4

Quit mailx, deleting messages marked for deletion:


If you just have to have a GUI tool, some mail clients can check local system mail. One is Evolution.

Mailx tutorial
man mailx


About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Using mailx

  1. Pingback: Configuring postfix | A maze of twisty little passages

  2. Pingback: Checking system mail with Evolution | A maze of twisty little passages

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s