Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

and thanks ahead.

My systems are FreeBSD 8/9, and i am trying to disable the local mailboxes for all users, but keeping the possibility to send outbound emails using PHP's mail command.

My local mailboxes are getting full with junk mail from different places which i dont really care about.

Is this possible?

share|improve this question

Yes, you just need to prevent your MTA from accepting incoming mail. How this is done depends on the MTA you use, but could also be achieved via a firewall rule blocking incoming port 25.

share|improve this answer
Is it possible to just remove the service or something like that? – shaharmor Jan 12 '13 at 12:10
Kind of. PHP requires a sendmail style interface to send mails. You could replace a full-featured MTA like Postfix with something like nullmailer, which is a relay-only MTA. – Sven Jan 12 '13 at 12:12
i have sendmail_enable="NO" in rc.conf, which as mentioned in the man page should disable incoming mail no? – shaharmor Jan 12 '13 at 12:15
I can't comment on this. My answer is generic, not FreeBSD specific, and since I don't know what this config optional actually does (disable sendmail?, remove it completely?), I don't know if it will do what you want. – Sven Jan 12 '13 at 12:18
read man rc.sendmail, and next time, mention something like which MTA you use. – Sven Jan 12 '13 at 12:32

Your Answer


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.