Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I searched Google a lot but all I found were the tutorials to send messages using mail/mailx command.I want to receive gmail messages using mail/mailx.Is it possible?

share|improve this question

Your best bet is to use fetchmail to retrieve your email from your gmail account via POP3.

Install fetchmail:

sudo apt-get install fetchmail

(Or equivalent)

Then save this in a .fetchmailrc file in your home directory):

# set username
set postmaster "yourlocalusername"
# set polling time (5 minutes)
set daemon 600

poll with proto POP3
   user '' there with password 'yourgmailpassword' is yourlocalusername here options ssl

Substituting your gmail user & password and your local username.

Then kick off fetchmail to start it.

Once your mail has been retrieved to a local copy on your machine, you can read it using a wide range of mail clients (including mailx).

There is a quick tutorial here:

and again at lifehacker:

and again here:

If you would prefer to use the IMAP protocol, replace:

poll with proto POP3

in the fetchmailrc file with:

poll with proto IMAP

However YMMV...Google's IMAP implementation is known to deviate from the norm, so you may end up with unexpected results.

share|improve this answer
I personally wouldn't use POP3 protocol. POP3 is a good model for "I have one machine/device for email" With multiple machines you get multiple views of email, with some mail here, some there. – Rich Homolka Mar 25 '13 at 17:16
Updated solution to include IMAP as an alternative. – Tim Radcliffe Mar 25 '13 at 18:12

I'd ask "why mail/mailx"? Why specifically?

It's built with an old model of email, back when machines were expensive so you usually only had one machine to read mail from so you didn't have to worry about synchronizing across machines. Having it now kind of pins you to a specific machine that has old mail on local files.

Besides that, the UI is ancient, and hard for most people to navigate.

If you just want something you can run in a terminal, I'd suggest mutt, or pine.

share|improve this answer
That's because at my office they use AIX OS(unix based OS) and we don't have permission to install any other software so we are left with only mail/mailx. – Rajat Saxena Apr 15 '13 at 17:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .