2

I'm wondering if is it possible to specify another main.cf for the configuration of smptd service in another port paired with normal config in standard port.

I know that is it possible to override main.cf settings in master.cf using the -o <key>=<value> parameter for smtpd service definitions but I'm asking for a way to directly tell to smtpd to read another main configuration file.

Can it be done?

theist
  • 1,229
  • 2
  • 10
  • 24

3 Answers3

1

A quick look through the source code leads me to believe that this isn't possible with the native distro package.

The filename main.cf is hard-coded in several places.

You could try modifying the source before compiling it (sed -ri 's/main.cf/mymain.cf/') but I doubt that'll work without a hitch.

TL;DR: Make a file link (ln).

Belmin Fernandez
  • 10,799
  • 27
  • 84
  • 148
  • No, It is not just keep the config in another file. I want different configs on different ports, but thanks for the code review :). It is a good way to understand what can be done – theist Jul 04 '14 at 07:14
0

http://www.postfix.org/MULTI_INSTANCE_README.html describes how to use postmulti(1).

mschuett
  • 3,146
  • 21
  • 21
0

Postfix uses two hard-coded filename for its config main.cf and master.cf (See @Belmin answer).

If your purpose is running postfix via cli with specific file configuration (like ./someprograms -c myconfigfile.cf), you can use -C parameter. Instead a file name, you can specify a directory where main.cf and master.cf reside. So if you have main.cf and master.cf inside a directory /etc/anotherpostfixconf/, then you can start posfix by

postfix -C /etc/anotherpostfixconf/

See Postfix manual - postfix(1) for further explanation.

masegaloeh
  • 18,236
  • 10
  • 57
  • 106