I am working for quite some time with postfix and I wanted to understand how can I implement a lookup table similar to the one postfix has.
I will try to be more specific about the details:
Postfix has the next functionality: http://www.postfix.org/DATABASE_README.html
Which is based on some kind of lookup table compilation using a command like
postmap /postfix/aliases (local aliasing)
postmap /postfix/header_checks (content filtering)
postmap /postfix/transport (routing table)
postmap /postfix/virtual (address rewriting)
And when I am using the file tool to understand what DB post uses I see that it's BDB ie:
$ ls|grep db|xargs -l1 file
generic_maps.db: Berkeley DB (Hash, version 9, native byte-order)
postscreen_access.cidr.db: Berkeley DB (Hash, version 9, native byte-order)
rbl_override.db: Berkeley DB (Hash, version 9, native byte-order)
saslpass.db: Berkeley DB (Hash, version 9, native byte-order)
transport.db: Berkeley DB (Btree, version 9, native byte-order)
Now I am trying to understand how exactly postfix uses these BDB files to store regex?
The answer that I was thinking about was that they are using a key->value storage and
postfix loads all the keys into ram.
I assume that the order of the rules is important.
I am asking since I am not a C expert and every time I sit to read any C code my head starts to spin in circles and twist and GoLang for me is much easier.
Thanks,
Eliezer
----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: eli...@ngtech.co.il
