Christian R??ner via Postfix-devel: > Hello, > > > Am 20.12.2024 um 19:26 schrieb Wietse Venema via Postfix-devel > > <postfix-devel@postfix.org>: > > > > Christian Roessner via Postfix-devel: > >> Hi, > >> > >> why does exist a hard coded limit of 100000 characters in the > >> netstring payload for socket maps? I have a customer who uses a > >> socketmap for virtual aliases and he had to switch to the memcache > >> protocol (he wrote a service speaking memcache) to workaround this > >> issue, because memcache values seem not to have this limit. > > > > Even memcached has limits, he just hasn't run into them. > > > > Postfix virtual aliases have multiple limits. In fact, Postfix has > > limits for everything, to prevent one bad actior from locking up > > the entire server. > > > >> Would it be possible to either drop this limit, > > > > Sorry, that would make Postfix vulnerable by default, and that is > > undesirable. > > > >> set it higher it or have a configuration parameter for it? > > > > It could be made configurable. For an example of this, see how the > > "berkeley_db_read_buffer_size" configuration parameter controls a > > global variable in the dict_db.c module. > > > > Such a global variable already exists in dict_sockmap.c. > > It is about 25 years ago that I did C-programming, so please be nice to me, > if my first attempt is not perfect ;-) > > Could you please give me a hint, if the following approach goes into the > right direction?
Very close; the dict_sockmap_max_reply variable can be owned by the dict_sockmap class, and exported by the header file for that class. dict_sockmap.c: replace: int dict_sockmap_max_reply; with: int dict_sockmap_max_reply = 100000; (to test the dict_db.c code without linking it with the rest of Postfix). dict_sockmap.h: add: extern int dict_sockmap_max_reply; mail_params.h: remove: extern int dict_sockmap_max_reply; mail_params.c: add: #include <dict_sockmap.h> mail_params.c: remove: int dict_sockmap_max_reply; Wietse _______________________________________________ Postfix-devel mailing list -- postfix-devel@postfix.org To unsubscribe send an email to postfix-devel-le...@postfix.org