0

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 = foo.me
mydestination = localhost
mynetworks = 127.0.0.0/8

myorigin = /etc/mailname
mydestination = sd-24300.com , 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

adamo
  • 6,867
  • 3
  • 29
  • 58
x_vi_r
  • 300
  • 2
  • 4
  • 15
  • To configure postfix as send-only (except for local mail), see [this answer](https://serverfault.com/a/122777/61015). –  Dec 23 '17 at 00:21

2 Answers2

5

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

It's available in the universe repo.

Sven
  • 97,248
  • 13
  • 177
  • 225
0

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.

Vincent
  • 191
  • 1
  • 3
  • 10
  • 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 09:49