Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I'm digging the web around to find the best way to configure Postfix.

I don't want to install a full Postfix server, the only thing I want is to send mail with the PHP mail(). I know this can be tricky, spammer loves the misconfigured mail server. So, I am looking for the best way to do this.

The best documentation I found is the Archlinux one.

But on several blogs I found some more tricky configuration like this

myhostname =
mydestination = localhost
mynetworks =

myorigin = /etc/mailname
mydestination = , localhost
mail_owner = postfix

smtpd_recipient_restrictions =reject_unknown_sender_domain,reject_non_fqdn_sender,reject_unknown_recipient_domain,reject_non_fqdn_recipient,permit_mynetworks,reject_unauth_destination,permit
smtpd_data_restrictions =reject_unauth_pipelining,permit
inet_interfaces = loopback-only

So my question is quite easy, what is the best way to do this? By best i mean the more secure one.

Ps: My server runs a Ubuntu 12.04 with LAMP

share|improve this question

Use nullmailer instead of Postfix, it is a relay-only server made for this purpose.

It's available in the universe repo.

share|improve this answer

Since you're using ubuntu you can select from a couple predefined configs using the command:

sudo dpkg-reconfigure postfix

It should have one that fits your description.

share|improve this answer
This is much too vague, and factually untrue: while you could cobble something together by starting with the satellite config, there is no dpkg option that gives you a nullmailer. – adaptr Jan 14 '13 at 9:49

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.