[X-Unix] Sending mail from the commandline?

Kevin Stevens groups at pursued-with.net
Fri Jan 25 18:00:09 PST 2008

On Fri, 25 Jan 2008, TjL wrote:

> On 1/25/08, Kevin Stevens <groups at pursued-with.net> wrote:
>> On Jan 25, 2008, at 15:47, TjL wrote:
>>> What's the easiest way to setup my iMac running 10.5.1 so that I can
>>> send mail from the commandline, ala
>>>           cat "Hello World" |Mail -s "Test" luomat at gmail.com
>>> I'm really hoping that I don't have to go through and configure
>>> sendmail just for this!
>> man mail
> Um, was that supposed to be helpful?

Yes, actually, it was.  However, I misread your command as 
IMail-something and assumed you were running a different application and 
weren't aware of mail..  So, no harm, no foul.

> I know the command, I don't know what you're suggesting, so it ends up
> being a waste of time.
> It also doesn't answer the question I asked.  It's not so much as the
> command to use as to "How to get it off my iMac and onto the
> internet."  Perhaps that was my fault for not being clear.  Messages
> sent using the command I sent gives no error message but the message
> doesn't ever show up at my GMail account.

I can tell you that mail works on a fresh Leopard default install, because 
that's what I'm typing on.  postfix runs on a per-minute schedule, picks 
it up, and delivers it to gmail.  Details are in /var/log/mail.log.  What 
happens at gmail is another story; it may be flagged by some spam filter 
there and not delivered, but according to my log it was accepted there.

I tested this from an interactive session (mail myname at gmail.com; enter 
stuff, . on blank line to end).  I know you can feed mail in some similar 
way; because I've done it in the past, but I don't recall the details at 
the moment, which is why I just pointed you at the man page.  But mail 
does work out of the box, and postfix does work for as an MTA.  You have 
to set it up to receive, of course.


More information about the X-Unix mailing list