Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What should I install, on fresh Ubuntu server, to make proper working web scripts for sending out emails ?

I've tried to install mailutils but it want to install postfix also. But i don't want to accept any incoming emails, so i don't know how to configure it. I need only MTA which will send out as lot as i want emails from web scripts, cron etc.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

This is kind of a subjective thing, but you can install postfix, just set it up to accept only incoming mail from your localhost or local IP. That will in turn try to deliver mail to external sites from your local scripts and applications.

Once installed, you edit your /etc/postfix/main.cf file so the inet_interfaces is set to 127.0.0.1. Or you can bind it to your public IP and the localhost. Then restart postfix.

You also want to check the mynetwork_style=host, mynetworks = 127.0.0.0/8, smtpd_recipient_restrictions = permit_mynetworks. These may need to be tuned to your particular configuration, but these settings can be tweaked to only accept from a particular IP or set of IPs, depending on how your server is seen by postfix when your applications connect.

share|improve this answer
    
So for this kind of purpose it's require to have such MTA as sendmail or postfix or exim ?? DO you know, how can I setup postfix to accept only from local IP ? –  user1016265 Apr 11 '12 at 13:27
    
Set up the restrictions and mynetworks to match just your IP. I edited the answer. –  Bart Silverstrim Apr 11 '12 at 13:30
    
And yes, you would need something that handles mail delivery as an MTA. Womble mentions a kind of proxy smtp program, but a common way to do this is to install postfix or exim to handle it. They're relatively low resource use and there's plenty of support for them. I'd stay away from Sendmail because really its...if you're asking about postfix or exim and MTA's, you shouldn't play with Sendmail. –  Bart Silverstrim Apr 11 '12 at 13:31
    
Depending on how your programs call the mail sending application, something like ssmtp may work. If you're running multiple things that expect to connect to port 25 to send, or may find yourself running something like that in the future, you should look at postfix or exim. In my own experience a properly configured postfix for local mail handling isn't very difficult to set up. If you were running a high-traffic site with many users I'd advice you to find a person experienced in proper email configuration to help you. Misconfigured email is a problem for everyone if done incorrectly. –  Bart Silverstrim Apr 11 '12 at 13:33
    
thank you for your explanation –  user1016265 Apr 11 '12 at 17:16

I use ssmtp for my outgoing-mail-only needs -- doesn't queue anything, doesn't listen to anything, just provides a standard /usr/sbin/sendmail implementation that connects to the configured SMTP server and hands the e-mail off to be delivered.

share|improve this answer
    
Yes, a null mailer client is what he really wants here. –  adaptr Apr 12 '12 at 8:54

Your Answer

 
discard

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.