I want to make Postfix unable to receive mail. I just want to be able to send mail with Postfix, not the other way around. Is that possible? If so, can anyone tell me how to do that? Thanks.

link|improve this question

80% accept rate
I guess everyone can file this as CLOSED. Coolwater answered my question. The rest of you were great, but I'm satisfied with coolwater's response. – willbeeler Oct 13 '09 at 15:41
feedback

3 Answers

up vote 5 down vote accepted

Inside your (/etc/postfix/)main.cf:

inet_interfaces = 127.0.0.1

This way it only listen to localhost (via loopback). Make sure you restart (or reload) the server after change.

link|improve this answer
Setting it to loopback-only would be better, as that includes IPv6 too (if ipv6 is enabled in inet_protocols). Using 127.0.0.1 is not a problem here, but I myself do care about such things. – grawity Oct 13 '09 at 13:21
Thanks. This is what I ended up doing. Basically, my clients are using Google Apps and I need postfix just for the PHP mail() command. Thanks again. – willbeeler Oct 13 '09 at 15:40
feedback
dpkg-reconfigure postfix

Choose satellite system.

Provide your ISP's smtp server as the smarthost.

Preferrably choose a valid domain name to mask local adresses.

When asked about which subnets to listen on, provide only the loopback interface's 127.0.0.1

Similarly, only provide localhost (and optionally the hostsname) as final mail destination.

The system will now support a minimum of local mail delivery, accept no mail from external hosts and send all outgoing mail through the smarthost.

link|improve this answer
feedback

you can also block the incoming port 25 with iptables

link|improve this answer
1  
swatting flies with a sledgehammer.. I like it... :) – roe Oct 13 '09 at 17:13
LOL @ roe. I'm sure it works though. :D – willbeeler Oct 15 '09 at 17:19
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.