0

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.

2 Answers 2

3

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.

6
  • 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 ? Apr 11, 2012 at 13:27
  • Set up the restrictions and mynetworks to match just your IP. I edited the answer. Apr 11, 2012 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. Apr 11, 2012 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. Apr 11, 2012 at 13:33
  • If you're running multiple things that expect to connect to port 25 to send, then point them at a real MTA running on a real mail server.
    – womble
    Apr 12, 2012 at 11:49
2

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.

1
  • Yes, a null mailer client is what he really wants here.
    – adaptr
    Apr 12, 2012 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .