Postfix mynetworks question

I've always been a bit suspect of the Postfix mynetworks option - should it not be myhosts?

That aside, my real question is this:

If I am specifying mynetworks and want to include single hosts (like my Linodes and not everyone else at the data centre), do I just put the IP addresses in thus?

mynetworks = 127.0.0.0/8, 192.168.1.9, 10.8.6.88

2 Replies

I think you can use normal IP addresses. This was cut and pasted from ORA's Postfix, the Definitive Guide:

> By default Postfix is not an open relay. The parameters mynetworksstyle and mynetworks determine what other systems can use your mail server to send messages. The default configuration allows relaying only from other machines that are connected to the same IP subnet as your server. You can limit or broaden the range of addresses that should be allowed to relay by setting the parameter mynetworksstyle. If you prefer to limit relaying to the local machine only, set mynetworksstyle to "host". You can also set mynetworksstyle to "class" to allow relaying by any host within the same class A, B, or C network as your server. For many networks a class setting opens relaying to too many systems. If you aren't familiar with IP address classes, stick to the default "subnet" or more restrictive "host" settings.

Alternatively, you can explicitly indicate the hosts that should be allowed to relay mail by setting mynetworks. If you set mynetworks, the mynetworks_style parameter is ignored. You can list individual IP addresses or specify subnets using the network/netmask notation – for example, 192.168.100.0/28. This parameter is handy if you need to provide mail relay to hosts outside of your network because you can list specific IP addresses regardless of their relationship to your own subnet. If, for example, you want to provide relaying to remote users, you simply add an IP address to your list. In this case, your remote users need a static IP address, or at least an address assigned from a limited range of addresses. If your remote users do not have static IP addresses, then you have to configure some kind of SMTP authentication.

Thanks - that's pretty much what I wanted.

I keep forgetting about my Safari subscription - I must get that book in my online bookcase an have a look. Thanks for the pointer to that, too.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct