13

My servers are currently on sendmail which is not very efficient. I'd like to migrate to PostFix.

I'm using Google Mail for Domain for handling incoming email so I need to setup PostFix to send emails only. What's the minimal PostFix configuration I must do to set up outgoing email delivery and prohibit receiving email? All localhost emails are trustable by default.

Vladislav Rastrusny
  • 2,671
  • 12
  • 42
  • 56

2 Answers2

18

The postfix documentation tells you exactly what you need to do.

Cakemox
  • 25,209
  • 6
  • 44
  • 67
  • The only thing I would like to ask is what if I have many domains on the machine? PostFix manual says `set up a domain-wide alias database that aliases each user to user@that.users.mailhost` - but how do I do that? – Vladislav Rastrusny Apr 20 '11 at 10:01
  • The origin is usually appended only if you have not set your sender domain. You can set up address rewriting to set the domain based on the sender, but I don't think it's necessary if your client is setting the domain. – Cakemox Apr 20 '11 at 11:17
  • alas OpenSMTPD is much easier then changing one parameter entails other.. – Denis Denisov Feb 07 '15 at 15:42
5

I suggest you instead use msmtp as just an outgoing email server. Simpler than configuring postfix, and there's no chance you will ever accidentally configure it to recieve mail (because it can't).

Here's a howto for configuring msmtp as your system mailer.

Phil Hollenback
  • 14,947
  • 4
  • 35
  • 52
  • I do not forward email to provider's gate currently. Can msmtp sent it directly to destination servers efficiently? I have emails sending every several seconds from the server. – Vladislav Rastrusny Apr 20 '11 at 07:48
  • If it's a few mails a minute, msmtp should be fine. However, it sounds like you may be approaching the point where something like postfix makes more sense, especially since postfix can store and retry messages much better than msmtp. – Phil Hollenback Apr 20 '11 at 08:05
  • Yea... SO that's why I asked ;) – Vladislav Rastrusny Apr 20 '11 at 08:07