summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Stevens <paul@nfg.nl>2007-12-18 12:37:31 +0000
committerPaul Stevens <paul@nfg.nl>2007-12-18 12:37:31 +0000
commit0f2397ca6ce7cfcfdb055b3458778b786335bdc6 (patch)
treea7c386a5a738d0184c281a5702e07523dd033b5d
parent5e2b85c4b71095a9eda27da07552f7be9607606e (diff)
merging cleantree
git-svn-id: https://svn.ic-s.nl/svn/dbmail/trunk/dbmail@2881 7b491191-dbf0-0310-aff6-d879d4d69008
-rw-r--r--ChangeLog82
-rw-r--r--Makefile.am198
-rw-r--r--README2
-rw-r--r--acinclude.m4358
-rw-r--r--configure.in72
-rw-r--r--dbmail.supp348
-rwxr-xr-xdebian/rules2
-rw-r--r--doc/README.aliases (renamed from README.aliases)0
-rw-r--r--doc/README.exim (renamed from README.exim)0
-rw-r--r--doc/README.ldap (renamed from README.ldap)0
-rw-r--r--doc/README.postfix (renamed from README.postfix)0
-rw-r--r--doc/README.qmail (renamed from README.qmail)0
-rw-r--r--doc/README.sieve (renamed from README.sieve)0
-rw-r--r--doc/README.smtp (renamed from README.smtp)0
-rw-r--r--doc/README.solaris (renamed from README.solaris)0
-rw-r--r--doc/README.usermap (renamed from README.usermap)0
-rw-r--r--src/Makefile.am127
-rw-r--r--src/auth.h (renamed from auth.h)0
-rw-r--r--src/authmodule.c (renamed from authmodule.c)0
-rw-r--r--src/authmodule.h (renamed from authmodule.h)0
-rw-r--r--src/dbmail-imapsession.c (renamed from dbmail-imapsession.c)0
-rw-r--r--src/dbmail-imapsession.h (renamed from dbmail-imapsession.h)0
-rw-r--r--src/dbmail-mailbox.c (renamed from dbmail-mailbox.c)0
-rw-r--r--src/dbmail-mailbox.h (renamed from dbmail-mailbox.h)0
-rw-r--r--src/dbmail-message.c (renamed from dbmail-message.c)0
-rw-r--r--src/dbmail-message.h (renamed from dbmail-message.h)0
-rw-r--r--src/dbmail-user.c (renamed from dbmail-user.c)0
-rw-r--r--src/dbmail-user.h (renamed from dbmail-user.h)0
-rw-r--r--src/dbmail.h.in (renamed from dbmail.h.in)0
-rw-r--r--src/dbmailtypes.h (renamed from dbmailtypes.h)0
-rw-r--r--src/dbmodule.c (renamed from dbmodule.c)0
-rw-r--r--src/dbmodule.h (renamed from dbmodule.h)0
-rw-r--r--src/dm_acl.c (renamed from dm_acl.c)0
-rw-r--r--src/dm_acl.h (renamed from dm_acl.h)0
-rw-r--r--src/dm_base64.c (renamed from dm_base64.c)0
-rw-r--r--src/dm_base64.h (renamed from dm_base64.h)0
-rw-r--r--src/dm_cidr.c (renamed from dm_cidr.c)0
-rw-r--r--src/dm_cidr.h (renamed from dm_cidr.h)0
-rw-r--r--src/dm_config.c (renamed from dm_config.c)0
-rw-r--r--src/dm_db.c (renamed from dm_db.c)0
-rw-r--r--src/dm_db.h (renamed from dm_db.h)0
-rw-r--r--src/dm_debug.c (renamed from dm_debug.c)0
-rw-r--r--src/dm_debug.h (renamed from dm_debug.h)0
-rw-r--r--src/dm_dsn.c (renamed from dm_dsn.c)0
-rw-r--r--src/dm_dsn.h (renamed from dm_dsn.h)0
-rw-r--r--src/dm_getopt.c (renamed from dm_getopt.c)0
-rw-r--r--src/dm_getopt.h (renamed from dm_getopt.h)0
-rw-r--r--src/dm_iconv.c (renamed from dm_iconv.c)0
-rw-r--r--src/dm_iconv.h (renamed from dm_iconv.h)0
-rw-r--r--src/dm_list.c (renamed from dm_list.c)0
-rw-r--r--src/dm_list.h (renamed from dm_list.h)0
-rw-r--r--src/dm_match.c (renamed from dm_match.c)0
-rw-r--r--src/dm_match.h (renamed from dm_match.h)0
-rw-r--r--src/dm_md5.c (renamed from dm_md5.c)0
-rw-r--r--src/dm_md5.h (renamed from dm_md5.h)0
-rw-r--r--src/dm_memblock.c (renamed from dm_memblock.c)0
-rw-r--r--src/dm_memblock.h (renamed from dm_memblock.h)0
-rw-r--r--src/dm_misc.c (renamed from dm_misc.c)0
-rw-r--r--src/dm_misc.h (renamed from dm_misc.h)0
-rw-r--r--src/dm_pidfile.c (renamed from dm_pidfile.c)0
-rw-r--r--src/dm_pipe.c (renamed from dm_pipe.c)0
-rw-r--r--src/dm_pipe.h (renamed from dm_pipe.h)0
-rw-r--r--src/dm_quota.c (renamed from dm_quota.c)0
-rw-r--r--src/dm_quota.h (renamed from dm_quota.h)0
-rw-r--r--src/dm_sha1.c (renamed from dm_sha1.c)0
-rw-r--r--src/dm_sha1.h (renamed from dm_sha1.h)0
-rw-r--r--src/export.c (renamed from export.c)0
-rw-r--r--src/imap4.c (renamed from imap4.c)0
-rw-r--r--src/imap4.h (renamed from imap4.h)0
-rw-r--r--src/imapcommands.c (renamed from imapcommands.c)0
-rw-r--r--src/imapcommands.h (renamed from imapcommands.h)0
-rw-r--r--src/imapd.c (renamed from imapd.c)0
-rw-r--r--src/lmtp.c (renamed from lmtp.c)0
-rw-r--r--src/lmtp.h (renamed from lmtp.h)0
-rw-r--r--src/lmtpd.c (renamed from lmtpd.c)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/maintenance.c (renamed from maintenance.c)0
-rw-r--r--src/modules/Makefile.am (renamed from modules/Makefile.am)4
-rw-r--r--src/modules/authldap.c (renamed from modules/authldap.c)0
-rw-r--r--src/modules/authsql.c (renamed from modules/authsql.c)0
-rw-r--r--src/modules/dbingres.c (renamed from modules/dbingres.c)0
-rw-r--r--src/modules/dbmysql.c (renamed from modules/dbmysql.c)0
-rw-r--r--src/modules/dbpgsql.c (renamed from modules/dbpgsql.c)0
-rw-r--r--src/modules/dbsqlite.c (renamed from modules/dbsqlite.c)0
-rw-r--r--src/modules/sortnull.c (renamed from modules/sortnull.c)0
-rw-r--r--src/modules/sortsieve.c (renamed from modules/sortsieve.c)0
-rw-r--r--src/pop3.c (renamed from pop3.c)0
-rw-r--r--src/pop3.h (renamed from pop3.h)0
-rw-r--r--src/pop3d.c (renamed from pop3d.c)0
-rw-r--r--src/server.c (renamed from server.c)0
-rw-r--r--src/server.h (renamed from server.h)0
-rw-r--r--src/serverchild.c (renamed from serverchild.c)0
-rw-r--r--src/serverchild.h (renamed from serverchild.h)0
-rw-r--r--src/serverparent.c (renamed from serverparent.c)0
-rw-r--r--src/serverparent.h (renamed from serverparent.h)0
-rw-r--r--src/serverpool.c (renamed from serverpool.c)0
-rw-r--r--src/serverpool.h (renamed from serverpool.h)0
-rw-r--r--src/serversession.c (renamed from serversession.c)0
-rw-r--r--src/serversession.h (renamed from serversession.h)0
-rw-r--r--src/sievecmd.c (renamed from sievecmd.c)0
-rw-r--r--src/sort.c (renamed from sort.c)0
-rw-r--r--src/sort.h (renamed from sort.h)0
-rw-r--r--src/sortmodule.c (renamed from sortmodule.c)0
-rw-r--r--src/sortmodule.h (renamed from sortmodule.h)0
-rw-r--r--src/timsieve.c (renamed from timsieve.c)0
-rw-r--r--src/timsieve.h (renamed from timsieve.h)0
-rw-r--r--src/timsieved.c (renamed from timsieved.c)0
-rw-r--r--src/top.c (renamed from top.c)0
-rw-r--r--src/user.c (renamed from user.c)0
-rw-r--r--test/Makefile.am86
-rw-r--r--test/check_dbmail.h (renamed from check_dbmail.h)0
-rw-r--r--test/check_dbmail_auth.c (renamed from check_dbmail_auth.c)0
-rw-r--r--test/check_dbmail_common.c (renamed from check_dbmail_common.c)0
-rw-r--r--test/check_dbmail_db.c (renamed from check_dbmail_db.c)0
-rw-r--r--test/check_dbmail_deliver.c (renamed from check_dbmail_deliver.c)0
-rw-r--r--test/check_dbmail_dsn.c (renamed from check_dbmail_dsn.c)0
-rw-r--r--test/check_dbmail_imapd.c (renamed from check_dbmail_imapd.c)0
-rw-r--r--test/check_dbmail_list.c (renamed from check_dbmail_list.c)0
-rw-r--r--test/check_dbmail_mailbox.c (renamed from check_dbmail_mailbox.c)0
-rw-r--r--test/check_dbmail_message.c (renamed from check_dbmail_message.c)0
-rw-r--r--test/check_dbmail_misc.c (renamed from check_dbmail_misc.c)0
-rw-r--r--test/check_dbmail_server.c (renamed from check_dbmail_server.c)0
-rw-r--r--test/check_dbmail_user.c (renamed from check_dbmail_user.c)0
-rw-r--r--test/check_dbmail_util.c (renamed from check_dbmail_util.c)0
124 files changed, 457 insertions, 822 deletions
diff --git a/ChangeLog b/ChangeLog
index fa5155c3..72468bc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,85 @@
+2007-12-18 Paul J Stevens <paul@nfg.nl>
+
+ * Makefile.am, README, README.aliases, README.exim, README.ldap,
+ README.postfix, README.qmail, README.sieve, README.smtp,
+ README.solaris, README.usermap, acinclude.m4, auth.h, authmodule.c,
+ authmodule.h, check_dbmail.h, check_dbmail_auth.c,
+ check_dbmail_common.c, check_dbmail_db.c, check_dbmail_deliver.c,
+ check_dbmail_dsn.c, check_dbmail_imapd.c, check_dbmail_list.c,
+ check_dbmail_mailbox.c, check_dbmail_message.c, check_dbmail_misc.c,
+ check_dbmail_server.c, check_dbmail_user.c, check_dbmail_util.c,
+ configure.in, dbmail-imapsession.c, dbmail-imapsession.h,
+ dbmail-mailbox.c, dbmail-mailbox.h, dbmail-message.c,
+ dbmail-message.h, dbmail-user.c, dbmail-user.h, dbmail.h.in,
+ dbmail.supp, dbmailtypes.h, dbmodule.c, dbmodule.h, debian/rules,
+ dm_acl.c, dm_acl.h, dm_base64.c, dm_base64.h, dm_cidr.c, dm_cidr.h,
+ dm_config.c, dm_db.c, dm_db.h, dm_debug.c, dm_debug.h, dm_dsn.c,
+ dm_dsn.h, dm_getopt.c, dm_getopt.h, dm_iconv.c, dm_iconv.h,
+ dm_list.c, dm_list.h, dm_match.c, dm_match.h, dm_md5.c, dm_md5.h,
+ dm_memblock.c, dm_memblock.h, dm_misc.c, dm_misc.h, dm_pidfile.c,
+ dm_pipe.c, dm_pipe.h, dm_quota.c, dm_quota.h, dm_sha1.c, dm_sha1.h,
+ doc/README.aliases, doc/README.exim, doc/README.ldap,
+ doc/README.postfix, doc/README.qmail, doc/README.sieve,
+ doc/README.smtp, doc/README.solaris, doc/README.usermap, export.c,
+ imap4.c, imap4.h, imapcommands.c, imapcommands.h, imapd.c, lmtp.c,
+ lmtp.h, lmtpd.c, main.c, maintenance.c, modules/Makefile.am,
+ modules/authldap.c, modules/authsql.c, modules/dbingres.c,
+ modules/dbmysql.c, modules/dbpgsql.c, modules/dbsqlite.c,
+ modules/sortnull.c, modules/sortsieve.c, pop3.c, pop3.h, pop3d.c,
+ server.c, server.h, serverchild.c, serverchild.h, serverparent.c,
+ serverparent.h, serverpool.c, serverpool.h, serversession.c,
+ serversession.h, sievecmd.c, sort.c, sort.h, sortmodule.c,
+ sortmodule.h, src/Makefile.am, src/auth.h, src/authmodule.c,
+ src/authmodule.h, src/dbmail-imapsession.c, src/dbmail-imapsession.h,
+ src/dbmail-mailbox.c, src/dbmail-mailbox.h, src/dbmail-message.c,
+ src/dbmail-message.h, src/dbmail-user.c, src/dbmail-user.h,
+ src/dbmail.h.in, src/dbmailtypes.h, src/dbmodule.c, src/dbmodule.h,
+ src/dm_acl.c, src/dm_acl.h, src/dm_base64.c, src/dm_base64.h,
+ src/dm_cidr.c, src/dm_cidr.h, src/dm_config.c, src/dm_db.c,
+ src/dm_db.h, src/dm_debug.c, src/dm_debug.h, src/dm_dsn.c,
+ src/dm_dsn.h, src/dm_getopt.c, src/dm_getopt.h, src/dm_iconv.c,
+ src/dm_iconv.h, src/dm_list.c, src/dm_list.h, src/dm_match.c,
+ src/dm_match.h, src/dm_md5.c, src/dm_md5.h, src/dm_memblock.c,
+ src/dm_memblock.h, src/dm_misc.c, src/dm_misc.h, src/dm_pidfile.c,
+ src/dm_pipe.c, src/dm_pipe.h, src/dm_quota.c, src/dm_quota.h,
+ src/dm_sha1.c, src/dm_sha1.h, src/export.c, src/imap4.c, src/imap4.h,
+ src/imapcommands.c, src/imapcommands.h, src/imapd.c, src/lmtp.c,
+ src/lmtp.h, src/lmtpd.c, src/main.c, src/maintenance.c,
+ src/modules/Makefile.am, src/modules/authldap.c,
+ src/modules/authsql.c, src/modules/dbingres.c, src/modules/dbmysql.c,
+ src/modules/dbpgsql.c, src/modules/dbsqlite.c,
+ src/modules/sortnull.c, src/modules/sortsieve.c, src/pop3.c,
+ src/pop3.h, src/pop3d.c, src/server.c, src/server.h,
+ src/serverchild.c, src/serverchild.h, src/serverparent.c,
+ src/serverparent.h, src/serverpool.c, src/serverpool.h,
+ src/serversession.c, src/serversession.h, src/sievecmd.c, src/sort.c,
+ src/sort.h, src/sortmodule.c, src/sortmodule.h, src/timsieve.c,
+ src/timsieve.h, src/timsieved.c, src/top.c, src/user.c,
+ test/Makefile.am, test/check_dbmail.h, test/check_dbmail_auth.c,
+ test/check_dbmail_common.c, test/check_dbmail_db.c,
+ test/check_dbmail_deliver.c, test/check_dbmail_dsn.c,
+ test/check_dbmail_imapd.c, test/check_dbmail_list.c,
+ test/check_dbmail_mailbox.c, test/check_dbmail_message.c,
+ test/check_dbmail_misc.c, test/check_dbmail_server.c,
+ test/check_dbmail_user.c, test/check_dbmail_util.c, timsieve.c,
+ timsieve.h, timsieved.c, top.c, user.c:
+ merging cleantree
+
+ This re-organizes the whole code-tree drastically, emptying the
+ tree-root and moving all code into subdirs.
+
+2007-12-17 Paul Stevens <paul@nfg.nl>
+
+ * ChangeLog, modules/dbmysql.c:
+ use last_insert_id() rather than mysql_insert_id to retrieve last
+ auto_increment
+ * check_dbmail_message.c, dbmail-mailbox.c:
+ add a missing case of dm_strtoull in dbmail_mailbox_get_set
+ * check_dbmail_imapd.c, dbmail-message.c:
+ do not add From_ header as part of the message during insertion
+ * debian/rules:
+ minor change
+
2007-12-17 Paul J Stevens <paul@nfg.nl>
* modules/dbmysql.c:
diff --git a/Makefile.am b/Makefile.am
index c0600f59..4a41b52c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,203 +1,7 @@
-# Copyright (C) 1999-2004 IC & S dbmail@ic-s.nl
-# Copyright (c) 2004-2006 NFG Net Facilities Group BV support@nfg.nl
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-SUBDIRS = modules
+SUBDIRS = src test
if MANPAGES
SUBDIRS += man
endif
-if SIEVE
-SIEVEPROGS = dbmail-sievecmd dbmail-timsieved
-endif
-
-if USE_DM_GETOPT
-DM_GETOPT = dm_getopt.c
-endif
-
-
-sbin_PROGRAMS = dbmail-smtp \
- dbmail-pop3d \
- dbmail-imapd \
- dbmail-top \
- dbmail-util \
- dbmail-users \
- dbmail-export \
- dbmail-lmtpd $(SIEVEPROGS)
-
-COMMON = dbmail-user.c \
- dbmail-message.c \
- dbmail-mailbox.c \
- dm_config.c \
- dm_debug.c \
- dm_list.c \
- dm_db.c \
- dm_acl.c \
- dm_misc.c \
- dm_pidfile.c \
- dm_md5.c \
- dm_sha1.c \
- dm_match.c \
- dm_iconv.c \
- dm_base64.c $(DM_GETOPT)
-
-SERVER = server.c \
- serverchild.c \
- serverparent.c \
- serverpool.c \
- dm_cidr.c
-
-DELIVER = dm_pipe.c \
- dm_dsn.c \
- sort.c
-
-MODULES = dbmodule.c \
- authmodule.c \
- sortmodule.c
-
-IMAPD = dm_quota.c \
- dm_memblock.c \
- imap4.c \
- imapcommands.c \
- dbmail-imapsession.c
-
-AM_CFLAGS = @SIEVEINC@ @LDAPINC@
-
-INCLUDES = -I$(top_srcdir)
-
-
-dbmail_smtp_SOURCES = main.c
-dbmail_smtp_LDADD = libdbmail.la
-
-dbmail_pop3d_SOURCES = pop3.c pop3d.c
-dbmail_pop3d_LDADD = libdbmail.la
-
-dbmail_imapd_SOURCES = $(IMAPD) imapd.c
-dbmail_imapd_LDADD = libdbmail.la
-
-dbmail_top_SOURCES = top.c
-dbmail_top_LDADD = libdbmail.la -lncurses
-
-dbmail_util_SOURCES = maintenance.c
-dbmail_util_LDADD = libdbmail.la
-
-dbmail_users_SOURCES = user.c
-dbmail_users_LDADD = libdbmail.la
-
-dbmail_export_SOURCES = export.c dm_memblock.c dbmail-imapsession.c
-dbmail_export_LDADD = libdbmail.la
-
-dbmail_lmtpd_SOURCES = lmtp.c lmtpd.c
-dbmail_lmtpd_LDADD = libdbmail.la
-
-if SIEVE
-dbmail_sievecmd_SOURCES = sievecmd.c
-dbmail_sievecmd_LDADD = libdbmail.la
-
-dbmail_timsieved_SOURCES = timsieve.c timsieved.c
-dbmail_timsieved_LDADD = libdbmail.la
-endif
-
-pkglib_LTLIBRARIES = libdbmail.la
-
-
-if SHARED
-AM_LDFLAGS = -export-dynamic @CRYPTLIB@
-libdbmail_la_SOURCES = $(COMMON) $(SERVER) $(DELIVER) $(MODULES)
-else
-libdbmail_la_SOURCES = $(COMMON) $(SERVER) $(DELIVER)
-libdbmail_la_LIBADD = @MYSQLLTLIB@ @PGSQLLTLIB@ @SQLITELTLIB@ @INGRESLTLIB@ @SORTLTLIB@ @AUTHLTLIB@
-endif
-
-libdbmail_la_LDFLAGS = $(AM_LDFLAGS) @SOCKETLIB@
-libdbmail_la_CFLAGS = $(AM_CFLAGS)
-
-
-if WITHCHECK
-
-TESTS=check_dbmail_common \
- check_dbmail_server \
- check_dbmail_deliver \
- check_dbmail_imapd \
- check_dbmail_message \
- check_dbmail_mailbox \
- check_dbmail_auth \
- check_dbmail_misc \
- check_dbmail_list \
- check_dbmail_user \
- check_dbmail_util \
- check_dbmail_dsn \
- check_dbmail_db
-
-
-noinst_PROGRAMS=$(TESTS)
-
-check_dbmail_user_SOURCES=check_dbmail_user.c
-check_dbmail_user_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_user_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_auth_SOURCES=check_dbmail_auth.c
-check_dbmail_auth_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_auth_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_misc_SOURCES=check_dbmail_misc.c
-check_dbmail_misc_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_misc_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_list_SOURCES=check_dbmail_list.c
-check_dbmail_list_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_list_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_util_SOURCES=check_dbmail_util.c
-check_dbmail_util_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_util_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_dsn_SOURCES=check_dbmail_dsn.c
-check_dbmail_dsn_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_dsn_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_db_SOURCES=check_dbmail_db.c
-check_dbmail_db_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_db_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_common_SOURCES=check_dbmail_common.c
-check_dbmail_common_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_common_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_server_SOURCES=check_dbmail_server.c
-check_dbmail_server_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_server_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_deliver_SOURCES=check_dbmail_deliver.c
-check_dbmail_deliver_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_deliver_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_message_SOURCES=check_dbmail_message.c
-check_dbmail_message_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_message_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_mailbox_SOURCES=check_dbmail_mailbox.c
-check_dbmail_mailbox_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_mailbox_INCLUDES=@CHECK_CFLAGS@
-
-check_dbmail_imapd_SOURCES=$(IMAPD) check_dbmail_imapd.c
-check_dbmail_imapd_LDADD=libdbmail.la @CHECK_LIBS@
-check_dbmail_imapd_INCLUDES=@CHECK_CFLAGS@
-
-endif
diff --git a/README b/README
index 95fd26fd..7e11db2f 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
/*
(c) 2000-2005 IC&S, The Netherlands
- (c) 2004-2006 NFG Net Facilities Group BV, The Netherlands
+ (c) 2004-2008 NFG Net Facilities Group BV, The Netherlands
*/
What is it?
diff --git a/acinclude.m4 b/acinclude.m4
index 872401fc..005a958b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,41 +1,36 @@
-dnl DBMAIL_MSG_CONFIGURE_START()
-dnl
-AC_DEFUN([DBMAIL_MSG_CONFIGURE_START], [dnl
+AC_DEFUN([DM_MSG_CONFIGURE_START], [dnl
AC_MSG_RESULT([
This is dbmail's GNU configure script.
-It's going to run a bunch of strange tests to hopefully
-make your compile work without much twiddling.
])
])
-dnl DBMAIL_SET_VERSION
-AC_DEFUN([DBMAIL_SET_VERSION], [dnl
+AC_DEFUN([DM_SET_VERSION], [dnl
dbmail_version=`cat VERSION`
AC_DEFINE_UNQUOTED([DBMAIL_VERSION], "$dbmail_version", [Includes the micro version])
])
-dnl DBMAIL_MSG_CONFIGURE_RESULTS()
-dnl
-AC_DEFUN([DBMAIL_MSG_CONFIGURE_RESULTS], [dnl
+AC_DEFUN([DM_MSG_CONFIGURE_RESULTS], [dnl
AC_MSG_RESULT([
-DM_LOGDIR: $DM_LOGDIR
-DM_CONFDIR: $DM_CONFDIR
-DM_STATEDIR: $DM_STATEDIR
-USE_DM_GETOPT: $USE_DM_GETOPT
-CFLAGS: $CFLAGS
-GLIB: $ac_glib_libs
-GMIME: $ac_gmime_libs
-MYSQL: $MYSQLLIB
-PGSQL: $PGSQLLIB
-SQLITE: $SQLITELIB
-INGRES: $INGRESLIB
-SIEVE: $SIEVEINC$SIEVELIB
-LDAP: $LDAPINC$LDAPLIB
-SHARED: $enable_shared
-STATIC: $enable_static
-CHECK: $with_check
-SOCKETS: $SOCKETLIB
+
+ DM_LOGDIR: $DM_LOGDIR
+ DM_CONFDIR: $DM_CONFDIR
+ DM_STATEDIR: $DM_STATEDIR
+ USE_DM_GETOPT: $USE_DM_GETOPT
+ CFLAGS: $CFLAGS
+ GLIB: $ac_glib_libs
+ GMIME: $ac_gmime_libs
+ MYSQL: $MYSQLLIB
+ PGSQL: $PGSQLLIB
+ SQLITE: $SQLITELIB
+ INGRES: $INGRESLIB
+ SIEVE: $SIEVEINC$SIEVELIB
+ LDAP: $LDAPINC$LDAPLIB
+ SHARED: $enable_shared
+ STATIC: $enable_static
+ CHECK: $with_check
+ SOCKETS: $SOCKETLIB
+
])
])
@@ -44,34 +39,29 @@ AC_DEFUN([DM_DEFINES],[dnl
AC_ARG_WITH(logdir,
[ --with-logdir use logdir for logfiles],
logdirname="$withval")
- if test "x$logdirname" = "x"
- then
- DM_LOGDIR="/var/log"
- else
- DM_LOGDIR="$logdirname"
- fi
- if test "x$localstatedir" = 'x${prefix}/var'
- then
- DM_STATEDIR='/var/run'
- else
- DM_STATEDIR=$localstatedir
- fi
- if test "x$sysconfdir" = 'x${prefix}/etc'
- then
- DM_CONFDIR='/etc'
- else
- DM_CONFDIR=$sysconfdir
- fi
- if test "x$prefix" = "xNONE"
- then
- AC_DEFINE_UNQUOTED([PREFIX], "$ac_default_prefix", [Prefix to the installed path])
- else
- AC_DEFINE_UNQUOTED([PREFIX], "$prefix", [Prefix to the installed path])
- fi
+if test "x$logdirname" = "x"; then
+ DM_LOGDIR="/var/log"
+else
+ DM_LOGDIR="$logdirname"
+fi
+if test "x$localstatedir" = 'x${prefix}/var'; then
+ DM_STATEDIR='/var/run'
+else
+ DM_STATEDIR=$localstatedir
+fi
+if test "x$sysconfdir" = 'x${prefix}/etc'; then
+ DM_CONFDIR='/etc'
+else
+ DM_CONFDIR=$sysconfdir
+fi
+if test "x$prefix" = "xNONE"; then
+ AC_DEFINE_UNQUOTED([PREFIX], "$ac_default_prefix", [Prefix to the installed path])
+else
+ AC_DEFINE_UNQUOTED([PREFIX], "$prefix", [Prefix to the installed path])
+fi
])
-dnl DBMAIL_CHECK_SHARED_OR_STATIC
-AC_DEFUN([DBMAIL_SET_SHARED_OR_STATIC], [dnl
+AC_DEFUN([DM_SET_SHARED_OR_STATIC], [dnl
if test [ "$enable_shared" = "yes" -a "$enable_static" = "yes" ]; then
AC_MSG_ERROR([
You cannot enable both shared and static build.
@@ -79,14 +69,12 @@ if test [ "$enable_shared" = "yes" -a "$enable_static" = "yes" ]; then
])
fi
if test [ "$enable_shared" = "no" -a "$enable_static" = "no" ]; then
- enable_shared="yes"
+ enable_shared="yes"
fi
])
-
-dnl DBMAIL_BOTH_SQL_CHECK
-AC_DEFUN([DBMAIL_BOTH_SQL_CHECK], [dnl
+AC_DEFUN([DM_SQL_CHECK], [dnl
usemysql="no"
usepgsql="no"
@@ -94,20 +82,20 @@ usesqlite="no"
useingres="no"
AC_ARG_WITH(mysql,
- [ --with-mysql use MySQL as database. Uses mysql_config
- for finding includes and libraries],
+ [ --with-mysql use MySQL as database.
+ Uses mysql_config for finding includes and libraries],
usemysql="$withval")
AC_ARG_WITH(pgsql,
[ --with-pgsql use PostgreSQL as database.
- Uses pg_config for finding includes and libraries],
+ Uses pg_config for finding includes and libraries],
usepgsql="$withval")
AC_ARG_WITH(sqlite,
[ --with-sqlite use SQLite3 as database.
- Uses pkg-config for finding includes and libraries],
+ Uses pkg-config for finding includes and libraries],
usesqlite="$withval")
AC_ARG_WITH(ingres,
[ --with-ingres use Ingres as database.
- Specify the II_SYSTEM location],
+ Specify the II_SYSTEM location],
useingres="$withval")
@@ -117,8 +105,7 @@ fi
])
-dnl DBMAIL_CHECK_SQL_LIBS
-AC_DEFUN([DBMAIL_CHECK_SQL_LIBS], [dnl
+AC_DEFUN([DM_SQL_LIBS], [dnl
if test [ "$usemysql" = "yes" ]; then
AC_PATH_PROG(mysqlconfig,mysql_config)
if test [ -z "$mysqlconfig" ]; then
@@ -134,6 +121,7 @@ if test [ "$usemysql" = "yes" ]; then
AC_MSG_RESULT([$MYSQLLIB])
fi
fi
+
if test [ "$usepgsql" = "yes" ]; then
AC_PATH_PROG(pgsqlconfig,pg_config)
if test [ -z "$pgsqlconfig" ]; then
@@ -151,6 +139,7 @@ if test [ "$usepgsql" = "yes" ]; then
AC_MSG_RESULT([$PGSQLLIB])
fi
fi
+
if test [ "$usesqlite" = "yes" ]; then
AC_PATH_PROG(sqliteconfig,pkg-config)
if test [ -z "$sqliteconfig" ]; then
@@ -175,6 +164,7 @@ if test [ "$usesqlite" = "yes" ]; then
else
SQLITECREATE="\"\" \\"
fi
+
if test [ -d "$useingres" ]; then
AC_MSG_CHECKING([Ingres headers])
INGRESINC="-I $useingres/ingres/files"
@@ -196,9 +186,7 @@ fi
])
-
-dnl Check for Sieve header.
-AC_DEFUN([DBMAIL_CHECK_SIEVE_INC],[
+AC_DEFUN([DM_SIEVE_INC],[
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[
#define NULL 0
@@ -206,8 +194,7 @@ AC_DEFUN([DBMAIL_CHECK_SIEVE_INC],[
[$1],
[$2])
])
-dnl Check for Sieve library.
-AC_DEFUN([DBMAIL_CHECK_SIEVE_LIB],[
+AC_DEFUN([DM_SIEVE_LIB],[
AC_LINK_IFELSE(
AC_LANG_PROGRAM([[
#define NULL 0
@@ -216,48 +203,35 @@ AC_DEFUN([DBMAIL_CHECK_SIEVE_LIB],[
[$2])
])
-dnl DBMAIL_SIEVE_CONF
-dnl check for sieve sorting
-AC_DEFUN([DBMAIL_SIEVE_CONF], [dnl
+AC_DEFUN([DM_SIEVE_CONF], [dnl
WARN=0
AC_ARG_WITH(sieve,[ --with-sieve=PATH path to libSieve base directory (e.g. /usr/local or /usr)],
[lookforsieve="$withval"],[lookforsieve="no"])
-
-dnl Set the default sort modules to null, as
-dnl the user may not have asked for Sieve at all.
SORTALIB="modules/.libs/libsort_null.a"
SORTLTLIB="modules/libsort_null.la"
-dnl Go looking for the Sieve headers and libraries.
if test [ "x$lookforsieve" != "xno" ]; then
-
- dnl We were given a specific path. Only look there.
if test [ "x$lookforsieve" != "xyes" ]; then
sieveprefixes=$lookforsieve
fi
-
- dnl Look for Sieve headers.
AC_MSG_CHECKING([for libSieve headers])
STOP_LOOKING_FOR_SIEVE=""
while test [ -z $STOP_LOOKING_FOR_SIEVE ]; do
- dnl See if we already have the paths we need in the environment.
- dnl ...but only if --with-sieve was given without a specific path.
if test [ "x$lookforsieve" = "xyes" ]; then
- DBMAIL_CHECK_SIEVE_INC([SIEVEINC=""], [SIEVEINC="failed"])
+ DM_SIEVE_INC([SIEVEINC=""], [SIEVEINC="failed"])
if test [ "x$SIEVEINC" != "xfailed" ]; then
break
fi
fi
- dnl Explicitly test paths from --with-sieve or configure.in
for TEST_PATH in $sieveprefixes; do
TEST_PATH="$TEST_PATH/include"
SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -I$TEST_PATH"
- DBMAIL_CHECK_SIEVE_INC([SIEVEINC="-I$TEST_PATH"], [SIEVEINC="failed"])
+ DM_SIEVE_INC([SIEVEINC="-I$TEST_PATH"], [SIEVEINC="failed"])
CFLAGS=$SAVE_CFLAGS
if test [ "x$SIEVEINC" != "xfailed" ]; then
break 2
@@ -273,27 +247,22 @@ if test [ "x$lookforsieve" != "xno" ]; then
AC_MSG_RESULT($SIEVEINC)
fi
- dnl Look for Sieve libraries.
AC_MSG_CHECKING([for libSieve libraries])
STOP_LOOKING_FOR_SIEVE=""
while test [ -z $STOP_LOOKING_FOR_SIEVE ]; do
- dnl See if we already have the paths we need in the environment.
- dnl ...but only if --with-sieve was given without a specific path.
if test [ "x$lookforsieve" = "xyes" ]; then
- DBMAIL_CHECK_SIEVE_LIB([SIEVELIB="-lsieve"], [SIEVELIB="failed"])
+ DM_SIEVE_LIB([SIEVELIB="-lsieve"], [SIEVELIB="failed"])
if test [ "x$SIEVELIB" != "xfailed" ]; then
break
fi
fi
- dnl Explicitly test paths from --with-sieve or configure.in
for TEST_PATH in $sieveprefixes; do
TEST_PATH="$TEST_PATH/lib"
SAVE_CFLAGS=$CFLAGS
- dnl The headers might be in a funny place, so we need to use -Ipath
CFLAGS="$CFLAGS -L$TEST_PATH $SIEVEINC"
- DBMAIL_CHECK_SIEVE_LIB([SIEVELIB="-L$TEST_PATH -lsieve"], [SIEVELIB="failed"])
+ DM_SIEVE_LIB([SIEVELIB="-L$TEST_PATH -lsieve"], [SIEVELIB="failed"])
CFLAGS=$SAVE_CFLAGS
if test [ "x$SIEVELIB" != "xfailed" ]; then
break 2
@@ -318,8 +287,7 @@ fi
])
-dnl Check for LDAP header.
-AC_DEFUN([DBMAIL_CHECK_LDAP_INC],[
+AC_DEFUN([DM_LDAP_INC],[
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[
#define NULL 0
@@ -328,7 +296,7 @@ AC_DEFUN([DBMAIL_CHECK_LDAP_INC],[
[$2])
])
dnl Check for LDAP library.
-AC_DEFUN([DBMAIL_CHECK_LDAP_LIB],[
+AC_DEFUN([DM_LDAP_LIB],[
AC_LINK_IFELSE(
AC_LANG_PROGRAM([[
#define NULL 0
@@ -337,56 +305,37 @@ AC_DEFUN([DBMAIL_CHECK_LDAP_LIB],[
[$2])
])
-dnl DBMAIL_LDAP_CONF
-dnl check for ldap or sql authentication
-AC_DEFUN([DBMAIL_LDAP_CONF], [dnl
+AC_DEFUN([DM_LDAP_CONF], [dnl
WARN=0
-dnl --with-auth-ldap is deprecated as of DBMail 2.2.2
-AC_ARG_WITH(auth-ldap,[ --with-auth-ldap=PATH deprecated, use --with-ldap],
- [lookforauthldap="$withval"],[lookforauthldap="no"])
-
AC_ARG_WITH(ldap,[ --with-ldap=PATH path to LDAP base directory (e.g. /usr/local or /usr)],
[lookforldap="$withval"],[lookforldap="no"])
-dnl Set the default auth modules to sql, as
-dnl the user may not have asked for LDAP at all.
AUTHALIB="modules/.libs/libauth_sql.a"
AUTHLTLIB="modules/libauth_sql.la"
-dnl Go looking for the LDAP headers and libraries.
-if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lookforauthldap" != "xno" ] ); then
+if ( test [ "x$lookforldap" != "xno" ] ); then
- dnl Support the deprecated --with-auth-ldap per comment above.
- if ( test [ "x$lookforauthldap" != "xyes" ] && test [ "x$lookforauthldap" != "xno" ] ); then
- lookforldap=$lookforauthldap
- fi
-
- dnl We were given a specific path. Only look there.
if ( test [ "x$lookforldap" != "xyes" ] && test [ "x$lookforldap" != "xno" ] ); then
ldapprefixes=$lookforldap
fi
- dnl Look for LDAP headers.
AC_MSG_CHECKING([for LDAP headers])
STOP_LOOKING_FOR_LDAP=""
while test [ -z $STOP_LOOKING_FOR_LDAP ]; do
- dnl See if we already have the paths we need in the environment.
- dnl ...but only if --with-ldap was given without a specific path.
if ( test [ "x$lookforldap" = "xyes" ] || test [ "x$lookforauthldap" = "xyes" ] ); then
- DBMAIL_CHECK_LDAP_INC([LDAPINC=""], [LDAPINC="failed"])
+ DM_LDAP_INC([LDAPINC=""], [LDAPINC="failed"])
if test [ "x$LDAPINC" != "xfailed" ]; then
break
fi
fi
- dnl Explicitly test paths from --with-ldap or configure.in
for TEST_PATH in $ldapprefixes; do
TEST_PATH="$TEST_PATH/include"
SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -I$TEST_PATH"
- DBMAIL_CHECK_LDAP_INC([LDAPINC="-I$TEST_PATH"], [LDAPINC="failed"])
+ DM_LDAP_INC([LDAPINC="-I$TEST_PATH"], [LDAPINC="failed"])
CFLAGS=$SAVE_CFLAGS
if test [ "x$LDAPINC" != "xfailed" ]; then
break 2
@@ -402,27 +351,22 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lookforauthldap" != "xno" ]
AC_MSG_RESULT($LDAPINC)
fi
- dnl Look for LDAP libraries.
AC_MSG_CHECKING([for LDAP libraries])
STOP_LOOKING_FOR_LDAP=""
while test [ -z $STOP_LOOKING_FOR_LDAP ]; do
- dnl See if we already have the paths we need in the environment.
- dnl ...but only if --with-ldap was given without a specific path.
- if ( test [ "x$lookforldap" = "xyes" ] || test [ "x$lookforauthldap" = "xyes" ] ); then
- DBMAIL_CHECK_LDAP_LIB([LDAPLIB="-lldap"], [LDAPLIB="failed"])
+ if ( test [ "x$lookforldap" = "xyes" ] ); then
+ DM_LDAP_LIB([LDAPLIB="-lldap"], [LDAPLIB="failed"])
if test [ "x$LDAPLIB" != "xfailed" ]; then
break
fi
fi
- dnl Explicitly test paths from --with-ldap or configure.in
for TEST_PATH in $ldapprefixes; do
TEST_PATH="$TEST_PATH/lib"
SAVE_CFLAGS=$CFLAGS
- dnl The headers might be in a funny place, so we need to use -Ipath
CFLAGS="$CFLAGS -L$TEST_PATH $LDAPINC"
- DBMAIL_CHECK_LDAP_LIB([LDAPLIB="-L$TEST_PATH -lldap"], [LDAPLIB="failed"])
+ DM_LDAP_LIB([LDAPLIB="-L$TEST_PATH -lldap"], [LDAPLIB="failed"])
CFLAGS=$SAVE_CFLAGS
if test [ "x$LDAPLIB" != "xfailed" ]; then
break 2
@@ -447,38 +391,29 @@ fi
])
-dnl AC_COMPILE_WARNINGS
-dnl set to compile with '-W -Wall'
AC_DEFUN([AC_COMPILE_WARNINGS],
[AC_MSG_CHECKING(maximum warning verbosity option)
-if test -n "$CXX"
-then
- if test "$GXX" = "yes"
- then
- ac_compile_warnings_opt='-Wall'
- fi
- CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
- ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
+if test -n "$CXX"; then
+ if test "$GXX" = "yes"; then
+ ac_compile_warnings_opt='-Wall'
+ fi
+ CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
+ ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
fi
-if test -n "$CC"
-then
- if test "$GCC" = "yes"
- then
- ac_compile_warnings_opt='-W -Wall -Wpointer-arith -Wstrict-prototypes'
- fi
- CFLAGS="$CFLAGS $ac_compile_warnings_opt"
- ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
+if test -n "$CC"; then
+ if test "$GCC" = "yes"; then
+ ac_compile_warnings_opt='-W -Wall -Wpointer-arith -Wstrict-prototypes'
+ fi
+ CFLAGS="$CFLAGS $ac_compile_warnings_opt"
+ ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
fi
+
AC_MSG_RESULT($ac_compile_warnings_msg)
unset ac_compile_warnings_msg
unset ac_compile_warnings_opt
])
-dnl DBMAIL_CHECK_GLIB
-dnl
-AC_DEFUN([DBMAIL_CHECK_GLIB], [dnl
-#Look for include files and libs needed to link
-#use the configuration utilities (pkg-config for this)
+AC_DEFUN([DM_CHECK_GLIB], [dnl
AC_PATH_PROG(glibconfig,pkg-config)
if test [ -z "$glibconfig" ]
then
@@ -508,11 +443,7 @@ else
fi
])
-dnl DBMAIL_CHECK_GMIME
-dnl
-AC_DEFUN([DBMAIL_CHECK_GMIME], [dnl
-#Look for include files and libs needed to link
-#use the configuration utilities (pkg-config for this)
+AC_DEFUN([DM_CHECK_GMIME], [dnl
AC_PATH_PROG(gmimeconfig,pkg-config)
if test [ -z "$gmimeconfig" ]
then
@@ -542,77 +473,63 @@ else
fi
])
-# ----------------------------------------------------------------
-# DBMAIL_CHECK_GC
-# I cheated I copied from w3m's acinclude.m4 :)
-# Modified for DBMAIL by Dan Weber
-# ----------------------------------------------------------------
-AC_DEFUN([DBMAIL_CHECK_GC],
+AC_DEFUN([DM_CHECK_GC],
[AC_MSG_CHECKING(for --with-gc)
AC_ARG_WITH(gc,
[ --with-gc[=PREFIX] libgc PREFIX],
[test x"$with_gc" = xno && with_gc="no"],
[with_gc="no"])
AC_MSG_RESULT($with_gc)
-# Don't check for gc if not appended to command line
- if test x"$with_gc" = xyes
- then
- test x"$with_gc" = xyes && with_gc="/usr /usr/local ${HOME}"
- unset ac_cv_header_gc_h
- AC_CHECK_HEADER(gc/gc.h)
- if test x"$ac_cv_header_gc_h" = xno; then
- AC_MSG_CHECKING(GC header location)
- AC_MSG_RESULT($with_gc)
- gcincludedir=no
- for dir in $with_gc; do
- for inc in include include/gc; do
- cflags="$CFLAGS"
- CFLAGS="$CFLAGS -I$dir/$inc -DUSE_GC=1"
- AC_MSG_CHECKING($dir/$inc)
- unset ac_cv_header_gc_h
- AC_CHECK_HEADER(gc/gc.h, [gcincludedir="$dir/$inc"; CFLAGS="$CFLAGS -I$dir/$inc -DUSE_GC=1"; break])
- CFLAGS="$cflags"
- done
- if test x"$gcincludedir" != xno; then
- break;
- fi
- done
- if test x"$gcincludedir" = xno; then
- AC_MSG_ERROR([gc/gc.h not found])
- fi
- else
- cflags="$CFLAGS -DUSE_GC=1"
- CFLAGS="$cflags"
- fi
- unset ac_cv_lib_gc_GC_init
- AC_CHECK_LIB(gc, GC_init, [LIBS="$LIBS -lgc"])
- if test x"$ac_cv_lib_gc_GC_init" = xno; then
- AC_MSG_CHECKING(GC library location)
- AC_MSG_RESULT($with_gc)
- gclibdir=no
- for dir in $with_gc; do
- ldflags="$LDFLAGS"
- LDFLAGS="$LDFLAGS -L$dir/lib"
- AC_MSG_CHECKING($dir)
- unset ac_cv_lib_gc_GC_init
- AC_CHECK_LIB(gc, GC_init, [gclibdir="$dir/lib"; LIBS="$LIBS -L$dir/lib -lgc"; break])
- LDFLAGS="$ldflags"
- done
- if test x"$gclibdir" = xno; then
- AC_MSG_ERROR([libgc not found])
- fi
- fi
+ if test x"$with_gc" = xyes; then
+ test x"$with_gc" = xyes && with_gc="/usr /usr/local ${HOME}"
+ unset ac_cv_header_gc_h
+ AC_CHECK_HEADER(gc/gc.h)
+ if test x"$ac_cv_header_gc_h" = xno; then
+ AC_MSG_CHECKING(GC header location)
+ AC_MSG_RESULT($with_gc)
+ gcincludedir=no
+ for dir in $with_gc; do
+ for inc in include include/gc; do
+ cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -I$dir/$inc -DUSE_GC=1"
+ AC_MSG_CHECKING($dir/$inc)
+ unset ac_cv_header_gc_h
+ AC_CHECK_HEADER(gc/gc.h, [gcincludedir="$dir/$inc"; CFLAGS="$CFLAGS -I$dir/$inc -DUSE_GC=1"; break])
+ CFLAGS="$cflags"
+ done
+ if test x"$gcincludedir" != xno; then
+ break;
+ fi
+ done
+ if test x"$gcincludedir" = xno; then
+ AC_MSG_ERROR([gc/gc.h not found])
+ fi
+ else
+ cflags="$CFLAGS -DUSE_GC=1"
+ CFLAGS="$cflags"
+ fi
+ unset ac_cv_lib_gc_GC_init
+ AC_CHECK_LIB(gc, GC_init, [LIBS="$LIBS -lgc"])
+
+ if test x"$ac_cv_lib_gc_GC_init" = xno; then
+ AC_MSG_CHECKING(GC library location)
+ AC_MSG_RESULT($with_gc)
+ gclibdir=no
+ for dir in $with_gc; do
+ ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$dir/lib"
+ AC_MSG_CHECKING($dir)
+ unset ac_cv_lib_gc_GC_init
+ AC_CHECK_LIB(gc, GC_init, [gclibdir="$dir/lib"; LIBS="$LIBS -L$dir/lib -lgc"; break])
+ LDFLAGS="$ldflags"
+ done
+ if test x"$gclibdir" = xno; then
+ AC_MSG_ERROR([libgc not found])
+ fi
+ fi
fi])
-
-
-# ripped from check.m4
-
-dnl DBMAIL_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
-dnl
-
-AC_DEFUN([DBMAIL_PATH_CHECK],
+AC_DEFUN([DM_PATH_CHECK],
[
AC_ARG_WITH(check,
[ --with-check=PATH prefix where check is installed [default=auto]],
@@ -821,13 +738,6 @@ AC_DEFUN([gl_PREREQ_GETOPT],
AC_CHECK_DECLS_ONCE([getenv])
])
-dnl bsd_sockets.m4--which socket libraries do we need?
-dnl Derrick Brashear
-dnl from Zephyr
-
-dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
-dnl It now puts everything required for sockets into SOCKETLIB
-
AC_DEFUN([CMU_SOCKETS], [
save_LIBS="$LIBS"
SOCKETLIB=""
diff --git a/configure.in b/configure.in
index 78da73c1..161189f7 100644
--- a/configure.in
+++ b/configure.in
@@ -1,60 +1,36 @@
# Copyright (C) 1999-2004 IC & S dbmail@ic-s.nl
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-AC_INIT([main.c])
-AC_CONFIG_AUX_DIR(buildtools)
-AM_CONFIG_HEADER(config.h:config.in)
-DBMAIL_MSG_CONFIGURE_START
-DBMAIL_SET_VERSION
-# Initialize the package and major.minor version.
-# The full version that is printed out is kept in VERSION
-# and represented by the DBMAIL_VERSION define.
-AM_INIT_AUTOMAKE(dbmail, 2.2)
-AM_MAINTAINER_MODE
-
-pgsqlheaderpaths="/usr/include/pgsql /usr/include /usr/local/include/pgsql \
- /usr/local/include /usr/freeware/include/pgsql \
- /usr/freeware/include $HOME/include $HOME/pgsql/include \
- /usr/local/pgsql/include /usr/include/postgresql $HOME"
+# Copyright (C) 2004-2008 NFG Net Facilities Group support@nfg.nl
-ldapprefixes="/usr /usr/local"
-sieveprefixes="/usr /usr/local"
+AC_INIT([dbmail], [dbmail@dbmail.org])
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER(config.h:config.in)
+# ---------------------------------------------
+DM_MSG_CONFIGURE_START
+DM_SET_VERSION
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
AC_DEFINE(_GNU_SOURCE,'','Defined GNU SOURCE')
-# Turn off both defaults.
+# ---------------------------------------------
+# shared or static
+# ---------------------------------------------
AM_ENABLE_SHARED(no)
AM_ENABLE_STATIC(no)
-# Check if one was specified.
-# Stop with an error if both.
-# Default to shared if neither.
-DBMAIL_SET_SHARED_OR_STATIC
+DM_SET_SHARED_OR_STATIC
AM_CONDITIONAL(SHARED, [ test "$enable_shared" = "yes" ])
AM_CONDITIONAL(STATIC, [ test "$enable_static" = "yes" ])
+# ---------------------------------------------
DM_DEFINES
-DBMAIL_BOTH_SQL_CHECK
-DBMAIL_CHECK_SQL_LIBS
-DBMAIL_LDAP_CONF
-DBMAIL_SIEVE_CONF
-DBMAIL_CHECK_GLIB
-DBMAIL_CHECK_GMIME
-DBMAIL_CHECK_GC
-DBMAIL_PATH_CHECK
+DM_SQL_CHECK
+DM_SQL_LIBS
+DM_LDAP_CONF
+DM_SIEVE_CONF
+DM_CHECK_GLIB
+DM_CHECK_GMIME
+DM_CHECK_GC
+DM_PATH_CHECK
gl_GETOPT
CMU_SOCKETS
@@ -121,6 +97,6 @@ AC_SUBST(DM_PKGLIBDIR)
AC_PROG_LIBTOOL
-AC_OUTPUT(dbmail.h Makefile modules/Makefile man/Makefile)
+AC_OUTPUT(src/dbmail.h Makefile src/Makefile src/modules/Makefile man/Makefile test/Makefile)
-DBMAIL_MSG_CONFIGURE_RESULTS
+DM_MSG_CONFIGURE_RESULTS
diff --git a/dbmail.supp b/dbmail.supp
deleted file mode 100644
index 1af00870..00000000
--- a/dbmail.supp
+++ /dev/null
@@ -1,348 +0,0 @@
-{
- dbmail/db_connect/mysql_real_connect
- Memcheck:Leak
- fun:malloc
- fun:my_once_alloc
- obj:/usr/lib/mysql/libmysqlclient.*
- obj:/usr/lib/mysql/libmysqlclient.*
- fun:get_charset_by_csname
- fun:mysql_real_connect
- fun:db_connect
-}
-{
- dbmail/db_connect/mysql_real_connect/vio_new
- Memcheck:Leak
- fun:malloc
- fun:my_malloc
- fun:vio_new
- fun:mysql_real_connect
-}
-
-#inet_ntoa is suposed to work from a static buffer therefore this is not a leak
-{
- dbmail/PerformChildTask/inet_ntoa/malloc
- Memcheck:Leak
- fun:malloc
- fun:inet_ntoa
-}
-
-{
- dbmail/g_mime/internal_call
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- fun:g_hash_table_new_full
- fun:g_hash_table_new
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_quark_from_static_string
-}
-{
- dbmail/g_mime/g_tree_insert
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_tree_insert
-}
-{
- dbmail/main/g_mime_init/malloc/g_mime_object_register_type
- Memcheck:Leak
- fun:malloc
- fun:g_malloc
- fun:g_mime_object_register_type
- fun:g_mime_init
-}
-{
- dbmail/main/g_mime_init/calloc
- Memcheck:Leak
- fun:calloc
- fun:g_malloc0
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- fun:g_hash_table_new_full
- fun:g_hash_table_new
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_quark_from_static_string
- fun:g_type_init_with_debug_flags
- fun:g_type_init
- fun:g_mime_init
-}
-{
- dbmail/imapd/scoreboard_new/g_realloc
- Memcheck:Leak
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_string_insert_len
- fun:g_string_append_len
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_string_printf
- fun:scoreboard_lock_getfilename
-}
-{
- dbmail/main/g_mime_init/realloc
- Memcheck:Leak
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libgobject-2.0.so.*
- obj:/usr/lib/libgobject-2.0.so.*
- fun:g_boxed_type_register_static
-}
-{
- dbmail/main/g_mime_init/realloc/malloc
- Memcheck:Leak
- fun:malloc
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_quark_from_static_string
- fun:g_type_init_with_debug_flags
-}
-{
- dbmail/main/g_mime_init/calloc/g_type_init_with_debug_flags
- Memcheck:Leak
- fun:calloc
- fun:g_malloc0
- obj:/usr/lib/libgobject-2.0.so.*
- obj:/usr/lib/libgobject-2.0.so.*
- fun:g_type_init_with_debug_flags
- fun:g_type_init
- fun:g_mime_init
-}
-{
- dbmail/main/g_mime_init/malloc/g_type_init_with_debug_flags
- Memcheck:Leak
- fun:malloc
- fun:g_malloc
- fun:g_param_type_register_static
- obj:/usr/lib/libgobject-2.0.so.*
- fun:g_type_init_with_debug_flags
- fun:g_type_init
- fun:g_mime_init
-}
-{
- dbmail/imapd_only/memalign/g_object_newv
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- fun:g_slice_alloc0
- fun:g_type_create_instance
- obj:/usr/lib/libgobject-2.0.so.*
- fun:g_object_newv
-}
-{
- dbmail/imapd_only/memalign/g_hash_table_replace
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_hash_table_replace
-}
-{
- dbmail/imapd_only/memalign/g_hash_table_insert
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_hash_table_insert
-}
-{
- dbmail/glib/g_realloc
- Memcheck:Leak
- fun:malloc
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_string_sized_new
- fun:g_string_new
-}
-{
- dbmail/gmime/g_mime_object_write_to_stream/realloc
- Memcheck:Leak
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_array_set_size
- fun:g_byte_array_set_size
- obj:/usr/lib/libgmime-2.0.so.*
- fun:g_mime_stream_write
- obj:/usr/lib/libgmime-2.0.so.*
- fun:g_mime_header_write_to_stream
- obj:/usr/lib/libgmime-2.0.so.*
- fun:g_mime_object_write_to_stream
-}
-{
- dbmail/gmime/g_mime_object_write_to_stream/g_byte_array_set_size/realloc
- Memcheck:Leak
- fun:realloc
- fun:g_realloc
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_array_set_size
- fun:g_byte_array_set_size
- obj:/usr/lib/libgmime-2.0.so.*
- fun:g_mime_stream_write
- fun:g_mime_stream_write_to_stream
- obj:/usr/lib/libgmime-2.0.so.*
- obj:/usr/lib/libgmime-2.0.so.*
- fun:g_mime_object_write_to_stream
-}
-
-{
- dbmail/libgmodule/internal
- Memcheck:Leak
- fun:calloc
- fun:_dl_new_object
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
- fun:dl_open_worker
-}
-{
- dbmail/libgmodule/g_module_supported/memalign
- Memcheck:Leak
- fun:memalign
- fun:posix_memalign
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- obj:/usr/lib/libglib-2.0.so.*
- fun:g_slice_alloc
- fun:g_array_sized_new
- fun:g_array_new
- fun:g_static_private_set
- fun:g_module_supported
-}
-{
- dbmail/libdl/internal/openaux/malloc
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object
- fun:openaux
-}
-{
- dbmail/libdl/internal/openaux/malloc
- Memcheck:Leak
- fun:malloc
- fun:_dl_new_object
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
- fun:openaux
-}
-{
- dbmail/libdl/internal/openaux/_dl_map_object_from_fd/malloc
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
- fun:openaux
-}
-
-# FIXME maybe? should we pass module code to unload module...
-{
- dbmail/db_load_driver/calloc
- Memcheck:Leak
- fun:calloc
- fun:_dlerror_run
- fun:dlopen*
- obj:/usr/lib/libgmodule-2.0.so*
- fun:g_module_open
- fun:db_load_driver
-}
-{
- dbmail/db_load_driver/g_module_open/malloc
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object_deps
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
-}
-{
- dbmail/db_load_driver/g_module_open
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@*
- obj:/usr/lib/libgmodule-2.0.so*
- fun:g_module_open
- fun:db_load_driver
-}
-{
- dbmail/db_load_driver/db_connect
- Memcheck:Leak
- fun:malloc
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@*
- obj:/usr/lib/libgmodule-2.0.so*
- fun:g_module_open
- fun:db_load_driver
-}
-{
- dbmail/db_load_driver/calloc
- Memcheck:Leak
- fun:calloc
- fun:_dl_check_map_versions
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
-}
-
-# FIXME's
-
-#{
-# dbmail/glib/build_args_array_ext/g_malloc0/calloc
-# Memcheck:Leak
-# fun:calloc
-# fun:g_malloc0
-# fun:build_args_array_ext
-#}
-#{
-# dbmail/imap4.c/build_args_array_ext/malloc
-# Memcheck:Leak
-# fun:malloc
-# fun:build_args_array_ext
-#}
diff --git a/debian/rules b/debian/rules
index 0aee0d33..b13a459d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -121,7 +121,7 @@ mrproper:
for file in Makefile config.h config.status libtool stamp-h .deps .libs; do \
rm -rf `find . -name $$file`; \
done
- rm -rf buildtools
+ rm -rf config
# Build architecture-dependent files here.
binary-common: build
diff --git a/README.aliases b/doc/README.aliases
index ed81b752..ed81b752 100644
--- a/README.aliases
+++ b/doc/README.aliases
diff --git a/README.exim b/doc/README.exim
index 71e6ff7c..71e6ff7c 100644
--- a/README.exim
+++ b/doc/README.exim
diff --git a/README.ldap b/doc/README.ldap
index 80293de5..80293de5 100644
--- a/README.ldap
+++ b/doc/README.ldap
diff --git a/README.postfix b/doc/README.postfix
index 5732d931..5732d931 100644
--- a/README.postfix
+++ b/doc/README.postfix
diff --git a/README.qmail b/doc/README.qmail
index 1ef55af7..1ef55af7 100644
--- a/README.qmail
+++ b/doc/README.qmail
diff --git a/README.sieve b/doc/README.sieve
index ef45b0cf..ef45b0cf 100644
--- a/README.sieve
+++ b/doc/README.sieve
diff --git a/README.smtp b/doc/README.smtp
index 229a5079..229a5079 100644
--- a/README.smtp
+++ b/doc/README.smtp
diff --git a/README.solaris b/doc/README.solaris
index a8c0a7db..a8c0a7db 100644
--- a/README.solaris
+++ b/doc/README.solaris
diff --git a/README.usermap b/doc/README.usermap
index 52055a83..52055a83 100644
--- a/README.usermap
+++ b/doc/README.usermap
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 00000000..2a8b2fd4
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,127 @@
+# Copyright (C) 1999-2004 IC & S dbmail@ic-s.nl
+# Copyright (c) 2004-2006 NFG Net Facilities Group BV support@nfg.nl
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+SUBDIRS = modules
+
+if SIEVE
+SIEVEPROGS = dbmail-sievecmd dbmail-timsieved
+endif
+
+if USE_DM_GETOPT
+DM_GETOPT = dm_getopt.c
+endif
+
+
+sbin_PROGRAMS = dbmail-smtp \
+ dbmail-pop3d \
+ dbmail-imapd \
+ dbmail-top \
+ dbmail-util \
+ dbmail-users \
+ dbmail-export \
+ dbmail-lmtpd $(SIEVEPROGS)
+
+COMMON = dbmail-user.c \
+ dbmail-message.c \
+ dbmail-mailbox.c \
+ dm_config.c \
+ dm_debug.c \
+ dm_list.c \
+ dm_db.c \
+ dm_acl.c \
+ dm_misc.c \
+ dm_pidfile.c \
+ dm_md5.c \
+ dm_sha1.c \
+ dm_match.c \
+ dm_iconv.c \
+ dm_base64.c $(DM_GETOPT)
+
+SERVER = server.c \
+ serverchild.c \
+ serverparent.c \
+ serverpool.c \
+ dm_cidr.c
+
+DELIVER = dm_pipe.c \
+ dm_dsn.c \
+ sort.c
+
+MODULES = dbmodule.c \
+ authmodule.c \
+ sortmodule.c
+
+IMAPD = dm_quota.c \
+ dm_memblock.c \
+ imap4.c \
+ imapcommands.c \
+ dbmail-imapsession.c
+
+AM_CFLAGS = @SIEVEINC@ @LDAPINC@
+
+INCLUDES = -I$(top_srcdir)
+
+
+dbmail_smtp_SOURCES = main.c
+dbmail_smtp_LDADD = libdbmail.la
+
+dbmail_pop3d_SOURCES = pop3.c pop3d.c
+dbmail_pop3d_LDADD = libdbmail.la
+
+dbmail_imapd_SOURCES = $(IMAPD) imapd.c
+dbmail_imapd_LDADD = libdbmail.la
+
+dbmail_top_SOURCES = top.c
+dbmail_top_LDADD = libdbmail.la -lncurses
+
+dbmail_util_SOURCES = maintenance.c
+dbmail_util_LDADD = libdbmail.la
+
+dbmail_users_SOURCES = user.c
+dbmail_users_LDADD = libdbmail.la
+
+dbmail_export_SOURCES = export.c dm_memblock.c dbmail-imapsession.c
+dbmail_export_LDADD = libdbmail.la
+
+dbmail_lmtpd_SOURCES = lmtp.c lmtpd.c
+dbmail_lmtpd_LDADD = libdbmail.la
+
+if SIEVE
+dbmail_sievecmd_SOURCES = sievecmd.c
+dbmail_sievecmd_LDADD = libdbmail.la
+
+dbmail_timsieved_SOURCES = timsieve.c timsieved.c
+dbmail_timsieved_LDADD = libdbmail.la
+endif
+
+
+pkglib_LTLIBRARIES = libdbmail.la
+
+
+if SHARED
+AM_LDFLAGS = -export-dynamic @CRYPTLIB@
+libdbmail_la_SOURCES = $(COMMON) $(SERVER) $(DELIVER) $(MODULES)
+else
+libdbmail_la_SOURCES = $(COMMON) $(SERVER) $(DELIVER)
+libdbmail_la_LIBADD = @MYSQLLTLIB@ @PGSQLLTLIB@ @SQLITELTLIB@ @INGRESLTLIB@ @SORTLTLIB@ @AUTHLTLIB@
+endif
+
+libdbmail_la_LDFLAGS = $(AM_LDFLAGS) @SOCKETLIB@
+libdbmail_la_CFLAGS = $(AM_CFLAGS)
+
+
diff --git a/auth.h b/src/auth.h
index 9186cd9a..9186cd9a 100644
--- a/auth.h
+++ b/src/auth.h
diff --git a/authmodule.c b/src/authmodule.c
index 7ac5ef07..7ac5ef07 100644
--- a/authmodule.c
+++ b/src/authmodule.c
diff --git a/authmodule.h b/src/authmodule.h
index 93e869f8..93e869f8 100644
--- a/authmodule.h
+++ b/src/authmodule.h
diff --git a/dbmail-imapsession.c b/src/dbmail-imapsession.c
index 3e39312f..3e39312f 100644
--- a/dbmail-imapsession.c
+++ b/src/dbmail-imapsession.c
diff --git a/dbmail-imapsession.h b/src/dbmail-imapsession.h
index a4be46ae..a4be46ae 100644
--- a/dbmail-imapsession.h
+++ b/src/dbmail-imapsession.h
diff --git a/dbmail-mailbox.c b/src/dbmail-mailbox.c
index 5372be3d..5372be3d 100644
--- a/dbmail-mailbox.c
+++ b/src/dbmail-mailbox.c
diff --git a/dbmail-mailbox.h b/src/dbmail-mailbox.h
index 114f8243..114f8243 100644
--- a/dbmail-mailbox.h
+++ b/src/dbmail-mailbox.h
diff --git a/dbmail-message.c b/src/dbmail-message.c
index cb976147..cb976147 100644
--- a/dbmail-message.c
+++ b/src/dbmail-message.c
diff --git a/dbmail-message.h b/src/dbmail-message.h
index c5f266d2..c5f266d2 100644
--- a/dbmail-message.h
+++ b/src/dbmail-message.h
diff --git a/dbmail-user.c b/src/dbmail-user.c
index 74dfd7fa..74dfd7fa 100644
--- a/dbmail-user.c
+++ b/src/dbmail-user.c
diff --git a/dbmail-user.h b/src/dbmail-user.h
index 9733a84d..9733a84d 100644
--- a/dbmail-user.h
+++ b/src/dbmail-user.h
diff --git a/dbmail.h.in b/src/dbmail.h.in
index 8f686449..8f686449 100644
--- a/dbmail.h.in
+++ b/src/dbmail.h.in
diff --git a/dbmailtypes.h b/src/dbmailtypes.h
index 32f7a1ee..32f7a1ee 100644
--- a/dbmailtypes.h
+++ b/src/dbmailtypes.h
diff --git a/dbmodule.c b/src/dbmodule.c
index e3254b8b..e3254b8b 100644
--- a/dbmodule.c
+++ b/src/dbmodule.c
diff --git a/dbmodule.h b/src/dbmodule.h
index 35a33b0a..35a33b0a 100644
--- a/dbmodule.h
+++ b/src/dbmodule.h
diff --git a/dm_acl.c b/src/dm_acl.c
index 2343ce64..2343ce64 100644
--- a/dm_acl.c
+++ b/src/dm_acl.c
diff --git a/dm_acl.h b/src/dm_acl.h
index 4a281c7f..4a281c7f 100644
--- a/dm_acl.h
+++ b/src/dm_acl.h
diff --git a/dm_base64.c b/src/dm_base64.c
index 49791ec3..49791ec3 100644
--- a/dm_base64.c
+++ b/src/dm_base64.c
diff --git a/dm_base64.h b/src/dm_base64.h
index 8bcfa8cc..8bcfa8cc 100644
--- a/dm_base64.h
+++ b/src/dm_base64.h
diff --git a/dm_cidr.c b/src/dm_cidr.c
index 6476fbb0..6476fbb0 100644
--- a/dm_cidr.c
+++ b/src/dm_cidr.c
diff --git a/dm_cidr.h b/src/dm_cidr.h
index dcf8e155..dcf8e155 100644
--- a/dm_cidr.h
+++ b/src/dm_cidr.h
diff --git a/dm_config.c b/src/dm_config.c
index ce9b6786..ce9b6786 100644
--- a/dm_config.c
+++ b/src/dm_config.c
diff --git a/dm_db.c b/src/dm_db.c
index 1b6414b1..1b6414b1 100644
--- a/dm_db.c
+++ b/src/dm_db.c
diff --git a/dm_db.h b/src/dm_db.h
index caa4dd6f..caa4dd6f 100644
--- a/dm_db.h
+++ b/src/dm_db.h
diff --git a/dm_debug.c b/src/dm_debug.c
index 0e953474..0e953474 100644
--- a/dm_debug.c
+++ b/src/dm_debug.c
diff --git a/dm_debug.h b/src/dm_debug.h
index 12d0e6e6..12d0e6e6 100644
--- a/dm_debug.h
+++ b/src/dm_debug.h
diff --git a/dm_dsn.c b/src/dm_dsn.c
index 147bfa9a..147bfa9a 100644
--- a/dm_dsn.c
+++ b/src/dm_dsn.c
diff --git a/dm_dsn.h b/src/dm_dsn.h
index 9a67ec3e..9a67ec3e 100644
--- a/dm_dsn.h
+++ b/src/dm_dsn.h
diff --git a/dm_getopt.c b/src/dm_getopt.c
index b7280506..b7280506 100644
--- a/dm_getopt.c
+++ b/src/dm_getopt.c
diff --git a/dm_getopt.h b/src/dm_getopt.h
index 51fc0d98..51fc0d98 100644
--- a/dm_getopt.h
+++ b/src/dm_getopt.h
diff --git a/dm_iconv.c b/src/dm_iconv.c
index 40cf8c89..40cf8c89 100644
--- a/dm_iconv.c
+++ b/src/dm_iconv.c
diff --git a/dm_iconv.h b/src/dm_iconv.h
index 3e1f9cce..3e1f9cce 100644
--- a/dm_iconv.h
+++ b/src/dm_iconv.h
diff --git a/dm_list.c b/src/dm_list.c
index c3fa08f5..c3fa08f5 100644
--- a/dm_list.c
+++ b/src/dm_list.c
diff --git a/dm_list.h b/src/dm_list.h
index be8d4d97..be8d4d97 100644
--- a/dm_list.h
+++ b/src/dm_list.h
diff --git a/dm_match.c b/src/dm_match.c
index 92e98aaa..92e98aaa 100644
--- a/dm_match.c
+++ b/src/dm_match.c
diff --git a/dm_match.h b/src/dm_match.h
index 8996f1e8..8996f1e8 100644
--- a/dm_match.h
+++ b/src/dm_match.h
diff --git a/dm_md5.c b/src/dm_md5.c
index 3fdebcfc..3fdebcfc 100644
--- a/dm_md5.c
+++ b/src/dm_md5.c
diff --git a/dm_md5.h b/src/dm_md5.h
index 3f22d029..3f22d029 100644
--- a/dm_md5.h
+++ b/src/dm_md5.h
diff --git a/dm_memblock.c b/src/dm_memblock.c
index 70bb9d87..70bb9d87 100644
--- a/dm_memblock.c
+++ b/src/dm_memblock.c
diff --git a/dm_memblock.h b/src/dm_memblock.h
index 19c1419a..19c1419a 100644
--- a/dm_memblock.h
+++ b/src/dm_memblock.h
diff --git a/dm_misc.c b/src/dm_misc.c
index a6c02962..a6c02962 100644
--- a/dm_misc.c
+++ b/src/dm_misc.c
diff --git a/dm_misc.h b/src/dm_misc.h
index eba57546..eba57546 100644
--- a/dm_misc.h
+++ b/src/dm_misc.h
diff --git a/dm_pidfile.c b/src/dm_pidfile.c
index 99cc3f23..99cc3f23 100644
--- a/dm_pidfile.c
+++ b/src/dm_pidfile.c
diff --git a/dm_pipe.c b/src/dm_pipe.c
index bf1a99c8..bf1a99c8 100644
--- a/dm_pipe.c
+++ b/src/dm_pipe.c
diff --git a/dm_pipe.h b/src/dm_pipe.h
index a5b1b8aa..a5b1b8aa 100644
--- a/dm_pipe.h
+++ b/src/dm_pipe.h
diff --git a/dm_quota.c b/src/dm_quota.c
index ec6f8a31..ec6f8a31 100644
--- a/dm_quota.c
+++ b/src/dm_quota.c
diff --git a/dm_quota.h b/src/dm_quota.h
index 6837cf28..6837cf28 100644
--- a/dm_quota.h
+++ b/src/dm_quota.h
diff --git a/dm_sha1.c b/src/dm_sha1.c
index e9e146be..e9e146be 100644
--- a/dm_sha1.c
+++ b/src/dm_sha1.c
diff --git a/dm_sha1.h b/src/dm_sha1.h
index edace8da..edace8da 100644
--- a/dm_sha1.h
+++ b/src/dm_sha1.h
diff --git a/export.c b/src/export.c
index 54a27804..54a27804 100644
--- a/export.c
+++ b/src/export.c
diff --git a/imap4.c b/src/imap4.c
index f1b53bb8..f1b53bb8 100644
--- a/imap4.c
+++ b/src/imap4.c
diff --git a/imap4.h b/src/imap4.h
index ee35fff7..ee35fff7 100644
--- a/imap4.h
+++ b/src/imap4.h
diff --git a/imapcommands.c b/src/imapcommands.c
index d9207664..d9207664 100644
--- a/imapcommands.c
+++ b/src/imapcommands.c
diff --git a/imapcommands.h b/src/imapcommands.h
index 298a64a2..298a64a2 100644
--- a/imapcommands.h
+++ b/src/imapcommands.h
diff --git a/imapd.c b/src/imapd.c
index ed3ad15e..ed3ad15e 100644
--- a/imapd.c
+++ b/src/imapd.c
diff --git a/lmtp.c b/src/lmtp.c
index 245dbb74..245dbb74 100644
--- a/lmtp.c
+++ b/src/lmtp.c
diff --git a/lmtp.h b/src/lmtp.h
index 1c48e133..1c48e133 100644
--- a/lmtp.h
+++ b/src/lmtp.h
diff --git a/lmtpd.c b/src/lmtpd.c
index c17bbf85..c17bbf85 100644
--- a/lmtpd.c
+++ b/src/lmtpd.c
diff --git a/main.c b/src/main.c
index d582ff5c..d582ff5c 100644
--- a/main.c
+++ b/src/main.c
diff --git a/maintenance.c b/src/maintenance.c
index fc7def27..fc7def27 100644
--- a/maintenance.c
+++ b/src/maintenance.c
diff --git a/modules/Makefile.am b/src/modules/Makefile.am
index 861b0b05..1cddd3e8 100644
--- a/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -16,11 +16,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-INCLUDES = -I$(top_srcdir)
+INCLUDES = -I$(top_srcdir)/src
AM_CFLAGS = @MYSQLINC@ @PGSQLINC@ @SQLITEINC@ @LDAPINC@ @SIEVEINC@
-
-
#AM_LDFLAGS = -Wl,--export-dynamic
if SHARED
AM_LDFLAGS = -module
diff --git a/modules/authldap.c b/src/modules/authldap.c
index 266ec531..266ec531 100644
--- a/modules/authldap.c
+++ b/src/modules/authldap.c
diff --git a/modules/authsql.c b/src/modules/authsql.c
index 19ff5e07..19ff5e07 100644
--- a/modules/authsql.c
+++ b/src/modules/authsql.c
diff --git a/modules/dbingres.c b/src/modules/dbingres.c
index 9912833c..9912833c 100644
--- a/modules/dbingres.c
+++ b/src/modules/dbingres.c
diff --git a/modules/dbmysql.c b/src/modules/dbmysql.c
index 023722c4..023722c4 100644
--- a/modules/dbmysql.c
+++ b/src/modules/dbmysql.c
diff --git a/modules/dbpgsql.c b/src/modules/dbpgsql.c
index 91c187ee..91c187ee 100644
--- a/modules/dbpgsql.c
+++ b/src/modules/dbpgsql.c
diff --git a/modules/dbsqlite.c b/src/modules/dbsqlite.c
index 270ace09..270ace09 100644
--- a/modules/dbsqlite.c
+++ b/src/modules/dbsqlite.c
diff --git a/modules/sortnull.c b/src/modules/sortnull.c
index 59cefe14..59cefe14 100644
--- a/modules/sortnull.c
+++ b/src/modules/sortnull.c
diff --git a/modules/sortsieve.c b/src/modules/sortsieve.c
index a49e6802..a49e6802 100644
--- a/modules/sortsieve.c
+++ b/src/modules/sortsieve.c
diff --git a/pop3.c b/src/pop3.c
index 52654a15..52654a15 100644
--- a/pop3.c
+++ b/src/pop3.c
diff --git a/pop3.h b/src/pop3.h
index 41dc320c..41dc320c 100644
--- a/pop3.h
+++ b/src/pop3.h
diff --git a/pop3d.c b/src/pop3d.c
index c5d7a87d..c5d7a87d 100644
--- a/pop3d.c
+++ b/src/pop3d.c
diff --git a/server.c b/src/server.c
index fd50633c..fd50633c 100644
--- a/server.c
+++ b/src/server.c
diff --git a/server.h b/src/server.h
index f05c0956..f05c0956 100644
--- a/server.h
+++ b/src/server.h
diff --git a/serverchild.c b/src/serverchild.c
index df3abfb9..df3abfb9 100644
--- a/serverchild.c
+++ b/src/serverchild.c
diff --git a/serverchild.h b/src/serverchild.h
index 0e3d01be..0e3d01be 100644
--- a/serverchild.h
+++ b/src/serverchild.h
diff --git a/serverparent.c b/src/serverparent.c
index da315e02..da315e02 100644
--- a/serverparent.c
+++ b/src/serverparent.c
diff --git a/serverparent.h b/src/serverparent.h
index f0dfac83..f0dfac83 100644
--- a/serverparent.h
+++ b/src/serverparent.h
diff --git a/serverpool.c b/src/serverpool.c
index 4eff649f..4eff649f 100644
--- a/serverpool.c
+++ b/src/serverpool.c
diff --git a/serverpool.h b/src/serverpool.h
index f8bf5907..f8bf5907 100644
--- a/serverpool.h
+++ b/src/serverpool.h
diff --git a/serversession.c b/src/serversession.c
index 61d4d456..61d4d456 100644
--- a/serversession.c
+++ b/src/serversession.c
diff --git a/serversession.h b/src/serversession.h
index 454ed970..454ed970 100644
--- a/serversession.h
+++ b/src/serversession.h
diff --git a/sievecmd.c b/src/sievecmd.c
index 653b7f9d..653b7f9d 100644
--- a/sievecmd.c
+++ b/src/sievecmd.c
diff --git a/sort.c b/src/sort.c
index 71ebd54c..71ebd54c 100644
--- a/sort.c
+++ b/src/sort.c
diff --git a/sort.h b/src/sort.h
index 9123f9e2..9123f9e2 100644
--- a/sort.h
+++ b/src/sort.h
diff --git a/sortmodule.c b/src/sortmodule.c
index cc720633..cc720633 100644
--- a/sortmodule.c
+++ b/src/sortmodule.c
diff --git a/sortmodule.h b/src/sortmodule.h
index cb0d91d3..cb0d91d3 100644
--- a/sortmodule.h
+++ b/src/sortmodule.h
diff --git a/timsieve.c b/src/timsieve.c
index c5788330..c5788330 100644
--- a/timsieve.c
+++ b/src/timsieve.c
diff --git a/timsieve.h b/src/timsieve.h
index 8ba2b860..8ba2b860 100644
--- a/timsieve.h
+++ b/src/timsieve.h
diff --git a/timsieved.c b/src/timsieved.c
index 6dff6af2..6dff6af2 100644
--- a/timsieved.c
+++ b/src/timsieved.c
diff --git a/top.c b/src/top.c
index ab65e7ac..ab65e7ac 100644
--- a/top.c
+++ b/src/top.c
diff --git a/user.c b/src/user.c
index ec9cdbc6..ec9cdbc6 100644
--- a/user.c
+++ b/src/user.c
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 00000000..ad5e5758
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,86 @@
+
+AM_CFLAGS = @SIEVEINC@ @LDAPINC@
+
+INCLUDES = -I$(top_srcdir)/src
+
+if WITHCHECK
+
+CHECK_LDADD= $(top_srcdir)/src/libdbmail.la @CHECK_LIBS@
+
+TESTS=check_dbmail_common \
+ check_dbmail_server \
+ check_dbmail_deliver \
+ check_dbmail_imapd \
+ check_dbmail_message \
+ check_dbmail_mailbox \
+ check_dbmail_auth \
+ check_dbmail_misc \
+ check_dbmail_list \
+ check_dbmail_user \
+ check_dbmail_util \
+ check_dbmail_dsn \
+ check_dbmail_db
+
+IMAPD = $(top_srcdir)/src/dm_quota.c \
+ $(top_srcdir)/src/dm_memblock.c \
+ $(top_srcdir)/src/imap4.c \
+ $(top_srcdir)/src/imapcommands.c \
+ $(top_srcdir)/src/dbmail-imapsession.c
+
+
+
+noinst_PROGRAMS=$(TESTS)
+
+check_dbmail_user_SOURCES=check_dbmail_user.c
+check_dbmail_user_LDADD=$(CHECK_LDADD)
+check_dbmail_user_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_auth_SOURCES=check_dbmail_auth.c
+check_dbmail_auth_LDADD=$(CHECK_LDADD)
+check_dbmail_auth_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_misc_SOURCES=check_dbmail_misc.c
+check_dbmail_misc_LDADD=$(CHECK_LDADD)
+check_dbmail_misc_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_list_SOURCES=check_dbmail_list.c
+check_dbmail_list_LDADD=$(CHECK_LDADD)
+check_dbmail_list_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_util_SOURCES=check_dbmail_util.c
+check_dbmail_util_LDADD=$(CHECK_LDADD)
+check_dbmail_util_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_dsn_SOURCES=check_dbmail_dsn.c
+check_dbmail_dsn_LDADD=$(CHECK_LDADD)
+check_dbmail_dsn_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_db_SOURCES=check_dbmail_db.c
+check_dbmail_db_LDADD=$(CHECK_LDADD)
+check_dbmail_db_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_common_SOURCES=check_dbmail_common.c
+check_dbmail_common_LDADD=$(CHECK_LDADD)
+check_dbmail_common_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_server_SOURCES=check_dbmail_server.c
+check_dbmail_server_LDADD=$(CHECK_LDADD)
+check_dbmail_server_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_deliver_SOURCES=check_dbmail_deliver.c
+check_dbmail_deliver_LDADD=$(CHECK_LDADD)
+check_dbmail_deliver_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_message_SOURCES=check_dbmail_message.c
+check_dbmail_message_LDADD=$(CHECK_LDADD)
+check_dbmail_message_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_mailbox_SOURCES=check_dbmail_mailbox.c
+check_dbmail_mailbox_LDADD=$(CHECK_LDADD)
+check_dbmail_mailbox_INCLUDES=@CHECK_CFLAGS@
+
+check_dbmail_imapd_SOURCES=$(IMAPD) check_dbmail_imapd.c
+check_dbmail_imapd_LDADD=$(CHECK_LDADD)
+check_dbmail_imapd_INCLUDES=@CHECK_CFLAGS@
+
+endif
diff --git a/check_dbmail.h b/test/check_dbmail.h
index 0cf89cef..0cf89cef 100644
--- a/check_dbmail.h
+++ b/test/check_dbmail.h
diff --git a/check_dbmail_auth.c b/test/check_dbmail_auth.c
index 52be58cb..52be58cb 100644
--- a/check_dbmail_auth.c
+++ b/test/check_dbmail_auth.c
diff --git a/check_dbmail_common.c b/test/check_dbmail_common.c
index 693a46ef..693a46ef 100644
--- a/check_dbmail_common.c
+++ b/test/check_dbmail_common.c
diff --git a/check_dbmail_db.c b/test/check_dbmail_db.c
index ea6a03c9..ea6a03c9 100644
--- a/check_dbmail_db.c
+++ b/test/check_dbmail_db.c
diff --git a/check_dbmail_deliver.c b/test/check_dbmail_deliver.c
index bad7c71a..bad7c71a 100644
--- a/check_dbmail_deliver.c
+++ b/test/check_dbmail_deliver.c
diff --git a/check_dbmail_dsn.c b/test/check_dbmail_dsn.c
index e53f0457..e53f0457 100644
--- a/check_dbmail_dsn.c
+++ b/test/check_dbmail_dsn.c
diff --git a/check_dbmail_imapd.c b/test/check_dbmail_imapd.c
index cf58fa13..cf58fa13 100644
--- a/check_dbmail_imapd.c
+++ b/test/check_dbmail_imapd.c
diff --git a/check_dbmail_list.c b/test/check_dbmail_list.c
index 554e8cbd..554e8cbd 100644
--- a/check_dbmail_list.c
+++ b/test/check_dbmail_list.c
diff --git a/check_dbmail_mailbox.c b/test/check_dbmail_mailbox.c
index adb9ca1a..adb9ca1a 100644
--- a/check_dbmail_mailbox.c
+++ b/test/check_dbmail_mailbox.c
diff --git a/check_dbmail_message.c b/test/check_dbmail_message.c
index 8b35c5c6..8b35c5c6 100644
--- a/check_dbmail_message.c
+++ b/test/check_dbmail_message.c
diff --git a/check_dbmail_misc.c b/test/check_dbmail_misc.c
index 21f95407..21f95407 100644
--- a/check_dbmail_misc.c
+++ b/test/check_dbmail_misc.c
diff --git a/check_dbmail_server.c b/test/check_dbmail_server.c
index 3ff02824..3ff02824 100644
--- a/check_dbmail_server.c
+++ b/test/check_dbmail_server.c
diff --git a/check_dbmail_user.c b/test/check_dbmail_user.c
index 916fff47..916fff47 100644
--- a/check_dbmail_user.c
+++ b/test/check_dbmail_user.c
diff --git a/check_dbmail_util.c b/test/check_dbmail_util.c
index 73e443e1..73e443e1 100644
--- a/check_dbmail_util.c
+++ b/test/check_dbmail_util.c