Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Quite frequently I have to send the outputs of my work on terminal (e.g. when compiling code) to my colleagues via email. I was wondering if it is possible to pipe (|) the output of a terminal command directly to email and I realized there are mail and mailx that can be used for this purpose.

The problem is, when I try a simple message like this

ls -laF | mailx -s 'generated files'

nothing is sent. How should I tackle this problem? In this post a very similar situation is asked and something is suggested but it's not the solution anymore.

share|improve this question
up vote 1 down vote accepted

OS X has postfix installed by default but it's not enabled (started). You can start it with

sudo postfix start

you can check the status and eventual problems in /var/log/mail.log

The configuration is in /etc/postfix/

share|improve this answer
Thank you. I started postfix as you said and tried again and failed again! checking the log it is telling me [my ip]:25: opration time out any suggestions? – Pouya Apr 24 '13 at 16:42
Do you have any firewall? – Matteo Apr 24 '13 at 16:43
I tried from home and it seems it is working. Probably it was a problem with internet connection at my work palace. Just one last question, should I stop postfix after or I can leave it running? – Pouya Apr 24 '13 at 21:17
You can leave it running. I would look online for the manual and check the configuration but as far as I remember the default settings are OK. – Matteo Apr 25 '13 at 5:05

Your Answer


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.