[X-Unix] how to send mail from commandline?

Ben Gold bgold at acedsl.com
Wed Nov 9 10:58:39 PST 2005


I've wanted occasionally to be able to send an email from the command  
line also.

I've always wondered if there is no way to send one without turning  
on Postfix?   I always thought it would be possible to simply send  
out a message much like my Apple Mail program does – some command  
where I type in the destination, message, AND my ISPs mail server.

Is this not possible?

Why do I need to run a server just to send an email?  If numerous  
programs can connect to my ISPs mail server, why can't I?

Or do I misunderstand that Postfix is a server, not a client?

I don't know a lot about *nix, but I was hoping this was possible.



On Nov 9, 2005, at 1:21 PM, ..lj wrote:

>
> On Nov 9, 2005, at 10:07, Warren Pollans wrote:
>
>
>> Hello,
>>
>> When I try "hello | sendmail -fwarren at meyer-pollans.net  
>> warren at meyer-pollans.net" I get an error that indicates (from  
>> googling) that it wants/needs postfix - I'm on a G3 ibook  
>> (10.3.9)  -  the error is "... warning: unable to look up public/ 
>> pickup ..."  I tried it this way because this is what works on my  
>> linux box
>>
>> What's the easiest way to send mail from the commandline?  I'm  
>> trying to send the contents of a text file - this is the log from  
>> a series of tests that I've run - I'm having the script that runs  
>> the tests mail me the results.  I'm just trying to get things  
>> setup so that I can run from my ibook while I'm traveling
>>
>>
>> Thanks,
>>
>> Warren
>>
>
> Apple has now included Postfix instead of sendmail in Panther  
> client and server. Here are the steps you need to do and watch out  
> for if you want to enable this MTA on your client machine.
>     1.       Edit the MAILSERVER=-NO- line in /etc/hostconfig.  
> Change it to read MAILSERVER=-YES- or -AUTO-. Save and exit the file.
>     2.       Open up /etc/postfix/main.cf, and edit these lines to  
> reflect your setup. These are examples from my setup; yours might  
> be different.
>         ◦     LINE 67: myhostname = pb.ljs-world.com
>         ◦     LINE 75: mydomain = ljs-world.com
>         ◦     LINE 91: myorigin = $mydomain
>         ◦     LINE 105: inet_interfaces = all
>         ◦     LINE 152: mydestination = $myhostname, localhost. 
> $mydomain
> Save your work, and exit the file.
>     3.       Open up /etc/postfix/master.cf, and uncomment line 77  
> -- change #smtp inet n - n - - smtpd to smtp inet n - n - - smtpd.  
> Save and exit the file.
> After a reboot or a postfix (re)start, the postfix MTA will be  
> running. (sudo start postfix)
>
>
> This will also allow you to use localhost as a SMTP, but some  
> ISP's  mail servers won't accept your email for fear you are a  
> spammer.
> You could put a relay line in /etc/postfix/main.cf that will help.
>
> relayhost = smtp.yourisp.com
>
> ..lj
>
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>
> Listmom is trying to clean out his closets! Vintage Mac and random  
> stuff:
>         http://search.ebay.com/_W0QQsassZmacguy1984
>



More information about the X-Unix mailing list