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

..lj darwin at ljsworld.com
Wed Nov 9 10:21:24 PST 2005


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



More information about the X-Unix mailing list