"no mail for admin", trying to send mail from command-line

0

I reinstalled Postfix, reconfigured it, and yet I'm getting this message when I use the mail program to start sending a new email.

admin@mail:~$ mail
No mail for admin

Any tip what I should look for?

Thanks!

Gabriel A. Zorrilla

Posted 2009-08-26T16:48:43.610

Reputation: 3 245

Answers

1

To send mail via the commandline, use mail:

$ mail -s "Some Subject" admin
Type some stuff
.

The dot tells mail the message is finished. You can also redirect program output to mail, or send a file's contents.

$ cat /etc/motd | mail -s "Message of the day" admin
$ mail -s "Message of the day" admin < /etc/motd

Will both send the contents of /etc/motd to the admin user on the local system. You can send mail out to the internet as well.

$ tail -10 /var/log/mail.info | mail -s "Some mail logs for you" admin@example.com

jtimberman

Posted 2009-08-26T16:48:43.610

Reputation: 20 109

Dang that was fast, you really like to earn points dont cha? ;) Anyway, i'll check it and give you my feedback. – Gabriel A. Zorrilla – 2009-08-26T16:55:45.687

My superuser bookmark goes to the "Questions -> Newest", I happened to open it to check something else and saw this question :-). – jtimberman – 2009-08-26T16:59:08.487

Sorry, perhaps I misguided you. I don't want to check for mail, just SEND mail. With the mail command a send mail CLI interface should emerge, backed by postfix. – Gabriel A. Zorrilla – 2009-08-26T17:00:01.310

Sorry, forgot to write the mail, n00b mistake, my bad. – Gabriel A. Zorrilla – 2009-08-26T17:01:36.440

1So, SOLUTION:

If you want to write some mail in the CLI, do this:

mail destination@address.com

Just typing mail checks your mail. :) – Gabriel A. Zorrilla – 2009-08-26T17:02:33.520

Some updates to clarify your question's intent, and I updated the answer. – jtimberman – 2009-08-26T17:07:40.110

WTF you edited my topic! LOL. Anyway, good answer, i'll give you some points for your time. – Gabriel A. Zorrilla – 2009-08-26T17:16:23.523