Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is what I did (as per a few discussions on this website)

mail -s "hi" addressee@email.xyz < test.txt

Where text.txt has the message.

I checked to see if mail did exist and it does at /usr/bin/mail

What am I missing? Is there a daemon that must be running? Is there more to this?

I am running Ubuntu 11.10

share|improve this question
1  
Might be that you must be in mail group to do that: sudo adduser your-user-here mail –  Reinis Jan 28 '12 at 8:02
    
@Reinis Thanks for your comment. Who exactly is your-user-here? The recipient, I am guessing? I'll try it out anyway. –  drN Jan 28 '12 at 8:25
1  
your-user-here is your username you have in your shell! You can see the username you use with before the @ sign in the shell, mine : marc-andre@T1500:$ –  Marc-André Appel Jan 28 '12 at 8:35
    
If you type id at the command line it will show you what groups you are in. Please add that to your question. Also what MTA are you using - postfix is the default one on ubuntu. If you do ps -ef | grep postfix what is the output? –  Hamish Downer Jan 28 '12 at 13:36
    
@HamishDowner Postfix isn't running. So I guess as per the comment below, I should first sudo apt-get install postfix –  drN Jan 28 '12 at 18:07

1 Answer 1

You will need to install a mail transfer agent. I would suggest Postfix, since it is widely used and has a good security record:

sudo apt-get install postfix

You should be asked a few questions about how you want to configure Postfix. If your ISP requires you to send email via their SMTP server, choose the "Satelite system" option and enter their SMTP server as the relay host. Otherwise, the "Internet site" option is probably best.

With that set up, the mail command line tool should be able to deliver email (along with anything else that relies on the /usr/lib/sendmail API).

share|improve this answer

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.