Discussion:
postfix without berkeleydb support
(too old to reply)
Eray Aslan
2012-01-17 15:09:53 UTC
Permalink
I have requests from users to build postfix without BerkeleyDB support.
Usual complaint is that they are running in a resource constrained
environment, that tinycdb is enough, that BerkeleyDB is bloated, that
they are not using hash or btree lookups etc. This is on Linux by the
way.

Is this an acceptable feature request?
--
Eray Aslan
Wietse Venema
2012-01-17 16:40:25 UTC
Permalink
Post by Eray Aslan
I have requests from users to build postfix without BerkeleyDB support.
Usual complaint is that they are running in a resource constrained
environment, that tinycdb is enough, that BerkeleyDB is bloated, that
they are not using hash or btree lookups etc. This is on Linux by the
way.
Is this an acceptable feature request?
No problem. This is a three-line change in sys_defs.h and two lines
of documentation in makedefs. There probably needs to be some
documentation in DB_README.html as well.

I'm not sure though if Postfix is the smallest-possible MTA. It's
while since I ran it on 32MB machines.

Wietse

*** /var/tmp/postfix-2.9-20120115/src/util/sys_defs.h Sun Nov 13 19:35:34 2011
--- src/util/sys_defs.h Tue Jan 17 11:29:55 2012
***************
*** 1432,1437 ****
--- 1432,1441 ----
#undef HAVE_POSIX_GETPW_R
#endif

+ #ifdef NO_DB
+ #undef HAS_DB
+ #endif
+
#ifndef OCTAL_TO_UNSIGNED
#define OCTAL_TO_UNSIGNED(res, str) ((res) = strtoul((str), (char **) 0, 8))
#endif
*** /var/tmp/postfix-2.9-20120115/makedefs Sun Jan 8 12:08:41 2012
--- makedefs Tue Jan 17 11:28:37 2012
***************
*** 25,30 ****
--- 25,32 ----
# \fIinclude\fR directory.
# The following directives are special:
# .RS
+ # .IP \fB-DNO_DB\fR
+ # Do not build with Berkeley DB support.
# .IP \fB-DNO_DEVPOLL\fR
# Do not build with Solaris /dev/poll support.
# By default, /dev/poll support is compiled in on platforms that
Eray Aslan
2012-01-17 19:45:19 UTC
Permalink
Post by Wietse Venema
No problem. This is a three-line change in sys_defs.h and two lines
of documentation in makedefs. There probably needs to be some
documentation in DB_README.html as well.
Thank you. I also needed this 2 line patch:

--- a/src/global/mail_params.c
+++ b/src/global/mail_params.c
@@ -175,6 +175,8 @@
#include <mymalloc.h>
#ifdef HAS_DB
#include <dict_db.h>
+#else
+#include <dict.h>
#endif
#include <inet_proto.h>
#include <vstring_vstream.h>

to avoid:
[...]
gcc -Wmissing-prototypes -Wformat -DNO_DB -DHAS_PCRE -DSNAPSHOT -g -O
-I. -I../../include -DLINUX3 -c mail_params.c
mail_params.c: In function 'mail_params_init':
mail_params.c:662:2: error: 'dict_allow_surrogate' undeclared (first use
in this function)
mail_params.c:662:2: note: each undeclared identifier is reported only
once for each function it appears in
make: *** [mail_params.o] Error 1
make: *** [update] Error 1


Perhaps this is adequate for documentation:

--- a/proto/DB_README.html
+++ b/proto/DB_README.html
@@ -33,7 +33,10 @@ before 2.0. </p>

<ol>

-<li> <p> How to build Postfix on <a href="#no_db">systems without
+<li> <p> How to build Postfix <a href="#no_db">without
+Berkeley DB library</a>. </p>
+
+<li> <p> How to build Postfix <a href="#with_db">with
Berkeley DB library</a>. </p>

<li> <p> How to build Postfix on <a href="#bsd">BSD</a> or <a
@@ -46,7 +49,24 @@ versions. </p>

</ol>

-<h2><a name="no_db">Building Postfix on systems without Berkeley
+<h2><a name="no_db">Building Postfix without Berkeley
+DB</a></h2>
+
+<p> To build Postfix without Berkeley DB support, use something
+like: </p>
+
+<blockquote>
+<pre>
+% make tidy
+% make makefiles CCARGS="-DNO_DB"
+% make
+</pre>
+</blockquote>
+
+<p> Warning: without Berkeley DB, postfix will not be able to use
+hash or btree lookup table types.</p>
+
+<h2><a name="with_db">Building Postfix with Berkeley
DB</a></h2>

<p> Some UNIXes ship without Berkeley DB support; for historical
--- a/proto/INSTALL.html
+++ b/proto/INSTALL.html
@@ -372,6 +372,10 @@ Specifies non-default compiler arguments, for example, a non-default
<tt>include</tt> directory. The following directives turn
off Postfix features at compile time:</td> </tr>

+<tr> <td> </td> <td> -DNO_DB </td> <td> Do not build with Berkeley
+DB support. By default, Berkeley DB support is compiled in on platforms
+that are known to support this feature. </td> </tr>
+
<tr> <td> </td> <td> -DNO_DEVPOLL </td> <td> Do not build with
Solaris <tt>/dev/poll</tt> support. By default, <tt>/dev/poll</tt>
support is compiled in on Solaris versions that are known to support
--
Eray Aslan
Benny Pedersen
2012-01-23 01:11:38 UTC
Permalink
Post by Eray Aslan
Is this an acceptable feature request?
in gentoo/funtoo:

USE="-berkdb cdb" emerge postfix

done :)

Loading...