Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Unix 'mail' command/program

  • 20-03-2006 8:50pm
    #1
    Closed Accounts Posts: 27,857 ✭✭✭✭


    Hey folks,

    I'm fairly new to Unix, and I've just discovered the 'mail' command, and I was wondering if it's possible to be able to check my Gmail account with this command? I have my iBook set up so that I'm able to check it using the Mail application, but when I type in the mail command into the terminal, it always says that I have no mail. I've been messing around with it, and I'm able to send emails using this shell program (although they come from a wierd address... [myname]@...cpc1-tall1-4-1-cus.....dbn.cable.ntl..), but I'm not able to send mails to that address -- they bounce back.

    So in summary, am I able to set up my iBook so that i can check my Gmail in the Terminal?

    Thanks and sorry for being a n00b!


Comments

  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    DaveMcG wrote:
    Hey folks,

    I'm fairly new to Unix, and I've just discovered the 'mail' command, and I was wondering if it's possible to be able to check my Gmail account with this command? I have my iBook set up so that I'm able to check it using the Mail application, but when I type in the mail command into the terminal, it always says that I have no mail. I've been messing around with it, and I'm able to send emails using this shell program (although they come from a wierd address... [myname]@...cpc1-tall1-4-1-cus.....dbn.cable.ntl..), but I'm not able to send mails to that address -- they bounce back.

    So in summary, am I able to set up my iBook so that i can check my Gmail in the Terminal?

    Thanks and sorry for being a n00b!

    look into fetchmail


  • Registered Users, Registered Users 2 Posts: 1,459 ✭✭✭seanos


    'mail' command, typically checks /var/spool/$USER
    It will send mail from the hostname (can be checked via 'hostname').

    To check mail, interactively, via command-line, look into mutt.


  • Closed Accounts Posts: 27,857 ✭✭✭✭Dave!


    hmmm... would you be able to be a bit more specific, cos there's alot of info on fetchmail and it's hard to understand.

    I have all my POP information, servers, and so on -- is there a way I can change the settings in the terminal so that I can enter this information?


  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    DaveMcG wrote:
    hmmm... would you be able to be a bit more specific, cos there's alot of info on fetchmail and it's hard to understand.

    I have all my POP information, servers, and so on -- is there a way I can change the settings in the terminal so that I can enter this information?

    If you install a terminal based e-mail client.


  • Registered Users, Registered Users 2 Posts: 1,105 ✭✭✭larryone


    Such as mutt. I got too much into the habit of using pine. I'll get around to mutt at some point...


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    As ntlbell said, look into fetchmail.

    To get you started, here's the fetchmail setup that I use to retrieve my mail from GMail.

    Create the file .fetchmailrc in your home directory

    Add the following to the file :

    poll pop.gmail.com
    proto pop3
    port 995
    user "user.name@gmail.com"
    pass "mypassword"
    is "mylocaluser"
    keep
    fetchall
    ssl

    When you run the fetchmail command it should get your mail from GMail.

    You'll also need to switch on POP3 mail on your GMail account.

    This works for me under Linux. I imagine it should port straight over to OS X but I don't know for sure.

    Regards,

    Liam


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    I miss pine.


  • Registered Users, Registered Users 2 Posts: 1,105 ✭✭✭larryone


    pine can be nice, but from what I've heard lacks some of the functionality that you get with mutt. Pine Is Not Elm


  • Closed Accounts Posts: 27,857 ✭✭✭✭Dave!


    Thanks for that liamo!

    Here's the message I'm getting though, when I run the fetchmail command after sending myself a test email from another address...

    cpc1-tall1-4-1-cust85:~ dmcg$ fetchmail
    1 message for d..mcg...@gmail.com at pop.gmail.com (1689 octets).
    reading message [email]dmcg@gmail.com@gmail-pop.l.google.com[/email]:1 of 1 (1689 octets) .fetchmail: SMTP connect to localhost failed
    fetchmail: SMTP transaction error while fetching from pop.gmail.com
    fetchmail: Query status=10 (SMTP)


    Any ideas?

    Also, here...

    is "mylocaluser"

    Should that actually be mylocaluser or should I type in my local user? I think I got an error the second way, so it's currently the former.

    Thanks


  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    DaveMcG wrote:
    cpc1-tall1-4-1-cust85:~ dmcg$ fetchmail
    1 message for d..mcg...@gmail.com at pop.gmail.com (1689 octets).
    reading message [email]dmcg@gmail.com@gmail-pop.l.google.com[/email]:1 of
    1 (1689 octets) .
    Well, that part of it looks good. You've logged into Gmail correctly and fetchmail has established that there's an email for you.
    fetchmail: SMTP connect to localhost failed
    This is the problem. fetchmail will deliver fetched mail to your local mail server. If it can't connect to it then it can't deliver the mail.

    Having seen that error message my first thought was that you didn't have a mail server running on your machine. However, as per your original post, if you can use "mail" to send an email then it would appear that may be running a mail server.

    To check ... type netstat -a | grep '^tcp.*LISTEN' . This will give you a list of the open tcp ports on your system. Look for a line with "smtp" in it. If it's present then there's a mail server running. If not, there's not.
    Should that actually be mylocaluser or should I type in my local user? I think I got an error the second way, so it's currently the former.
    Yes, it should be the username of your account.

    Next time, try "fetchmail -vv" . This will give you more information on what's happening.

    Regards,

    Liam


  • Advertisement
Advertisement