Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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 pop.gmail.com with proto POP3
   user 'yourgmailaccount@gmail.com' 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: http://mohan43u.wordpress.com/tag/mailx/

and again at lifehacker: http://lifehacker.com/235207/geek-to-live--back-up-gmail-with-fetchmail

and again here: http://www.axllent.org/docs/networking/gmail-pop3-with-fetchmail/

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

poll pop.gmail.com with proto POP3

in the fetchmailrc file with:

poll imap.gmail.com 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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.