Postfix SMTP – Configuring Outgoing Only SMTP Server on Debian

configurationdebianpostfixsmtp

I want to setup an outgoing only SMTP server on Debian, so my Web-applications will be able to send e-mails via it. I don't want to use another hosts because of security and customizability of my own setup.

I wish to install Postfix and configure it only in the outgoing mode (I don't want it to be a relay). So I want to ask an advice how to do it in the best way. There's no need in users, virtual users, endpoints and other options Postfix provides. I suppose I should only attach Postfix to some hostname, so my IP address can resolve to it.

I also think Postfix can be a bit complicated solution for this task. If you know much simpler tool for it, let me know.

Best Answer

To setup Postfix on Debian for outgoing mail only:

  • dpkg-reconfigure postfix (Select internet site when prompted)
  • postconf -e 'inet_interfaces = 127.0.0.1'
  • /etc/init.d/postfix restart

inet_interfaces = 127.0.0.1 in /etc/postfix/main.cf will bind Postfix to localhost only, so your machine won't accept incoming email.