If the value for mynetworks is contained in a file rather than hardcoded into main.cf, as per this example from the documentation...

mynetworks = $config_directory/mynetworks

... is it necessary to reload Postfix when the contents of that file changes, or will any changes be picked up immediately?

For those who prefer a longer question, with more background behind it, the reason I'm asking is because the server on which Postfix is running is the outbound relay for a network on an IP which changes regularly. So I want to update mynetworks automatically when that IP changes.

I know I could solve the problem by using authentication, but a lot of the outbound email is generated by cron scripts on a server inside the network, and rewriting all of them to authenticate when sending mail is likely to be considerably more effort than updating mynetworks as and when the IP changes.

I already have a system which changes the destination of inbound mail via transport maps, using a MySQL table that is updated from inside the network - whenever it detects that its public IP has changed, it changes the destination value to be that IP. That's fine for inbound mail, as there's only ever one IP address in the lookup table. But outbound mail requires more than one IP in mynetworks, and also currently has a mix of single IPs and subnets (since the server is a relay for more than one location). So a MySQL lookup table would be more problematic as making that handle CIDR lookups is non-trivial.

The best solution, therefore, seems to be to store mynetworks in a flat file, and just update its contents when the public IP of the network changes. That's a relatively simple programming task. But then the question is, do I need to reload Postfix when I update the contents, or will changes be picked up automatically?

Alternatively, given this background information, can anyone suggest a better way of achieving my goals?

Mark
--
My blog: http://mark.goodge.co.uk

Reply via email to