Configuring postfix to only send email

Discussion in 'Server Operation' started by bozo, Apr 14, 2010.

  1. bozo

    bozo New Member

    I've a web server running multiple PHP sites. I only need to send emails for subscriptions or other site related stuff. This server doesn't get any incoming mail.

    I use Postfix on Debian. Now my SMTP port (25) is open. And I get lots of relay attempts. Is it possible to configure postfix for only sending emails? I want to close port 25 and get rid off relay attempts but I'm not sure sending mail will be possible that way.
  2. Mark_NL

    Mark_NL Member

    postconf -e inet_interfaces=loopback-only
    then restart postfix ..

    Port 25 will still be open, but only on the loopback interface, so your php scripts can still use it to poke mails in the queue.
  3. fzhan

    fzhan New Member

    Does this affect the receving of bounce messages? Say if Return-Path is the same as your sending domain?
  4. Mark_NL

    Mark_NL Member

    no, because mydestinations will be containing localhost, hostname (and mostlikely also your domain.tld) .. the machine will handle those mails as local mail.
  5. fzhan

    fzhan New Member

  6. Mark_NL

    Mark_NL Member

    yes, yes and yes :)

Share This Page