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

  • 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. – dearN 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 – dearN Jan 28 '12 at 18:07

You need to install several packages namely as follows

 postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

these packages are required for the proper setup of mail sending. Here is a proper way of setting this up and testing out by sending mail and the possible troubleshooting. Hope this helps :)


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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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