Postfix server configuration values explained?

I am trying to setup a single server to send out email from a single domain but I'm having trouble identifying the correct values for these Postfix settings.

mydomain = example.com
myhostname = example.com
myorigin = $mydomain
mydestination = $example, localhost.$example, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

Can someone can explain them so I know what I should be setting them to?

Things like $mydomain appear to be added at runtime by the script. This seems to work (emails come from [email protected]) but I am weary of using values for parameters I don't understand.


Good for you. You should be weary of using parameters you don't understand. This is the failing of most control panel software. Most people start jacking with stuff they don't understand.

Your postfix should have come with a large amount of documentation and comments directly in the main.cf file, if it didn't, then find one of the originals that did because the documentation in that file is fantastic. Fortunately, Postfix has some pretty good defaults and you don't have to do much for a basic setup. All this really depends on what you are doing so I'll just explain how each of the parameters is used as you asked.

  • mydomain and myhostname - these aren't really used directly AFAIK, they more like variables that can be used later in other parts of the config file. If I'm not doing something like virtual domain hosting, I usually try to set the hostname of the machine to something sane and let these be defined for me.
  • myorigin - This is what will be put in the Received header lines and also if you don't specify a fully qualified from address it is what will be used as the domain for outgoing e-mail. So if you set this to by $myhostname and your username is xeoncross and you send out a message using the mail program or something, it will have a from address of xeoncross@yourhostname.
  • relayhost - This is where you get into the juicy bits of SMTP. If you don't understand what an MX record is and you have an interest in creating servers on the Internet, I suggest reading the first few chapters of DNS & Bind by O'Reilly to understand how it works. The quick and short of it is that by default, messages that you address to [email protected] will be sent out according to what the MX records for theirdomain.com are and if you don't have relayhost set to something, they will be sent out directly from this server that you are configuring. That may or may not work depending on your network setup, ISP, etc. If you instead want to relay that email through your local SMTP server, you can set relayhost to the hostname of that server and your postfix server will "relay" it to that server for sending on to its final destination.
  • mynetworks - This configures postfix to receive and relay mail to other domains from whatever networks you specify here. It uses CIDR notation, which you should probably also read about if you don't know about that. Basically, 127.0.0.1/8 means to accept mail for relaying from the local interface on the machine, which is probably safest initially. If you later need to allow other machines on your network to relay mail through this machine, then you might set this to something like 10.0.0.0/24 or even a.b.c.0/24 where a.b.c is your IPv4 netblock.
  • mailbox_size_limit - You can limit how large a mailbox can grow. If you control the server and have modern disks and don't really care about quotas, etc., just set this to 0 for "no limit".
  • recipient_delimiter - This is where someone else should help you because I don't have enough experience with this. Basically, its a way of allowing a user to have things happen on their account. So if this was set to '+' then a local user on the machine could do things by having people send e-mail to xeoncross+foo@yourhostname. I haven't used those things since the days of qmail, and then I barely knew what they did. You can probably ignore it and if you need to do anything special just use procmail or maildrop.
  • inet_interfaces - This specifies which interfaces on your machine that postfix should listen on for receiving e-mail. If you are familiar with Apache's configuration, its like the Listen directive.

All the Postfix configuration parameters are documented in postconf(5).

If you prefer reading on the web, http://www.postfix.org/postconf.5.html has all the information. http://www.postfix.org/postconf.5.html#mydomain will jump to the entry for mydomain in the manual.

Good luck.