Discussion:
Postfix and forward/alias handle with MySQL
(too old to reply)
a***@gmail.com
2015-10-05 14:29:40 UTC
Permalink
Hi,

I can't find any explicit answer to my simple question.

Using postfix and text configuration files, anytime you add an alias, you need to restart/reload postfix. This way postfix rebuild its internal hash table.


I wonder if this restart is still needed with a MySQL database storing aliases ?

Thanks in advance for your help.
Rob Brown
2015-10-05 21:20:20 UTC
Permalink
Post by a***@gmail.com
Using postfix and text configuration files, anytime you add an alias,
you need to restart/reload postfix. This way postfix rebuild its
internal hash table.
I wonder if this restart is still needed with a MySQL database
storing aliases ?
Dunno. I use the Berkley DB for my aliases:

[***@libra ~]$ file /etc/aliases /etc/aliases.db
/etc/aliases: ASCII English text
/etc/aliases.db: Berkeley DB (Hash, version 8, native byte-order)

When I change the text file, I just issue the newaliases command to
create a new .db file. I don't restart postfix. Things work.
a***@gmail.com
2015-10-06 08:06:36 UTC
Permalink
Post by Rob Brown
Post by a***@gmail.com
Using postfix and text configuration files, anytime you add an alias,
you need to restart/reload postfix. This way postfix rebuild its
internal hash table.
I wonder if this restart is still needed with a MySQL database storing aliases ?
/etc/aliases: ASCII English text
/etc/aliases.db: Berkeley DB (Hash, version 8, native byte-order)
When I change the text file, I just issue the newaliases command to
create a new .db file. I don't restart postfix. Things work.
Thanks for your answer.

My problem is that we need to call newaliases (and reload to speed up the availability of aliases).
But what I want to achieve, is the creation of new aliases without the need to issue any command on the server.
a***@gmail.com
2015-10-06 08:22:45 UTC
Permalink
Post by a***@gmail.com
Post by Rob Brown
Post by a***@gmail.com
Using postfix and text configuration files, anytime you add an alias,
you need to restart/reload postfix. This way postfix rebuild its
internal hash table.
I wonder if this restart is still needed with a MySQL database storing aliases ?
/etc/aliases: ASCII English text
/etc/aliases.db: Berkeley DB (Hash, version 8, native byte-order)
When I change the text file, I just issue the newaliases command to
create a new .db file. I don't restart postfix. Things work.
Thanks for your answer.
My problem is that we need to call newaliases (and reload to speed up the availability of aliases).
But what I want to achieve, is the creation of new aliases without the need to issue any command on the server.
"When you make changes to a database while the mail system is running, it would be desirable if Postfix avoids reading information while that information is being changed. It would also be nice if you can change a database without having to execute "postfix reload", in order to force Postfix to use the new information. Each time you do "postfix reload" Postfix loses a lot of performance.

If you change a network database such as LDAP, NIS or SQL, there is no need to execute "postfix reload". The LDAP, NIS or SQL server takes care of read/write access conflicts and gives the new data to Postfix once that data is available."

http://www.postfix.org/DATABASE_README.html

Finally found part of the answer. New aliases seems available on the fly if you use a network database such as MySQL.
Loading...