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?
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
).http://www.postfix.org/MULTI_INSTANCE_README.html describes how to use postmulti(1).
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 bySee Postfix manual - postfix(1) for further explanation.