Index: head/mail/dbmail/Makefile =================================================================== --- head/mail/dbmail/Makefile (revision 538229) +++ head/mail/dbmail/Makefile (revision 538230) @@ -1,72 +1,73 @@ # Created by: Clement Laforet # $FreeBSD$ PORTNAME= dbmail -PORTVERSION= 3.2.3 -PORTREVISION= 9 +PORTVERSION= 3.2.4 +DISTVERSIONPREFIX= v CATEGORIES= mail -MASTER_SITES= http://git.dbmail.eu/paul/dbmail/snapshot/ \ - http://www.dbmail.org/download/3.2/ MAINTAINER= bofh@FreeBSD.org COMMENT= SQL database-based mail system (POP3 and IMAP) LICENSE= GPLv2 LIB_DEPENDS= libgmime-2.6.so:mail/gmime26 \ libzdb.so:databases/libzdb \ libmhash.so:security/mhash \ libevent.so:devel/libevent BUILD_DEPENDS= asciidoc:textproc/asciidoc \ xmlto:textproc/xmlto \ docbook-sgml>0:textproc/docbook-sgml +USES= autoreconf gmake gnome libtool localbase pkgconfig shebangfix ssl +USE_GITHUB= yes +USE_GNOME= glib20 +USE_LDCONFIG= ${PREFIX}/lib/dbmail +USE_RC_SUBR= dbmail-pop3d dbmail-lmtpd dbmail-imapd dbmail-timsieved + CONFLICTS= dbmail22-[0-9]* +GH_ACCOUNT= dbmail + OPTIONS_DEFINE= DOCS LDAP SIEVE OPTIONS_DEFAULT= SIEVE +OPTIONS_SUB= yes SIEVE_DESC= Sieve mail sorting language support -OPTIONS_SUB= yes - INSTALL_TARGET= install-strip -USES= autoreconf gmake libtool pkgconfig shebangfix ssl -USE_LDCONFIG= ${PREFIX}/lib/dbmail -USE_RC_SUBR= dbmail-pop3d dbmail-lmtpd dbmail-imapd dbmail-timsieved GNU_CONFIGURE= yes SHEBANG_FILES= man/fixsp.pl -CPPFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ARGS+= --with-zdb=${LOCALBASE} --sysconfdir=${LOCALBASE}/etc --enable-manpages MAKE_ARGS+= mandir=${MANPREFIX}/man -DOCS= AUTHORS BUGS INSTALL THANKS UPGRADING +DOCS= AUTHORS CHANGELOG.md INSTALL README THANKS UPGRADING SIEVE_CONFIGURE_WITH= sieve SIEVE_LIB_DEPENDS= libsieve.so:mail/libsieve LDAP_CONFIGURE_WITH= ldap LDAP_USE= OPENLDAP=yes +LDAP_USES= gettext-runtime DBMAIL_USER?= mailnull DBMAIL_GROUP?= mail PIDDIR?= /var/run/dbmail PLIST_SUB+= DBMAIL_USER="${DBMAIL_USER}" \ DBMAIL_GROUP="${DBMAIL_GROUP}" \ PIDDIR="${PIDDIR}" post-install: ${INSTALL_DATA} ${WRKSRC}/dbmail.conf ${STAGEDIR}${PREFIX}/etc/dbmail.conf.sample @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/dbmail.schema ${STAGEDIR}${DATADIR} (cd ${WRKSRC}/sql && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}) @${MKDIR} ${STAGEDIR}${PIDDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) .include Index: head/mail/dbmail/distinfo =================================================================== --- head/mail/dbmail/distinfo (revision 538229) +++ head/mail/dbmail/distinfo (revision 538230) @@ -1,3 +1,3 @@ -TIMESTAMP = 1573088818 -SHA256 (dbmail-3.2.3.tar.gz) = fd4d90e3e5ddb0c3fbdaa766d19d2464b5027a8c8d0b0df614418a3aac811832 -SIZE (dbmail-3.2.3.tar.gz) = 2444227 +TIMESTAMP = 1591622979 +SHA256 (dbmail-dbmail-v3.2.4_GH0.tar.gz) = 33c5d00f7a2d0a30ac90a220f9942c040fb4c8769a5940392294a874b1f9d549 +SIZE (dbmail-dbmail-v3.2.4_GH0.tar.gz) = 2461068 Index: head/mail/dbmail/files/patch-0025-Update-to-ldap_unbind_ext_s-and-remove-redundant-sigaction =================================================================== --- head/mail/dbmail/files/patch-0025-Update-to-ldap_unbind_ext_s-and-remove-redundant-sigaction (revision 538229) +++ head/mail/dbmail/files/patch-0025-Update-to-ldap_unbind_ext_s-and-remove-redundant-sigaction (nonexistent) @@ -1,50 +0,0 @@ -From 53ca6f11530a73838d73d3064f4b3d48e477f614 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Fri, 28 Oct 2016 16:38:20 +0100 -Subject: [PATCH 25/33] Update to ldap_unbind_ext_s and remove redundant - sigaction - ---- - src/modules/authldap.c | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 2180ed0..05c3331 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -167,14 +167,15 @@ static LDAP * ldap_con_get(void) - static void authldap_free(gpointer data) - { - LDAP *c = (LDAP *)data; -- struct sigaction act, oldact; -- -- memset(&act, 0, sizeof(act)); -- memset(&oldact, 0, sizeof(oldact)); -- act.sa_handler = SIG_IGN; -- sigaction(SIGPIPE, &act, &oldact); -- ldap_unbind_ext(c, NULL, NULL); -- sigaction(SIGPIPE, &oldact, 0); -+ -+ int err = ldap_set_option(c, LDAP_OPT_SERVER_CONTROLS, NULL ); -+ if ( err != LDAP_OPT_SUCCESS ) { -+ TRACE(TRACE_ERR, "Could not unset controls"); -+ } -+ -+ if ((err = ldap_unbind_ext_s(c, NULL, NULL))) { -+ TRACE(TRACE_ERR, "ldap_unbind_ext_s failed: %s", ldap_err2string(err)); -+ } - } - - /* -@@ -639,7 +640,7 @@ int auth_connect(void) - int auth_disconnect(void) - { - // Just free the pointer, -- // G_PRIVATE_INIT calls GDestroyNotify -+ // G_PRIVATE_INIT calls GDestroyNotify - // which calls authldap_free() - g_private_replace(&ldap_conn_key, NULL); - return 0; --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0025-Update-to-ldap_unbind_ext_s-and-remove-redundant-sigaction ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0016-Remove-redundant-event_assign =================================================================== --- head/mail/dbmail/files/patch-0016-Remove-redundant-event_assign (revision 538229) +++ head/mail/dbmail/files/patch-0016-Remove-redundant-event_assign (nonexistent) @@ -1,30 +0,0 @@ -From 5be7e049c56442111a0a6ffa1d82b66a8547e6a8 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Thu, 13 Oct 2016 16:09:49 +0100 -Subject: [PATCH 16/33] Remove redundant event_assign - ---- - src/server.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git src/server.c src/server.c -index ba8e5c5..a940030 100644 ---- src/server.c -+++ src/server.c -@@ -826,13 +826,11 @@ int server_run(ServerConfig_T *conf) - for (i = 0; i < conf->socketcount; i++) { - TRACE(TRACE_DEBUG, "Adding event for plain socket [%d] [%d/%d]", conf->listenSockets[i], i+1, total); - evsock[i] = event_new(evbase, conf->listenSockets[i], EV_READ, server_sock_cb, NULL); -- event_assign(evsock[i], evbase, conf->listenSockets[i], EV_READ, server_sock_cb, evsock[i]); - event_add(evsock[i], NULL); - } - for (k = i, i = 0; i < conf->ssl_socketcount; i++, k++) { - TRACE(TRACE_DEBUG, "Adding event for ssl socket [%d] [%d/%d]", conf->ssl_listenSockets[i], k+1, total); - evsock[k] = event_new(evbase, conf->ssl_listenSockets[i], EV_READ, server_sock_ssl_cb, NULL); -- event_assign(evsock[k], evbase, conf->ssl_listenSockets[i], EV_READ, server_sock_ssl_cb, evsock[k]); - event_add(evsock[k], NULL); - } - } --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0016-Remove-redundant-event_assign ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0015-Get-timeout-from-config =================================================================== --- head/mail/dbmail/files/patch-0015-Get-timeout-from-config (revision 538229) +++ head/mail/dbmail/files/patch-0015-Get-timeout-from-config (nonexistent) @@ -1,61 +0,0 @@ -From af47f87dec649ad495a704926d5e0e004ad17301 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Wed, 12 Oct 2016 18:23:40 +0100 -Subject: [PATCH 15/33] Get timeout from config - ---- - src/modules/authldap.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index bbe553b..2bf3b95 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -59,7 +59,9 @@ typedef struct _ldap_cfg { - Field_T field_members; - Field_T query_string; - Field_T referrals; -+ Field_T query_timeout; - int scope_int, port_int, version_int; -+ int query_timeout_int; - } _ldap_cfg_t; - - static _ldap_cfg_t _ldap_cfg; -@@ -90,6 +92,7 @@ static void __auth_get_config(void) - GETCONFIGVALUE("QUERY_STRING", "LDAP", _ldap_cfg.query_string); - GETCONFIGVALUE("SCOPE", "LDAP", _ldap_cfg.scope); - GETCONFIGVALUE("REFERRALS", "LDAP", _ldap_cfg.referrals); -+ GETCONFIGVALUE("QUERY_TIMEOUT", "LDAP", _ldap_cfg.query_timeout); - - /* Store the port as an integer for later use. */ - _ldap_cfg.port_int = atoi(_ldap_cfg.port); -@@ -113,6 +116,8 @@ static void __auth_get_config(void) - else - _ldap_cfg.scope_int = LDAP_SCOPE_SUBTREE; - } -+ /* Store the timeout as an integer. */ -+ _ldap_cfg.query_timeout_int = atoi(_ldap_cfg.query_timeout); - TRACE(TRACE_DEBUG, "integer ldap scope is [%d]", _ldap_cfg.scope_int); - } - -@@ -141,7 +146,7 @@ static LDAP * ldap_con_get(void) - return ld; - } - int c = 0; -- int c_tries = 600; -+ int c_tries = _ldap_cfg.query_timeout_int; - int err = -1; // Start wanting success - while (err != 0 && c++ < c_tries) { - // Loop until success or too many retries -@@ -264,7 +269,7 @@ static LDAPMessage * authldap_search(const gchar *query) - char **_ldap_attrs = NULL; - int err = -1; // Start wanting success - int c = 0; -- int c_tries = 600; -+ int c_tries = _ldap_cfg.query_timeout_int; - LDAP *_ldap_conn; - - g_return_val_if_fail(query!=NULL, NULL); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0015-Get-timeout-from-config ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0017-Remove-deprecated-non-functioning-g_mem_profile =================================================================== --- head/mail/dbmail/files/patch-0017-Remove-deprecated-non-functioning-g_mem_profile (revision 538229) +++ head/mail/dbmail/files/patch-0017-Remove-deprecated-non-functioning-g_mem_profile (nonexistent) @@ -1,26 +0,0 @@ -From 2caa12157f2efc7c4482ab4130f7aaec1f48bef2 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Thu, 13 Oct 2016 16:10:51 +0100 -Subject: [PATCH 17/33] Remove deprecated non functioning g_mem_profile - ---- - src/server.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git src/server.c src/server.c -index a940030..e013ac0 100644 ---- src/server.c -+++ src/server.c -@@ -656,9 +656,6 @@ void server_sig_cb(int UNUSED fd, short UNUSED event, void *arg) - mainReload = 1; - case SIGPIPE: // ignore - break; -- case SIGUSR1: -- g_mem_profile(); -- break; - default: - exit(0); - break; --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0017-Remove-deprecated-non-functioning-g_mem_profile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0029-update-description-of-pid-file-location-in-server-man-page =================================================================== --- head/mail/dbmail/files/patch-0029-update-description-of-pid-file-location-in-server-man-page (revision 538229) +++ head/mail/dbmail/files/patch-0029-update-description-of-pid-file-location-in-server-man-page (nonexistent) @@ -1,34 +0,0 @@ -From 17c7e5f34b66cdfc4e9621cb69431ee657cfb346 Mon Sep 17 00:00:00 2001 -From: Chris Mayo -Date: Fri, 22 Jul 2016 20:38:00 +0100 -Subject: [PATCH 29/33] update description of pid file location in server man - pages - ---- - man/serveropts.txt | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git man/serveropts.txt man/serveropts.txt -index b01400d..5e14527 100644 ---- man/serveropts.txt -+++ man/serveropts.txt -@@ -3,10 +3,12 @@ OPTIONS - ------- - - -p pidfile:: -- Specify an alternate pid file. The daemons are currently hardcoded -- to use /var/run/dbmail- for their pid files, and will halt -- if the pid file cannot be written. Use the -p pidfile option to -- place the pid file in your system's preferred location. -+ Specify an alternate pid file. By default the daemons use dbmail-.pid -+ for their pid files, saving them in the directory specified by the -+ pid_directory entry in dbmail.conf or if that does not exist the value set by -+ the configuration option --localstatedir, and will halt if the pid file -+ cannot be written. Use the -p pidfile option to place the pid file in -+ your system's preferred location. - - -n:: - No daemonize: inetd mode. The program remains attached to the console from --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0029-update-description-of-pid-file-location-in-server-man-page ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0001-login_disabled-option-before-starttls-for-pop3 =================================================================== --- head/mail/dbmail/files/patch-0001-login_disabled-option-before-starttls-for-pop3 (revision 538229) +++ head/mail/dbmail/files/patch-0001-login_disabled-option-before-starttls-for-pop3 (nonexistent) @@ -1,77 +0,0 @@ -From ec74380db22e3d92641c972aa53823d02a56a5ad Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Wed, 18 Feb 2015 21:26:38 +0100 -Subject: [PATCH 01/33] login_disabled option before starttls for pop3 - ---- - dbmail.conf | 5 +++++ - src/pop3.c | 16 ++++++++++++++++ - 2 files changed, 21 insertions(+) - -diff --git dbmail.conf dbmail.conf -index 946e064..bf16d16 100644 ---- dbmail.conf -+++ dbmail.conf -@@ -227,6 +227,11 @@ port = 110 - # You can set an alternate banner to display when connecting to the service - # banner = DBMAIL pop3 server ready to rock - -+# If TLS is enabled, login before starttls is normally -+# allowed. Use login_disabled=yes to change this -+# -+# login_disabled = no -+ - # - # If yes, allows SMTP access from the host IP connecting by POP3. - # This requires addition configuration of your MTA -diff --git src/pop3.c src/pop3.c -index cc0863b..d03f71a 100644 ---- src/pop3.c -+++ src/pop3.c -@@ -366,6 +366,7 @@ int pop3(ClientSession_T *session, const char *buffer) - int found = 0; - //int indx = 0; - int validate_result; -+ bool login_disabled = FALSE; - uint64_t result, top_lines, top_messageid, user_idnr; - unsigned char *md5_apop_he; - struct message *msg; -@@ -431,6 +432,15 @@ int pop3(ClientSession_T *session, const char *buffer) - } - } - -+ if (state == CLIENTSTATE_INITIAL_CONNECT) { -+ if (server_conf->ssl) { -+ Field_T val; -+ GETCONFIGVALUE("login_disabled", "POP", val); -+ if (SMATCH(val, "yes")) -+ login_disabled = TRUE; -+ } -+ } -+ - switch (cmdtype) { - - case POP3_QUIT: -@@ -459,6 +469,9 @@ int pop3(ClientSession_T *session, const char *buffer) - if (state != CLIENTSTATE_INITIAL_CONNECT) - return pop3_error(session, "-ERR wrong command mode\r\n"); - -+ if (login_disabled && ! session->ci->sock->ssl_state) -+ return pop3_error(session, "-ERR try STLS\r\n"); -+ - if (session->username != NULL) { - /* reset username */ - g_free(session->username); -@@ -478,6 +491,9 @@ int pop3(ClientSession_T *session, const char *buffer) - if (state != CLIENTSTATE_INITIAL_CONNECT) - return pop3_error(session, "-ERR wrong command mode\r\n"); - -+ if (login_disabled && ! session->ci->sock->ssl_state) -+ return pop3_error(session, "-ERR try STLS\r\n"); -+ - if (session->password != NULL) { - g_free(session->password); - session->password = NULL; --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0001-login_disabled-option-before-starttls-for-pop3 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0002-fix-compiler-warnings-for-GCC5 =================================================================== --- head/mail/dbmail/files/patch-0002-fix-compiler-warnings-for-GCC5 (revision 538229) +++ head/mail/dbmail/files/patch-0002-fix-compiler-warnings-for-GCC5 (nonexistent) @@ -1,346 +0,0 @@ -From c3badbdb282a5ffb411ee2b5062ed345896fb149 Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Fri, 8 Jan 2016 18:42:24 +0100 -Subject: [PATCH 02/33] fix compiler warnings for GCC5 - ---- - src/dm_db.c | 26 +++++++++++++------------- - src/dm_mailbox.c | 6 +++--- - src/dm_mailboxstate.c | 4 ++-- - src/dm_message.c | 12 ++++++------ - src/dm_misc.c | 6 +++--- - src/dm_sievescript.c | 2 +- - src/maintenance.c | 2 +- - src/modules/authsql.c | 12 ++++++------ - src/pop3.c | 2 +- - 9 files changed, 36 insertions(+), 36 deletions(-) - -diff --git src/dm_db.c src/dm_db.c -index 8d72214..feb0b34 100644 ---- src/dm_db.c -+++ src/dm_db.c -@@ -1047,7 +1047,7 @@ int db_check_version(void) - /* test existence of usermap table */ - int db_use_usermap(void) - { -- int use_usermap = TRUE; -+ volatile int use_usermap = TRUE; - Connection_T c = db_con_get(); - TRY - if (! db_query(c, db_get_sql(SQL_TABLE_EXISTS), DBPFX, "usermap")) -@@ -1214,7 +1214,7 @@ static int dm_quota_user_validate(uint64_t user_idnr, uint64_t msg_size) - int dm_quota_rebuild_user(uint64_t user_idnr) - { - Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; -- uint64_t quotum = 0; -+ volatile uint64_t quotum = 0; - - c = db_con_get(); - TRY -@@ -1257,7 +1257,7 @@ int dm_quota_rebuild() - - GList *quota = NULL; - struct used_quota *q; -- int i = 0; -+ volatile int i = 0; - int result; - - c = db_con_get(); -@@ -1375,7 +1375,7 @@ int db_get_reply_body(uint64_t user_idnr, char **reply_body) - uint64_t db_get_useridnr(uint64_t message_idnr) - { - Connection_T c; ResultSet_T r; -- uint64_t user_idnr = 0; -+ volatile uint64_t user_idnr = 0; - c = db_con_get(); - TRY - r = db_query(c, "SELECT %smailboxes.owner_idnr FROM %smailboxes, %smessages " -@@ -1397,7 +1397,7 @@ uint64_t db_get_useridnr(uint64_t message_idnr) - int db_log_ip(const char *ip) - { - Connection_T c; ResultSet_T r; PreparedStatement_T s; volatile int t = DM_SUCCESS; -- uint64_t id = 0; -+ volatile uint64_t id = 0; - - c = db_con_get(); - TRY -@@ -1444,8 +1444,8 @@ int db_empty_mailbox(uint64_t user_idnr, int only_empty) - Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; - GList *mboxids = NULL; - uint64_t *id; -- unsigned i = 0; -- int result = 0; -+ volatile unsigned i = 0; -+ volatile int result = 0; - - c = db_con_get(); - -@@ -2165,7 +2165,7 @@ static int mailboxes_by_regex(uint64_t user_idnr, int only_subscribed, const cha - char *spattern; - char *namespace, *username; - GString *qs = NULL; -- int n_rows = 0; -+ volatile int n_rows = 0; - PreparedStatement_T stmt; - int prml; - -@@ -2862,7 +2862,7 @@ int db_movemsg(uint64_t mailbox_to, uint64_t mailbox_from) - #define EXPIRE_DAYS 3 - int db_mailbox_has_message_id(uint64_t mailbox_idnr, const char *messageid) - { -- int rows = 0; -+ volatile int rows = 0; - Connection_T c; ResultSet_T r; PreparedStatement_T s; - char expire[DEF_FRAGSIZE], partial[DEF_FRAGSIZE]; - INIT_QUERY; -@@ -2909,7 +2909,7 @@ int db_mailbox_has_message_id(uint64_t mailbox_idnr, const char *messageid) - static uint64_t message_get_size(uint64_t message_idnr) - { - Connection_T c; ResultSet_T r; -- uint64_t size = 0; -+ volatile uint64_t size = 0; - - c = db_con_get(); - TRY -@@ -3443,8 +3443,8 @@ int db_usermap_resolve(ClientBase_T *ci, const char *username, char *real_userna - { - char clientsock[DM_SOCKADDR_LEN]; - const char *userid = NULL, *sockok = NULL, *sockno = NULL, *login = NULL; -- unsigned row = 0; -- int result = TRUE; -+ volatile unsigned row = 0; -+ volatile int result = TRUE; - int score, bestscore = -1; - char *bestlogin = NULL, *bestuserid = NULL; - Connection_T c; ResultSet_T r; PreparedStatement_T s; -@@ -3653,7 +3653,7 @@ int db_user_validate(ClientBase_T *ci, const char *pwfield, uint64_t *user_idnr, - { - int is_validated = 0; - char salt[13], cryptres[35]; -- int t = FALSE; -+ volatile int t = FALSE; - char dbpass[COLUMN_WIDTH+1]; - char encode[COLUMN_WIDTH+1]; - char hashstr[FIELDSIZE]; -diff --git src/dm_mailbox.c src/dm_mailbox.c -index 3558b8e..6f4b99c 100644 ---- src/dm_mailbox.c -+++ src/dm_mailbox.c -@@ -181,7 +181,7 @@ static int _mimeparts_dump(DbmailMailbox *self, GMimeStream *ostream) - uint64_t msgid, physid, *id; - DbmailMessage *m; - GTree *uids; -- int count = 0; -+ volatile int count = 0; - PreparedStatement_T stmt; - Connection_T c; - ResultSet_T r; -@@ -475,7 +475,7 @@ char * dbmail_mailbox_sorted_as_string(DbmailMailbox *self) - uint64_t *msn; - - l = g_list_first(self->sorted); -- if (! g_list_length(l)>0) -+ if (! (g_list_length(l) > 0)) - return s; - - t = g_string_new(""); -@@ -1224,7 +1224,7 @@ static GTree * mailbox_search(DbmailMailbox *self, search_key *s) - char partial[DEF_FRAGSIZE]; - Connection_T c; ResultSet_T r; PreparedStatement_T st; - GTree *ids; -- char *inset = NULL; -+ volatile char *inset = NULL; - - GString *t; - String_T q; -diff --git src/dm_mailboxstate.c src/dm_mailboxstate.c -index 2ef3fd3..723689a 100644 ---- src/dm_mailboxstate.c -+++ src/dm_mailboxstate.c -@@ -977,7 +977,7 @@ int MailboxState_hasPermission(T M, uint64_t userid, const char *right_flag) - if (! owner_id) { - result = db_get_mailbox_owner(mboxid, &owner_id); - MailboxState_setOwner(M, owner_id); -- if (! result > 0) -+ if (! (result > 0)) - return result; - } - -@@ -1116,7 +1116,7 @@ int MailboxState_build_recent(T M) - return 0; - } - --static long long int _update_recent(GList *slices, uint64_t seq) -+static long long int _update_recent(volatile GList *slices, uint64_t seq) - { - INIT_QUERY; - Connection_T c; -diff --git src/dm_message.c src/dm_message.c -index 066634a..9d30d52 100644 ---- src/dm_message.c -+++ src/dm_message.c -@@ -361,11 +361,11 @@ static DbmailMessage * _mime_retrieve(DbmailMessage *self) - ResultSet_T r; - char internal_date[SQL_INTERNALDATE_LEN]; - GMimeContentType *mimetype = NULL; -- int prevdepth, depth = 0, row = 0; -+ volatile int prevdepth, depth = 0, row = 0; - volatile int t = FALSE; -- gboolean got_boundary = FALSE, prev_boundary = FALSE, is_header = TRUE, prev_header, finalized=FALSE; -- gboolean prev_is_message = FALSE, is_message = FALSE; -- String_T m = NULL, n = NULL; -+ volatile gboolean got_boundary = FALSE, prev_boundary = FALSE, is_header = TRUE, prev_header, finalized=FALSE; -+ volatile gboolean prev_is_message = FALSE, is_message = FALSE; -+ volatile String_T m = NULL, n = NULL; - const void *blob; - Field_T frag; - -@@ -530,7 +530,7 @@ static gboolean store_mime_multipart(GMimeObject *object, DbmailMessage *m, cons - { - const char *boundary; - const char *preface = NULL, *postface = NULL; -- int n, i, c; -+ int n = 0, i, c; - - g_return_val_if_fail(GMIME_IS_OBJECT(object), TRUE); - -@@ -1977,7 +1977,7 @@ DbmailMessage * dbmail_message_construct(DbmailMessage *self, - - static int get_mailbox_from_filters(DbmailMessage *message, uint64_t useridnr, const char *mailbox, char *into, size_t into_n) - { -- int t = FALSE; -+ volatile int t = FALSE; - uint64_t anyone = 0; - PreparedStatement_T stmt; - Connection_T c; -diff --git src/dm_misc.c src/dm_misc.c -index e6ca9a0..1294930 100644 ---- src/dm_misc.c -+++ src/dm_misc.c -@@ -1029,7 +1029,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) - - type=g_strdup("AND"); - -- if (! g_tree_nnodes(a) > 0) -+ if (! (g_tree_nnodes(a) > 0)) - break; - - /* delete from A all keys not in B */ -@@ -1053,7 +1053,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) - case IST_SUBSEARCH_OR: - type=g_strdup("OR"); - -- if (! g_tree_nnodes(b) > 0) -+ if (! (g_tree_nnodes(b) > 0)) - break; - - merger->tree = a; -@@ -1081,7 +1081,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) - case IST_SUBSEARCH_NOT: - type=g_strdup("NOT"); - -- if (! g_tree_nnodes(b) > 0) -+ if (! (g_tree_nnodes(b) > 0)) - break; - - keys = g_tree_keys(b); -diff --git src/dm_sievescript.c src/dm_sievescript.c -index e163413..80f333d 100644 ---- src/dm_sievescript.c -+++ src/dm_sievescript.c -@@ -132,7 +132,7 @@ int dm_sievescript_list(uint64_t user_idnr, GList **scriptlist) - - int dm_sievescript_rename(uint64_t user_idnr, char *scriptname, char *newname) - { -- int active = 0; -+ volatile int active = 0; - Connection_T c; ResultSet_T r; PreparedStatement_T s; volatile int t = FALSE; - assert(scriptname); - -diff --git src/maintenance.c src/maintenance.c -index 2e46453..b4a020b 100644 ---- src/maintenance.c -+++ src/maintenance.c -@@ -1012,7 +1012,7 @@ int do_migrate(int migrate_limit) - { - Connection_T c; ResultSet_T r; - int id = 0; -- int count = 0; -+ volatile int count = 0; - DbmailMessage *m; - - qprintf ("Migrate legacy 2.2.x messageblks to mimeparts...\n"); -diff --git src/modules/authsql.c src/modules/authsql.c -index 49e1dc9..8e4829e 100644 ---- src/modules/authsql.c -+++ src/modules/authsql.c -@@ -97,7 +97,7 @@ int auth_getclientid(uint64_t user_idnr, uint64_t * client_idnr) - { - assert(client_idnr != NULL); - *client_idnr = 0; -- C c; R r; int t = TRUE; -+ C c; R r; volatile int t = TRUE; - - c = db_con_get(); - TRY -@@ -118,7 +118,7 @@ int auth_getmaxmailsize(uint64_t user_idnr, uint64_t * maxmail_size) - { - assert(maxmail_size != NULL); - *maxmail_size = 0; -- C c; R r; int t = TRUE; -+ C c; R r; volatile int t = TRUE; - - c = db_con_get(); - TRY -@@ -361,7 +361,7 @@ uint64_t auth_md5_validate(ClientBase_T *ci UNUSED, char *username, - uint64_t user_idnr = 0; - const char *dbpass; - C c; R r; -- int t = FALSE; -+ volatile int t = FALSE; - - /* lookup the user_idnr */ - if (! auth_user_exists(username, &user_idnr)) -@@ -430,7 +430,7 @@ char *auth_get_userid(uint64_t user_idnr) - - int auth_check_userid(uint64_t user_idnr) - { -- C c; R r; gboolean t = TRUE; -+ C c; R r; volatile gboolean t = TRUE; - - c = db_con_get(); - TRY -@@ -570,7 +570,7 @@ int auth_addalias_ext(const char *alias, - - int auth_removealias(uint64_t user_idnr, const char *alias) - { -- C c; S s; gboolean t = FALSE; -+ C c; S s; volatile gboolean t = FALSE; - - c = db_con_get(); - TRY -@@ -590,7 +590,7 @@ int auth_removealias(uint64_t user_idnr, const char *alias) - - int auth_removealias_ext(const char *alias, const char *deliver_to) - { -- C c; S s; gboolean t = FALSE; -+ C c; S s; volatile gboolean t = FALSE; - - c = db_con_get(); - TRY -diff --git src/pop3.c src/pop3.c -index d03f71a..b7106d3 100644 ---- src/pop3.c -+++ src/pop3.c -@@ -99,7 +99,7 @@ static int db_createsession(uint64_t user_idnr, ClientSession_T * session) - { - Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; - struct message *tmpmessage; -- int message_counter = 0; -+ volatile int message_counter = 0; - const char *query_result; - uint64_t mailbox_idnr; - INIT_QUERY; --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0002-fix-compiler-warnings-for-GCC5 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0099-Allow-for-systems-that-don-t-use-proc =================================================================== --- head/mail/dbmail/files/patch-0099-Allow-for-systems-that-don-t-use-proc (revision 538229) +++ head/mail/dbmail/files/patch-0099-Allow-for-systems-that-don-t-use-proc (nonexistent) @@ -1,35 +0,0 @@ -From 6169c48e7815f7e999e23f65c91ab7299f437b7a Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Sun, 15 Jan 2017 14:29:20 +0000 -Subject: [PATCH 27/27] Allow for systems that don't use proc - ---- - src/dm_misc.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git src/dm_misc.c src/dm_misc.c -index e795de1..1599c64 100644 ---- src/dm_misc.c -+++ src/dm_misc.c -@@ -106,6 +106,10 @@ int drop_privileges(char *newuser, char *newgroup) - - int get_opened_fd_count(void) - { -+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__SUNPRO_C) -+ // BSD like systems don't use proc -+ return 0; -+#else - DIR* dir = NULL; - struct dirent* entry = NULL; - char buf[32]; -@@ -122,6 +126,7 @@ int get_opened_fd_count(void) - closedir(dir); - - return fd_count - 2; /* exclude '.' and '..' entries */ -+#endif - } - - void create_unique_id(char *target, uint64_t message_idnr) --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0099-Allow-for-systems-that-don-t-use-proc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0009-Rework-temporary-connection-failures =================================================================== --- head/mail/dbmail/files/patch-0009-Rework-temporary-connection-failures (revision 538229) +++ head/mail/dbmail/files/patch-0009-Rework-temporary-connection-failures (nonexistent) @@ -1,162 +0,0 @@ -From 9d093f76a82c88647df1cd0ef08b3e8f82e26abb Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Fri, 30 Sep 2016 17:17:05 +0100 -Subject: [PATCH 09/33] Rework temporary connection failures - ---- - src/modules/authldap.c | 102 ++++++++++++++++++++++++++++++++----------------- - 1 file changed, 67 insertions(+), 35 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 19802c8..2073768 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -110,18 +110,48 @@ static gpointer authldap_once(gpointer UNUSED data) - return (gpointer)NULL; - } - --/* -- lookup thread-local ldap connection --*/ -+/* -+ * ldap_con_get() -+ * -+ * Lookup thread-local ldap connection and bind using config credentials -+ * retrying a few times if the server is temporarily unavailable -+ * -+ * returns connection on success, NULL on failure -+ */ - static LDAP * ldap_con_get(void) - { -- LDAP * c = (LDAP *)g_static_private_get(&ldap_conn_key); -- if (! c) { -- authldap_connect(); -- c = (LDAP *)g_static_private_get(&ldap_conn_key); -+ LDAP * ld = (LDAP *)g_static_private_get(&ldap_conn_key); -+ if (ld) { -+ TRACE(TRACE_DEBUG, "connection [%p]", ld); -+ return ld; - } -- TRACE(TRACE_DEBUG, "connection [%p]", c); -- return c; -+ int c = 0; -+ int err = -1; // Start wanting success -+ while (err != 0 && c++ < 5) { -+ // Loop until success or too many retries -+ TRACE(TRACE_DEBUG, "No connection trying [%d]", c); -+ -+ err = authldap_connect(); -+ -+ switch (err) { -+ case LDAP_SUCCESS: -+ ld = (LDAP *)g_static_private_get(&ldap_conn_key); -+ TRACE(TRACE_DEBUG, "connection [%p]", ld); -+ break; -+ case LDAP_SERVER_DOWN: -+ TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying to reconnect(%d/5).", ldap_err2string(err),c); -+ sleep(2); // reconnect failed. wait before trying again -+ break; -+ default: -+ TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); -+ break; -+ } -+ } -+ if (! ld) { -+ TRACE(TRACE_ERR, "Unable to connect to LDAP giving up"); -+ } -+ TRACE(TRACE_DEBUG, "connection [%p]", ld); -+ return ld; - } - - /* -@@ -140,6 +170,13 @@ static void authldap_free(gpointer data) - sigaction(SIGPIPE, &oldact, 0); - } - -+/* -+ * auth_ldap_bind() -+ * -+ * Bind to server using config credentials -+ * -+ * returns 0 on success, -1 on failure -+ */ - static int auth_ldap_bind(void) - { - int err; -@@ -153,7 +190,6 @@ static int auth_ldap_bind(void) - } - - return 0; -- - } - - /* -@@ -213,44 +249,40 @@ static int authldap_connect(void) - return auth_ldap_bind(); - } - --static int authldap_reconnect(void) --{ -- LDAP *c; -- if ((c = ldap_con_get())) authldap_free((gpointer)c); -- return authldap_connect(); --} -- -+/* -+ * authldap_search() -+ * -+ * Perform an LDAP search -+ * -+ * returns search results on success, NULL on failure -+ */ - static LDAPMessage * authldap_search(const gchar *query) - { - LDAPMessage *ldap_res; - int _ldap_attrsonly = 0; - char **_ldap_attrs = NULL; -- int c=0, err; -+ int err; - LDAP *_ldap_conn; - - g_return_val_if_fail(query!=NULL, NULL); - - _ldap_conn = ldap_con_get(); - -- while (c++ < 5) { -- TRACE(TRACE_DEBUG, " [%s]", query); -- err = ldap_search_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -- query, _ldap_attrs, _ldap_attrsonly, &ldap_res); -+ TRACE(TRACE_DEBUG, " [%s]", query); -+ err = ldap_search_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -+ query, _ldap_attrs, _ldap_attrsonly, &ldap_res); - -- if (! err) -- return ldap_res; -+ if (! err) -+ return ldap_res; - -- switch (err) { -- case LDAP_SERVER_DOWN: -- TRACE(TRACE_WARNING, "LDAP gone away: %s. Try to reconnect(%d/5).", ldap_err2string(err),c); -- if (authldap_reconnect()) -- sleep(2); // reconnect failed. wait before trying again -- break; -- default: -- TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); -- return NULL; -- break; -- } -+ switch (err) { -+ case LDAP_SERVER_DOWN: -+ TRACE(TRACE_WARNING, "LDAP gone away: %s).", ldap_err2string(err)); -+ break; -+ default: -+ TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); -+ return NULL; -+ break; - } - - TRACE(TRACE_EMERG,"unrecoverable error while talking to ldap server"); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0009-Rework-temporary-connection-failures ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0019-Revert-inadvertant-event_assign-removal =================================================================== --- head/mail/dbmail/files/patch-0019-Revert-inadvertant-event_assign-removal (revision 538229) +++ head/mail/dbmail/files/patch-0019-Revert-inadvertant-event_assign-removal (nonexistent) @@ -1,30 +0,0 @@ -From 91014a1cd01e17215fdc03fb5d922b5b73ac564a Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Fri, 14 Oct 2016 17:54:49 +0100 -Subject: [PATCH 19/33] Revert inadvertant event_assign removal - ---- - src/server.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git src/server.c src/server.c -index e013ac0..72fab52 100644 ---- src/server.c -+++ src/server.c -@@ -823,11 +823,13 @@ int server_run(ServerConfig_T *conf) - for (i = 0; i < conf->socketcount; i++) { - TRACE(TRACE_DEBUG, "Adding event for plain socket [%d] [%d/%d]", conf->listenSockets[i], i+1, total); - evsock[i] = event_new(evbase, conf->listenSockets[i], EV_READ, server_sock_cb, NULL); -+ event_assign(evsock[i], evbase, conf->listenSockets[i], EV_READ, server_sock_cb, evsock[i]); - event_add(evsock[i], NULL); - } - for (k = i, i = 0; i < conf->ssl_socketcount; i++, k++) { - TRACE(TRACE_DEBUG, "Adding event for ssl socket [%d] [%d/%d]", conf->ssl_listenSockets[i], k+1, total); - evsock[k] = event_new(evbase, conf->ssl_listenSockets[i], EV_READ, server_sock_ssl_cb, NULL); -+ event_assign(evsock[k], evbase, conf->ssl_listenSockets[i], EV_READ, server_sock_ssl_cb, evsock[k]); - event_add(evsock[k], NULL); - } - } --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0019-Revert-inadvertant-event_assign-removal ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0032-10083-prepend-headers-during-delivery =================================================================== --- head/mail/dbmail/files/patch-0032-10083-prepend-headers-during-delivery (revision 538229) +++ head/mail/dbmail/files/patch-0032-10083-prepend-headers-during-delivery (nonexistent) @@ -1,25 +0,0 @@ -From d213fd84529b3ff3da8b32aa15ef58f2b335383d Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Sat, 3 Dec 2016 17:33:13 +0100 -Subject: [PATCH 32/33] [#10083] prepend headers during delivery - ---- - src/dm_message.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git src/dm_message.c src/dm_message.c -index 784c091..82b0656 100644 ---- src/dm_message.c -+++ src/dm_message.c -@@ -892,7 +892,7 @@ const char * dbmail_message_get_envelope_recipient(const DbmailMessage *self) - - void dbmail_message_set_header(DbmailMessage *self, const char *header, const char *value) - { -- g_mime_object_set_header(GMIME_OBJECT(self->content), header, value); -+ g_mime_object_prepend_header(GMIME_OBJECT(self->content), header, value); - } - - const gchar * dbmail_message_get_header(const DbmailMessage *self, const char *header) --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0032-10083-prepend-headers-during-delivery ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0023-Update-ldap-deprecated-unbind =================================================================== --- head/mail/dbmail/files/patch-0023-Update-ldap-deprecated-unbind (revision 538229) +++ head/mail/dbmail/files/patch-0023-Update-ldap-deprecated-unbind (nonexistent) @@ -1,25 +0,0 @@ -From de4a37ae92bec56314318647a0561c891fee6e33 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Mon, 24 Oct 2016 15:13:21 +0100 -Subject: [PATCH 23/33] Update ldap deprecated unbind - ---- - src/modules/authldap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 7fa3a73..9c9d82e 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -173,7 +173,7 @@ static void authldap_free(gpointer data) - memset(&oldact, 0, sizeof(oldact)); - act.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &act, &oldact); -- ldap_unbind(c); -+ ldap_unbind_ext(c, NULL, NULL); - sigaction(SIGPIPE, &oldact, 0); - } - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0023-Update-ldap-deprecated-unbind ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0007-Disconnect-IMAP-clients-if-only-few-free-FDs-left =================================================================== --- head/mail/dbmail/files/patch-0007-Disconnect-IMAP-clients-if-only-few-free-FDs-left (revision 538229) +++ head/mail/dbmail/files/patch-0007-Disconnect-IMAP-clients-if-only-few-free-FDs-left (nonexistent) @@ -1,148 +0,0 @@ -From 6b7eccfec4f76b7d9d1f865caf741ff3214b5964 Mon Sep 17 00:00:00 2001 -From: Pavlo Lavrenenko -Date: Thu, 2 Jun 2016 08:18:51 +0300 -Subject: [PATCH 07/33] Disconnect IMAP clients if only few free FDs left (#37) - -After network connection to DB server goes down the processing of IMAP session -stalls: DB connection pool becomes exhausted as active connections do not -close till TCP timeout kicks in (true at least for Oracle). While DBMail still -accepts incoming connections it quickly reaches the RLIMIT_NOFILE and becomes -unresponsive. Send BYE response if the number of opened FDs reaches the -RLIMIT_NOFILE value. ---- - src/dbmail.h.in | 5 +++++ - src/dm_misc.c | 20 ++++++++++++++++++++ - src/dm_misc.h | 8 ++++++++ - src/imap4.c | 23 ++++++++++++++++++++++- - 4 files changed, 55 insertions(+), 1 deletion(-) - -diff --git src/dbmail.h.in src/dbmail.h.in -index d826dc3..17215ef 100644 ---- src/dbmail.h.in -+++ src/dbmail.h.in -@@ -69,12 +69,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - #include - #include -+#include - #include - #include - #include -@@ -252,6 +254,9 @@ - /* input reading linelimit */ - #define MAX_LINESIZE (64*1024) - -+/* minumun number of free file descriptors required to run the daemon */ -+#define FREE_DF_THRESHOLD 16 -+ - /* string length for query */ - #define DEF_QUERYSIZE (32*1024) - #define DEF_FRAGSIZE 256 -diff --git src/dm_misc.c src/dm_misc.c -index e27ef34..e795de1 100644 ---- src/dm_misc.c -+++ src/dm_misc.c -@@ -104,6 +104,26 @@ int drop_privileges(char *newuser, char *newgroup) - return 0; - } - -+int get_opened_fd_count(void) -+{ -+ DIR* dir = NULL; -+ struct dirent* entry = NULL; -+ char buf[32]; -+ int fd_count = 0; -+ -+ snprintf(buf, 32, "/proc/%i/fd/", getpid()); -+ -+ dir = opendir(buf); -+ if (dir == NULL) -+ return -1; -+ -+ while ((entry = readdir(dir)) != NULL) -+ fd_count++; -+ closedir(dir); -+ -+ return fd_count - 2; /* exclude '.' and '..' entries */ -+} -+ - void create_unique_id(char *target, uint64_t message_idnr) - { - char md5_str[FIELDSIZE]; -diff --git src/dm_misc.h src/dm_misc.h -index 9660dfa..b6cf24f 100644 ---- src/dm_misc.h -+++ src/dm_misc.h -@@ -45,6 +45,14 @@ void g_string_maybe_shrink(GString *s); - int drop_privileges(char *newuser, char *newgroup); - - /** -+ \brief get the number of opened files (requires /proc mounted) -+ \return -+ - -1 on error -+ - number of opened files -+*/ -+int get_opened_fd_count(void); -+ -+/** - * \brief create a unique id for a message (used for pop, stored per message) - * \param target target string. Length should be UID_SIZE - * \param message_idnr message_idnr of message -diff --git src/imap4.c src/imap4.c -index 0532f2e..e523edc 100644 ---- src/imap4.c -+++ src/imap4.c -@@ -351,6 +351,12 @@ static void send_greeting(ImapSession *session) - dbmail_imap_session_set_state(session, CLIENTSTATE_NON_AUTHENTICATED); - } - -+static void disconnect_user(ImapSession *session) -+{ -+ imap_session_printf(session, "* BYE [Service unavailable.]\r\n"); -+ imap_handle_abort(session); -+} -+ - /* - * the default timeout callback */ - -@@ -601,6 +607,8 @@ int imap_handle_connection(client_sock *c) - { - ImapSession *session; - ClientBase_T *ci; -+ struct rlimit fd_limit; -+ int fd_count; - - ci = client_init(c); - -@@ -617,7 +625,20 @@ int imap_handle_connection(client_sock *c) - Capa_remove(session->capa, "LOGINDISABLED"); - } - -- send_greeting(session); -+ fd_count = get_opened_fd_count(); -+ if (fd_count < 0 || getrlimit(RLIMIT_NPROC, &fd_limit) < 0) { -+ TRACE(TRACE_ERR, -+ "[%p] failed to retrieve fd limits, dropping client connection", -+ session); -+ disconnect_user(session); -+ } else if (fd_limit.rlim_cur - fd_count < FREE_DF_THRESHOLD) { -+ TRACE(TRACE_WARNING, -+ "[%p] fd count [%d], fd limit [%d], fd threshold [%d]: dropping client connection", -+ session, fd_count, fd_limit.rlim_cur, FREE_DF_THRESHOLD); -+ disconnect_user(session); -+ } else { -+ send_greeting(session); -+ } - - reset_callbacks(session); - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0007-Disconnect-IMAP-clients-if-only-few-free-FDs-left ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0012-Bump-search-timeout-to-60s =================================================================== --- head/mail/dbmail/files/patch-0012-Bump-search-timeout-to-60s (revision 538229) +++ head/mail/dbmail/files/patch-0012-Bump-search-timeout-to-60s (nonexistent) @@ -1,25 +0,0 @@ -From 5ed508954309e9a5ad6610be47fd02be60f1e726 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Thu, 6 Oct 2016 15:04:51 +0100 -Subject: [PATCH 12/33] Bump search timeout to 60s - ---- - src/modules/authldap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 475c985..2a39e0e 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -266,7 +266,7 @@ static LDAPMessage * authldap_search(const gchar *query) - char **_ldap_attrs = NULL; - int err = -1; // Start wanting success - int c = 0; -- int c_tries = 10; -+ int c_tries = 60; - LDAP *_ldap_conn; - - g_return_val_if_fail(query!=NULL, NULL); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0012-Bump-search-timeout-to-60s ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0026-Rebalance-commit-rollback =================================================================== --- head/mail/dbmail/files/patch-0026-Rebalance-commit-rollback (revision 538229) +++ head/mail/dbmail/files/patch-0026-Rebalance-commit-rollback (nonexistent) @@ -1,71 +0,0 @@ -From 1a09a645c82e07fee8d42642a83652c6c85473ff Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Mon, 31 Oct 2016 18:27:45 +0000 -Subject: [PATCH 26/33] Rebalance commit/rollback - ---- - src/dm_mailboxstate.c | 9 ++++++--- - src/imapcommands.c | 1 + - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git src/dm_mailboxstate.c src/dm_mailboxstate.c -index 723689a..c04b6d7 100644 ---- src/dm_mailboxstate.c -+++ src/dm_mailboxstate.c -@@ -212,11 +212,12 @@ T MailboxState_new(Mempool_T pool, uint64_t id) - db_begin_transaction(c); // we need read-committed isolation - state_load_metadata(M, c); - state_load_messages(M, c); -+ db_commit_transaction(c); - CATCH(SQLException) - LOG_SQLERROR; -+ db_rollback_transaction(c); - t = DM_EQUERY; - FINALLY -- db_commit_transaction(c); - db_con_close(c); - END_TRY; - -@@ -888,11 +889,12 @@ int MailboxState_info(T M) - TRY - db_begin_transaction(c); - db_getmailbox_info(M, c); -+ db_commit_transaction(c); - CATCH(SQLException) - LOG_SQLERROR; -+ db_rollback_transaction(c); - t = DM_EQUERY; - FINALLY -- db_commit_transaction(c); - db_con_close(c); - END_TRY; - -@@ -928,11 +930,12 @@ int MailboxState_count(T M) - TRY - db_begin_transaction(c); - db_getmailbox_count(M, c); -+ db_commit_transaction(c); - CATCH(SQLException) - LOG_SQLERROR; -+ db_rollback_transaction(c); - t = DM_EQUERY; - FINALLY -- db_commit_transaction(c); - db_con_close(c); - END_TRY; - -diff --git src/imapcommands.c src/imapcommands.c -index bdedb4a..43760fc 100644 ---- src/imapcommands.c -+++ src/imapcommands.c -@@ -946,6 +946,7 @@ void _ic_delete_enter(dm_thread_data *D) - db_commit_transaction(c); - CATCH(SQLException) - LOG_SQLERROR; -+ db_rollback_transaction(c); - t = DM_EQUERY; - FINALLY - db_con_close(c); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0026-Rebalance-commit-rollback ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0031-boundaries-fixups-ordering-of-parts-do-not-add-newline-on- =================================================================== --- head/mail/dbmail/files/patch-0031-boundaries-fixups-ordering-of-parts-do-not-add-newline-on- (revision 538229) +++ head/mail/dbmail/files/patch-0031-boundaries-fixups-ordering-of-parts-do-not-add-newline-on- (nonexistent) @@ -1,180 +0,0 @@ -From 3fd6782988f01c2f56af19012e470ea16e800f51 Mon Sep 17 00:00:00 2001 -From: Michele Comitini -Date: Tue, 1 Nov 2016 21:20:16 +0100 -Subject: [PATCH 31/33] boundaries fixups: ordering of parts, do not add - newline on boundary if there's no part after previous header (#34) - -* Fix IMAP mailbox maintanence - -Update message's mailbox id in a separate explicit transaction to prevent -SQLException: ORA-01453 error on the next db_begin_transaction() call -(see db_mailbox_seq_update() next to 'UPDATE dbmail_messages SET mailbox_idnr' -query). - -* add newline only if is_message - -* better fix for rfc822 multipart messages with boundary after header - -* fixed some race condition when closing boundaries, since key does not change. Needed ordering parts on depth DESC when key does not vary. - -* fixes ordering in insertion ---- - src/dm_message.c | 12 ++++--- - test/check_dbmail.h | 78 ++++++++++++++++++++++++++++++++++++++++++++- - test/check_dbmail_message.c | 8 +++++ - 3 files changed, 93 insertions(+), 5 deletions(-) - -diff --git src/dm_message.c src/dm_message.c -index 9d30d52..784c091 100644 ---- src/dm_message.c -+++ src/dm_message.c -@@ -387,7 +387,7 @@ static DbmailMessage * _mime_retrieve(DbmailMessage *self) - "FROM %smimeparts p " - "JOIN %spartlists l ON p.id = l.part_id " - "JOIN %sphysmessage ph ON ph.id = l.physmessage_id " -- "WHERE l.physmessage_id = ? ORDER BY l.part_key,l.part_order ASC", -+ "WHERE l.physmessage_id = ? ORDER BY l.part_key, l.part_order ASC, l.part_depth DESC", - frag, p_string_str(n), DBPFX, DBPFX, DBPFX); - db_stmt_set_u64(stmt, 1, self->id); - r = db_stmt_query(stmt); -@@ -454,10 +454,14 @@ static DbmailMessage * _mime_retrieve(DbmailMessage *self) - if ((depth > 0) && (blist[depth-1][0])) - strncpy(boundary, blist[depth-1], MAX_MIME_BLEN-1); - -- if (is_header && (!prev_header || prev_boundary || (prev_header && depth>0 && !prev_is_message))) { -+ if (is_header) -+ if (prev_header && depth>0 && !prev_is_message) { -+ dprint("--%s\n", boundary); -+ p_string_append_printf(m, "--%s\n", boundary); -+ } else if (!prev_header || prev_boundary) { - dprint("\n--%s\n", boundary); - p_string_append_printf(m, "\n--%s\n", boundary); -- } -+ } - - p_string_append_printf(m, "%s", str); - dprint("\n%s\n\n", -@@ -558,7 +562,7 @@ static gboolean store_mime_multipart(GMimeObject *object, DbmailMessage *m, cons - if (boundary) { - n++; - m->part_depth--; -- m->part_order=n; -+ m->part_order++; - } - - if (g_mime_content_type_is_type(GMIME_CONTENT_TYPE(content_type), "multipart", "*") && -diff --git test/check_dbmail.h test/check_dbmail.h -index 09c9958..439c8a1 100644 ---- test/check_dbmail.h -+++ test/check_dbmail.h -@@ -1561,7 +1561,7 @@ char *multipart_message8 = "From: nobody@example.org\n" - "bmdzLnhtbFBLAQItABQABgAIAAAAIQDv0+Pp+gEAAPsDAAAQAAAAAAAAAAAAAAAAALREAABkb2NQ\n" - "cm9wcy9hcHAueG1sUEsFBgAAAAAPAA8A3AMAAORHAAAAAA==\n" - "\n" -- "--_004_AAD42BB12C540843AB5C952ADD4D978901830A1Bswi52mbx1orfloc_--\";\n"; -+ "--_004_AAD42BB12C540843AB5C952ADD4D978901830A1Bswi52mbx1orfloc_--\n"; - - char *multipart_message9 = "From: a\n" - "To: b\n" -@@ -28440,3 +28440,79 @@ char *multipart_message_big = "From: \"Gennadiy Poryev\" \n" - "/g8HAAAAAwANNP0/pQ4DAA80/T+lDvA8\n" - "\n" - "------=_NextPart_000_0000_01CDFBC6.932A1F00--\n"; -+ -+char *multipart_message_submessage = "Content-Type: multipart/mixed; boundary=\"===============9147350442359610775==\"\n" -+"MIME-Version: 1.0\n" -+"To: test@test.it\n" -+"From: test@test.it\n" -+"\n" -+"--===============9147350442359610775==\n" -+"Content-Type: message/rfc822\n" -+"MIME-Version: 1.0\n" -+"\n" -+"Content-Type: multipart/alternative;\n" -+" boundary=\"===============1150329730008994878==\"\n" -+"MIME-Version: 1.0\n" -+"Subject: Link\n" -+"From: my@email.com\n" -+"To: your@email.com\n" -+"\n" -+"--===============1150329730008994878==\n" -+"Content-Type: text/plain; charset=\"us-ascii\"\n" -+"MIME-Version: 1.0\n" -+"Content-Transfer-Encoding: 7bit\n" -+"\n" -+"Hi!\n" -+"How are you?\n" -+"Here is the link you wanted:\n" -+"https://www.python.org\n" -+"--===============1150329730008994878==\n" -+"Content-Type: text/html; charset=\"us-ascii\"\n" -+"MIME-Version: 1.0\n" -+"Content-Transfer-Encoding: 7bit\n" -+"\n" -+"\n" -+" \n" -+" \n" -+"

Hi!
\n" -+" How are you?
\n" -+" Here is the link you wanted.\n" -+"

\n" -+" \n" -+"\n" -+"\n" -+"--===============1150329730008994878==\n" -+"Content-Type: multipart/mixed; boundary=\"===============0782181963306111896==\"\n" -+"MIME-Version: 1.0\n" -+"\n" -+"--===============0782181963306111896==\n" -+"Content-Type: text/plain; charset=\"us-ascii\"\n" -+"MIME-Version: 1.0\n" -+"Content-Transfer-Encoding: 7bit\n" -+"\n" -+"Text part3_1.\n" -+"--===============0782181963306111896==\n" -+"Content-Type: text/plain; charset=\"us-ascii\"\n" -+"MIME-Version: 1.0\n" -+"Content-Transfer-Encoding: 7bit\n" -+"\n" -+"Text part3_2.\n" -+"--===============0782181963306111896==--\n" -+"\n" -+"\n" -+"\n" -+"\n" -+"--===============1150329730008994878==--\n" -+"\n" -+"--===============9147350442359610775==\n" -+"Content-Type: text/plain; charset=\"us-ascii\"\n" -+"MIME-Version: 1.0\n" -+"Content-Transfer-Encoding: 7bit\n" -+"\n" -+"This is a simple text attachment.\n" -+"with some newlines at the end.\n" -+"\n" -+"\n" -+"\n" -+"--===============9147350442359610775==--\n" -+"\n"; -diff --git test/check_dbmail_message.c test/check_dbmail_message.c -index e36a2ea..f070257 100644 ---- test/check_dbmail_message.c -+++ test/check_dbmail_message.c -@@ -431,6 +431,14 @@ START_TEST(test_dbmail_message_store) - COMPARE(e,t); - g_free(e); - g_free(t); -+ //----------------------------------------- -+ m = message_init(multipart_message_submessage); -+ e = dbmail_message_to_string(m); -+ t = store_and_retrieve(m); -+ COMPARE(e,t); -+ COMPARE(multipart_message_submessage, t); -+ g_free(e); -+ g_free(t); - } - END_TEST - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0031-boundaries-fixups-ordering-of-parts-do-not-add-newline-on- ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0027-ensure-mailbox2dbmail-is-using-Python-2 =================================================================== --- head/mail/dbmail/files/patch-0027-ensure-mailbox2dbmail-is-using-Python-2 (revision 538229) +++ head/mail/dbmail/files/patch-0027-ensure-mailbox2dbmail-is-using-Python-2 (nonexistent) @@ -1,22 +0,0 @@ -From 650dd4bd29c245a290a9e3f2dc4b0f734de22b69 Mon Sep 17 00:00:00 2001 -From: Chris Mayo -Date: Sat, 23 Jul 2016 17:32:43 +0100 -Subject: [PATCH 27/33] ensure mailbox2dbmail is using Python 2 - ---- - contrib/mailbox2dbmail/mailbox2dbmail | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git contrib/mailbox2dbmail/mailbox2dbmail contrib/mailbox2dbmail/mailbox2dbmail -index 6babffd..fa5c59d 100755 ---- contrib/mailbox2dbmail/mailbox2dbmail -+++ contrib/mailbox2dbmail/mailbox2dbmail -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python2 - - # Copyright (C) 2004 Dan Weber - # Copyright (C) 2012 Paul J Stevens --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0027-ensure-mailbox2dbmail-is-using-Python-2 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0013-Increase-ldap-timeout-to-600s-10-mins =================================================================== --- head/mail/dbmail/files/patch-0013-Increase-ldap-timeout-to-600s-10-mins (revision 538229) +++ head/mail/dbmail/files/patch-0013-Increase-ldap-timeout-to-600s-10-mins (nonexistent) @@ -1,34 +0,0 @@ -From 9a13e4878b94b742e17519c2f4379ee5a3498a73 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Tue, 11 Oct 2016 14:34:59 +0100 -Subject: [PATCH 13/33] Increase ldap timeout to 600s (10 mins) - ---- - src/modules/authldap.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 2a39e0e..3f43a56 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -126,7 +126,7 @@ static LDAP * ldap_con_get(void) - return ld; - } - int c = 0; -- int c_tries = 120; -+ int c_tries = 600; - int err = -1; // Start wanting success - while (err != 0 && c++ < c_tries) { - // Loop until success or too many retries -@@ -266,7 +266,7 @@ static LDAPMessage * authldap_search(const gchar *query) - char **_ldap_attrs = NULL; - int err = -1; // Start wanting success - int c = 0; -- int c_tries = 60; -+ int c_tries = 600; - LDAP *_ldap_conn; - - g_return_val_if_fail(query!=NULL, NULL); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0013-Increase-ldap-timeout-to-600s-10-mins ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0008-Add-primary-key-constraint-to-dbmail_authlog =================================================================== --- head/mail/dbmail/files/patch-0008-Add-primary-key-constraint-to-dbmail_authlog (revision 538229) +++ head/mail/dbmail/files/patch-0008-Add-primary-key-constraint-to-dbmail_authlog (nonexistent) @@ -1,26 +0,0 @@ -From 024ba19d1c83bee22b6b5901d2fff586d9391cf3 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Tue, 24 Feb 2015 11:27:45 +0000 -Subject: [PATCH 08/33] Add primary key constraint to dbmail_authlog - ---- - sql/postgresql/create_tables.pgsql | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git sql/postgresql/create_tables.pgsql sql/postgresql/create_tables.pgsql -index da3b694..45740fd 100644 ---- sql/postgresql/create_tables.pgsql -+++ sql/postgresql/create_tables.pgsql -@@ -46,7 +46,8 @@ CREATE TABLE dbmail_authlog ( - dst_port INT8, - status VARCHAR(32) DEFAULT 'active', - bytes_rx INT8 DEFAULT '0' NOT NULL, -- bytes_tx INT8 DEFAULT '0' NOT NULL -+ bytes_tx INT8 DEFAULT '0' NOT NULL, -+ PRIMARY KEY (id) - ); - - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0008-Add-primary-key-constraint-to-dbmail_authlog ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0014-Refactor-deprecared-functions =================================================================== --- head/mail/dbmail/files/patch-0014-Refactor-deprecared-functions (revision 538229) +++ head/mail/dbmail/files/patch-0014-Refactor-deprecared-functions (nonexistent) @@ -1,123 +0,0 @@ -From 30e4904b6baf5c3f00d4b096f5b51cfbb69958d0 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Wed, 12 Oct 2016 16:56:22 +0100 -Subject: [PATCH 14/33] Refactor deprecared functions - ---- - src/modules/authldap.c | 44 ++++++++++++++++++++------------------------ - 1 file changed, 20 insertions(+), 24 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 3f43a56..bbe553b 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -28,7 +28,23 @@ - - extern char configFile[PATH_MAX]; - --GStaticPrivate ldap_conn_key; -+/* -+ signal-safe releasing of thread-local ldap connection -+*/ -+static void authldap_free(gpointer data) -+{ -+ LDAP *c = (LDAP *)data; -+ struct sigaction act, oldact; -+ -+ memset(&act, 0, sizeof(act)); -+ memset(&oldact, 0, sizeof(oldact)); -+ act.sa_handler = SIG_IGN; -+ sigaction(SIGPIPE, &act, &oldact); -+ ldap_unbind(c); -+ sigaction(SIGPIPE, &oldact, 0); -+} -+ -+static GPrivate ldap_conn_key = G_PRIVATE_INIT (authldap_free); - static GOnce ldap_conn_once = G_ONCE_INIT; - static int authldap_connect(void); - -@@ -105,7 +121,6 @@ static void __auth_get_config(void) - */ - static gpointer authldap_once(gpointer UNUSED data) - { -- g_static_private_init(&ldap_conn_key); - __auth_get_config(); - return (gpointer)NULL; - } -@@ -120,7 +135,7 @@ static gpointer authldap_once(gpointer UNUSED data) - */ - static LDAP * ldap_con_get(void) - { -- LDAP * ld = (LDAP *)g_static_private_get(&ldap_conn_key); -+ LDAP * ld = (LDAP *)g_private_get(&ldap_conn_key); - if (ld) { - TRACE(TRACE_DEBUG, "connection [%p]", ld); - return ld; -@@ -136,7 +151,7 @@ static LDAP * ldap_con_get(void) - - switch (err) { - case LDAP_SUCCESS: -- ld = (LDAP *)g_static_private_get(&ldap_conn_key); -+ ld = (LDAP *)g_private_get(&ldap_conn_key); - TRACE(TRACE_DEBUG, "connection [%p]", ld); - break; - case LDAP_SERVER_DOWN: -@@ -144,7 +159,6 @@ static LDAP * ldap_con_get(void) - sleep(1); // reconnect failed. wait before trying again - break; - default: -- // Includes timeouts etc. Should probably refactor. - TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); - sleep(1); - break; -@@ -158,22 +172,6 @@ static LDAP * ldap_con_get(void) - } - - /* -- signal-safe releasing of thread-local ldap connection --*/ --static void authldap_free(gpointer data) --{ -- LDAP *c = (LDAP *)data; -- struct sigaction act, oldact; -- -- memset(&act, 0, sizeof(act)); -- memset(&oldact, 0, sizeof(oldact)); -- act.sa_handler = SIG_IGN; -- sigaction(SIGPIPE, &act, &oldact); -- ldap_unbind(c); -- sigaction(SIGPIPE, &oldact, 0); --} -- --/* - * auth_ldap_bind() - * - * Bind to server using config credentials -@@ -247,7 +245,7 @@ static int authldap_connect(void) - if (strncasecmp(_ldap_cfg.referrals, "no", 2) == 0) - ldap_set_option(_ldap_conn, LDAP_OPT_REFERRALS, 0); - -- g_static_private_set(&ldap_conn_key, _ldap_conn, (GDestroyNotify)authldap_free); -+ g_private_replace(&ldap_conn_key, _ldap_conn); - - return auth_ldap_bind(); - } -@@ -289,7 +287,6 @@ static LDAPMessage * authldap_search(const gchar *query) - TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying again(%d/%d).", ldap_err2string(err), c, c_tries); - break; - default: -- // Includes timeouts etc. Should probably refactor. - TRACE(TRACE_ERR, "LDAP error(%d): %s. Trying again (%d/%d).", err, ldap_err2string(err), c, c_tries); - break; - } -@@ -634,7 +631,6 @@ int auth_connect(void) - } - int auth_disconnect(void) - { -- g_static_private_free(&ldap_conn_key); - return 0; - } - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0014-Refactor-deprecared-functions ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence =================================================================== --- head/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence (revision 538229) +++ head/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence (nonexistent) @@ -1,81 +0,0 @@ -From f2d27f8727ae4159d356d63c1af6ac1a60b1261a Mon Sep 17 00:00:00 2001 -From: Pavlo Lavrenenko -Date: Thu, 21 May 2015 11:42:56 +0300 -Subject: [PATCH 03/33] Fix IMAP mailbox maintanence - -Update message's mailbox id in a separate explicit transaction to prevent -SQLException: ORA-01453 error on the next db_begin_transaction() call -(see db_mailbox_seq_update() next to 'UPDATE dbmail_messages SET mailbox_idnr' -query). ---- - src/dm_db.c | 6 ++++++ - src/dm_db.h | 1 + - src/maintenance.c | 8 ++------ - 3 files changed, 9 insertions(+), 6 deletions(-) - -diff --git src/dm_db.c src/dm_db.c -index feb0b34..313b33f 100644 ---- src/dm_db.c -+++ src/dm_db.c -@@ -4290,6 +4290,12 @@ void db_message_set_seq(uint64_t message_id, uint64_t seq) - END_TRY; - } - -+int db_move_message(uint64_t message_id, uint64_t mailbox_id) -+{ -+ return db_update("UPDATE %smessages SET mailbox_idnr = %" PRIu64 " WHERE message_idnr = %" PRIu64 "", -+ DBPFX, mailbox_id, message_id); -+} -+ - int db_rehash_store(void) - { - GList *ids = NULL; -diff --git src/dm_db.h src/dm_db.h -index 57aa256..84595d2 100644 ---- src/dm_db.h -+++ src/dm_db.h -@@ -777,6 +777,7 @@ char * db_returning(const char *s); - - uint64_t db_mailbox_seq_update(uint64_t mailbox_id, uint64_t message_id); - void db_message_set_seq(uint64_t message_id, uint64_t seq); -+int db_move_message(uint64_t message_id, uint64_t mailbox_id); - - int db_rehash_store(void); - -diff --git src/maintenance.c src/maintenance.c -index b4a020b..24b818c 100644 ---- src/maintenance.c -+++ src/maintenance.c -@@ -1184,7 +1184,7 @@ int do_erase_old(int days, char * mbtrash_name) - /* Move message to Trash if the message is in INBOX mailbox and date less then passed date. */ - int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - { -- Connection_T c; ResultSet_T r; ResultSet_T r1; PreparedStatement_T s; PreparedStatement_T s1; PreparedStatement_T s2; -+ Connection_T c; ResultSet_T r; ResultSet_T r1; PreparedStatement_T s; PreparedStatement_T s1; - int skip = 1; - char expire [DEF_FRAGSIZE]; - uint64_t mailbox_to; -@@ -1200,9 +1200,7 @@ int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - "WHERE mb.name = ? AND msg.status < %d " - "AND phys.internal_date < %s", - DBPFX, DBPFX, DBPFX, MESSAGE_STATUS_DELETE, expire); -- - s1 = db_stmt_prepare(c, "SELECT mailbox_idnr FROM %smailboxes WHERE owner_idnr = ? AND name = ?", DBPFX); -- s2 = db_stmt_prepare(c, "UPDATE %smessages SET mailbox_idnr = ? WHERE message_idnr = ?", DBPFX); - - db_stmt_set_str(s, 1, mbinbox_name); - -@@ -1225,9 +1223,7 @@ int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - } - - if (!skip) { -- db_stmt_set_u64(s2,1,mailbox_to); -- db_stmt_set_u64(s2,2,id); -- db_stmt_exec(s2); -+ db_move_message(id, mailbox_to); - db_mailbox_seq_update(mailbox_to, 0); - db_mailbox_seq_update(mailbox_from, 0); - } --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0024-Fix-typo =================================================================== --- head/mail/dbmail/files/patch-0024-Fix-typo (revision 538229) +++ head/mail/dbmail/files/patch-0024-Fix-typo (nonexistent) @@ -1,25 +0,0 @@ -From bd6b9d7d43640abbdd7f0ca410576e0c4d97c3dd Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Mon, 24 Oct 2016 17:02:49 +0100 -Subject: [PATCH 24/33] Fix typo - ---- - src/modules/authldap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 9c9d82e..2180ed0 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -641,7 +641,7 @@ int auth_disconnect(void) - // Just free the pointer, - // G_PRIVATE_INIT calls GDestroyNotify - // which calls authldap_free() -- g_private_replace(&ldap_conn_key, NULL) -+ g_private_replace(&ldap_conn_key, NULL); - return 0; - } - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0024-Fix-typo ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0011-Add-retries-for-binding-and-searching =================================================================== --- head/mail/dbmail/files/patch-0011-Add-retries-for-binding-and-searching (revision 538229) +++ head/mail/dbmail/files/patch-0011-Add-retries-for-binding-and-searching (nonexistent) @@ -1,95 +0,0 @@ -From cca81b0164c83a90eafa8d27d4887638cae080b5 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Tue, 4 Oct 2016 15:34:04 +0100 -Subject: [PATCH 11/33] Add retries for binding and searching - ---- - src/modules/authldap.c | 43 +++++++++++++++++++++++++++---------------- - 1 file changed, 27 insertions(+), 16 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 1b1b1bd..475c985 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -126,10 +126,11 @@ static LDAP * ldap_con_get(void) - return ld; - } - int c = 0; -+ int c_tries = 120; - int err = -1; // Start wanting success -- while (err != 0 && c++ < 120) { -+ while (err != 0 && c++ < c_tries) { - // Loop until success or too many retries -- TRACE(TRACE_DEBUG, "No connection trying [%d]", c); -+ TRACE(TRACE_DEBUG, "No connection trying [%d/%d]", c, c_tries); - - err = authldap_connect(); - -@@ -139,11 +140,13 @@ static LDAP * ldap_con_get(void) - TRACE(TRACE_DEBUG, "connection [%p]", ld); - break; - case LDAP_SERVER_DOWN: -- TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying to reconnect(%d/120).", ldap_err2string(err),c); -+ TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying to reconnect(%d/%d).", ldap_err2string(err), c, c_tries); - sleep(1); // reconnect failed. wait before trying again - break; - default: -+ // Includes timeouts etc. Should probably refactor. - TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); -+ sleep(1); - break; - } - } -@@ -261,7 +264,9 @@ static LDAPMessage * authldap_search(const gchar *query) - LDAPMessage *ldap_res; - int _ldap_attrsonly = 0; - char **_ldap_attrs = NULL; -- int err; -+ int err = -1; // Start wanting success -+ int c = 0; -+ int c_tries = 10; - LDAP *_ldap_conn; - - g_return_val_if_fail(query!=NULL, NULL); -@@ -269,20 +274,26 @@ static LDAPMessage * authldap_search(const gchar *query) - _ldap_conn = ldap_con_get(); - - TRACE(TRACE_DEBUG, " [%s]", query); -- err = ldap_search_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -- query, _ldap_attrs, _ldap_attrsonly, &ldap_res); - -- if (! err) -- return ldap_res; -+ while (err != 0 && c++ < c_tries) { -+ // Loop until success or too many retries -+ -+ err = ldap_search_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -+ query, _ldap_attrs, _ldap_attrsonly, &ldap_res); - -- switch (err) { -- case LDAP_SERVER_DOWN: -- TRACE(TRACE_WARNING, "LDAP gone away: %s).", ldap_err2string(err)); -- break; -- default: -- TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); -- return NULL; -- break; -+ switch (err) { -+ case LDAP_SUCCESS: -+ return ldap_res; -+ break; -+ case LDAP_SERVER_DOWN: -+ TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying again(%d/%d).", ldap_err2string(err), c, c_tries); -+ break; -+ default: -+ // Includes timeouts etc. Should probably refactor. -+ TRACE(TRACE_ERR, "LDAP error(%d): %s. Trying again (%d/%d).", err, ldap_err2string(err), c, c_tries); -+ break; -+ } -+ sleep(1); // Search failed. Wait before trying again. - } - - TRACE(TRACE_EMERG,"unrecoverable error while talking to ldap server"); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0011-Add-retries-for-binding-and-searching ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0021-Update-LDAP-to-non-deprecated-search =================================================================== --- head/mail/dbmail/files/patch-0021-Update-LDAP-to-non-deprecated-search (revision 538229) +++ head/mail/dbmail/files/patch-0021-Update-LDAP-to-non-deprecated-search (nonexistent) @@ -1,28 +0,0 @@ -From 00ff6ae1f64337ca6e723d060ad14873f1661447 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Wed, 19 Oct 2016 17:52:04 +0100 -Subject: [PATCH 21/33] Update LDAP to non deprecated search - ---- - src/modules/authldap.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index fc9db8e..11c1305 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -282,8 +282,9 @@ static LDAPMessage * authldap_search(const gchar *query) - while (err != 0 && c++ < c_tries) { - // Loop until success or too many retries - -- err = ldap_search_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -- query, _ldap_attrs, _ldap_attrsonly, &ldap_res); -+ // timeout must be NULL as any value times out! -+ err = ldap_search_ext_s(_ldap_conn, _ldap_cfg.base_dn, _ldap_cfg.scope_int, -+ query, _ldap_attrs, _ldap_attrsonly, NULL, NULL, NULL, LDAP_NO_LIMIT, &ldap_res); - - switch (err) { - case LDAP_SUCCESS: --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0021-Update-LDAP-to-non-deprecated-search ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0010-Give-sensible-default-for-retry-120s =================================================================== --- head/mail/dbmail/files/patch-0010-Give-sensible-default-for-retry-120s (revision 538229) +++ head/mail/dbmail/files/patch-0010-Give-sensible-default-for-retry-120s (nonexistent) @@ -1,36 +0,0 @@ -From fd3d09d5bbd3bd03e5eeaaec900f0e45b67ca064 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Sun, 2 Oct 2016 17:45:42 +0100 -Subject: [PATCH 10/33] Give sensible default for retry 120s - ---- - src/modules/authldap.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 2073768..1b1b1bd 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -127,7 +127,7 @@ static LDAP * ldap_con_get(void) - } - int c = 0; - int err = -1; // Start wanting success -- while (err != 0 && c++ < 5) { -+ while (err != 0 && c++ < 120) { - // Loop until success or too many retries - TRACE(TRACE_DEBUG, "No connection trying [%d]", c); - -@@ -139,8 +139,8 @@ static LDAP * ldap_con_get(void) - TRACE(TRACE_DEBUG, "connection [%p]", ld); - break; - case LDAP_SERVER_DOWN: -- TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying to reconnect(%d/5).", ldap_err2string(err),c); -- sleep(2); // reconnect failed. wait before trying again -+ TRACE(TRACE_WARNING, "LDAP gone away: %s. Trying to reconnect(%d/120).", ldap_err2string(err),c); -+ sleep(1); // reconnect failed. wait before trying again - break; - default: - TRACE(TRACE_ERR, "LDAP error(%d): %s", err, ldap_err2string(err)); --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0010-Give-sensible-default-for-retry-120s ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0005-improve-crypt-authentication =================================================================== --- head/mail/dbmail/files/patch-0005-improve-crypt-authentication (revision 538229) +++ head/mail/dbmail/files/patch-0005-improve-crypt-authentication (nonexistent) @@ -1,38 +0,0 @@ -From b4b82aca1dd1c8aece722b8370da02b715e4bb53 Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Wed, 10 Feb 2016 09:14:41 +0100 -Subject: [PATCH 05/33] improve crypt authentication - -also don't segfault when spasswd is empty ---- - src/dm_db.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git src/dm_db.c src/dm_db.c -index 313b33f..bfe9601 100644 ---- src/dm_db.c -+++ src/dm_db.c -@@ -3687,6 +3687,10 @@ int db_user_validate(ClientBase_T *ci, const char *pwfield, uint64_t *user_idnr, - return t; - - if (! t) return FALSE; -+ if (! strlen(dbpass)) { -+ TRACE(TRACE_INFO, "Empty password for [%" PRIu64 "] in [%s]", *user_idnr, pwfield); -+ return FALSE; -+ } - - if (SMATCH(encode, "")) { - TRACE(TRACE_DEBUG, "validating using plaintext passwords"); -@@ -3699,7 +3703,8 @@ int db_user_validate(ClientBase_T *ci, const char *pwfield, uint64_t *user_idnr, - - if (SMATCH(encode, "crypt")) { - TRACE(TRACE_DEBUG, "validating using crypt() encryption"); -- is_validated = (strcmp((const char *) crypt(password, dbpass), dbpass) == 0) ? 1 : 0; -+ strncpy(salt, dbpass, 2); -+ is_validated = (strcmp((const char *) crypt(password, salt), dbpass) == 0) ? 1 : 0; - } else if (SMATCH(encode, "md5")) { - /* get password */ - if (strncmp(dbpass, "$1$", 3)) { // no match --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0005-improve-crypt-authentication ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0028-tidy-mailbox2dbmail-man-page =================================================================== --- head/mail/dbmail/files/patch-0028-tidy-mailbox2dbmail-man-page (revision 538229) +++ head/mail/dbmail/files/patch-0028-tidy-mailbox2dbmail-man-page (nonexistent) @@ -1,57 +0,0 @@ -From 82b4d7ac22cccd411568e7ad471fc3aee93ef7a5 Mon Sep 17 00:00:00 2001 -From: Chris Mayo -Date: Sat, 23 Jul 2016 17:33:25 +0100 -Subject: [PATCH 28/33] tidy mailbox2dbmail man page - ---- - contrib/mailbox2dbmail/mailbox2dbmail.1 | 8 ++++---- - contrib/mailbox2dbmail/mailbox2dbmail.yo | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git contrib/mailbox2dbmail/mailbox2dbmail.1 contrib/mailbox2dbmail/mailbox2dbmail.1 -index 0d35702..402ff34 100644 ---- contrib/mailbox2dbmail/mailbox2dbmail.1 -+++ contrib/mailbox2dbmail/mailbox2dbmail.1 -@@ -9,15 +9,15 @@ Version info - .IP "\fB-h,--help\fP" - Help Display - .IP "\fB-b,--box\fP" --IMAP folder to stick mail in under user (Default: Inbox) -+IMAP folder to stick mail in under user (default: Inbox) - .IP "\fB-m,--mail\fP" --Location of Mailbox(required) -+Location of Mailbox (required) - .IP "\fB-u,--user\fP" --Username(required) -+Username (required) - .IP "\fB-t,--type\fP" - Type of Mailbox: mbox, maildir, mhdir (required) - .IP "\fB-p,--path\fP" --Path to dbmail-deliver(default: /usr/sbin/dbmail-deliver) -+Path to dbmail-deliver (default: /usr/sbin/dbmail-deliver) - .PP - .SH "SEE ALSO" - \fBpython(1)\fP, and \fBpydoc mailbox\fP -diff --git contrib/mailbox2dbmail/mailbox2dbmail.yo contrib/mailbox2dbmail/mailbox2dbmail.yo -index 46ad068..88c5fb1 100644 ---- contrib/mailbox2dbmail/mailbox2dbmail.yo -+++ contrib/mailbox2dbmail/mailbox2dbmail.yo -@@ -6,11 +6,11 @@ manpageoptions() - startdit() - dit(bf(-v,--version)) Version info - dit(bf(-h,--help)) Help Display --dit(bf(-b,--box)) IMAP folder to stick mail in under user (Default: Inbox) --dit(bf(-m,--mail)) Location of Mailbox(required) --dit(bf(-u,--user)) Username(required) -+dit(bf(-b,--box)) IMAP folder to stick mail in under user (default: Inbox) -+dit(bf(-m,--mail)) Location of Mailbox (required) -+dit(bf(-u,--user)) Username (required) - dit(bf(-t,--type)) Type of Mailbox: mbox, maildir, mhdir (required) --dit(bf(-p,--path)) Path to dbmail-deliver(default: /usr/sbin/dbmail-deliver) -+dit(bf(-p,--path)) Path to dbmail-deliver (default: /usr/sbin/dbmail-deliver) - enddit() - - manpageseealso() --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0028-tidy-mailbox2dbmail-man-page ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-src_dbmail.h.in =================================================================== --- head/mail/dbmail/files/patch-src_dbmail.h.in (revision 538229) +++ head/mail/dbmail/files/patch-src_dbmail.h.in (nonexistent) @@ -1,22 +0,0 @@ ---- src/dbmail.h.in.orig 2015-01-25 10:20:50 UTC -+++ src/dbmail.h.in -@@ -97,6 +97,7 @@ - #include - #endif - -+#include - #include - #include - #include -@@ -156,6 +157,11 @@ - #ifdef HAVE_ENDIAN_H - #include - #endif -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - - #define GETCONFIGVALUE(key, sect, var) \ - config_get_value(key, sect, var); \ Property changes on: head/mail/dbmail/files/patch-src_dbmail.h.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0006-simplify-log_query_time-duration-logic =================================================================== --- head/mail/dbmail/files/patch-0006-simplify-log_query_time-duration-logic (revision 538229) +++ head/mail/dbmail/files/patch-0006-simplify-log_query_time-duration-logic (nonexistent) @@ -1,119 +0,0 @@ -From f5b73b342b4a6cae1bb15340e5da7330e29319c1 Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Sat, 5 Mar 2016 18:43:12 +0100 -Subject: [PATCH 06/33] simplify log_query_time duration logic - ---- - src/dm_db.c | 16 ++++++++-------- - src/dm_misc.c | 12 ++++++++++++ - src/dm_misc.h | 2 ++ - test/check_dbmail_db.c | 27 +++++++++++++++++++++++++++ - 4 files changed, 49 insertions(+), 8 deletions(-) - -diff --git src/dm_db.c src/dm_db.c -index bfe9601..429d0ae 100644 ---- src/dm_db.c -+++ src/dm_db.c -@@ -354,14 +354,14 @@ void db_con_clear(Connection_T c) - - void log_query_time(char *query, struct timeval before, struct timeval after) - { -- double elapsed = ((double)after.tv_sec + ((double)after.tv_usec / 1000000)) - ((double)before.tv_sec + ((double)before.tv_usec / 1000000)); -- TRACE(TRACE_DATABASE, "last query took [%.3f] seconds", elapsed); -- if (elapsed > (double)db_params.query_time_warning) -- TRACE(TRACE_WARNING, "slow query [%s] took [%.3f] seconds", query, elapsed); -- else if (elapsed > (double)db_params.query_time_notice) -- TRACE(TRACE_NOTICE, "slow query [%s] took [%.3f] seconds", query, elapsed); -- else if (elapsed > (double)db_params.query_time_info) -- TRACE(TRACE_INFO, "slow query [%s] took [%.3f] seconds", query, elapsed); -+ unsigned int elapsed = (unsigned int)diff_time(before, after); -+ TRACE(TRACE_DATABASE, "last query took [%d] seconds", elapsed); -+ if (elapsed > db_params.query_time_warning) -+ TRACE(TRACE_WARNING, "slow query [%s] took [%d] seconds", query, elapsed); -+ else if (elapsed > db_params.query_time_notice) -+ TRACE(TRACE_NOTICE, "slow query [%s] took [%d] seconds", query, elapsed); -+ else if (elapsed > db_params.query_time_info) -+ TRACE(TRACE_INFO, "slow query [%s] took [%d] seconds", query, elapsed); - return; - } - -diff --git src/dm_misc.c src/dm_misc.c -index 1294930..e27ef34 100644 ---- src/dm_misc.c -+++ src/dm_misc.c -@@ -2422,4 +2422,16 @@ void uint64_free(void *data) - mempool_push(small_pool, data, sizeof(uint64_t)); - } - -+/* -+ * calculate the difference between two timeval values -+ * as number of seconds, using default rounding -+ */ -+int diff_time(struct timeval before, struct timeval after) -+{ -+ int tbefore = before.tv_sec * 1000000 + before.tv_usec; -+ int tafter = after.tv_sec * 1000000 + after.tv_usec; -+ int tdiff = tafter - tbefore; -+ return (int)rint((double)tdiff/1000000); -+} -+ - -diff --git src/dm_misc.h src/dm_misc.h -index a5dd04f..9660dfa 100644 ---- src/dm_misc.h -+++ src/dm_misc.h -@@ -178,4 +178,6 @@ gchar * get_crlf_encoded_opt(const gchar *string, int dots); - void strip_crlf(char *buffer); - void uint64_free(void *); - -+int diff_time(struct timeval before, struct timeval after); -+ - #endif -diff --git test/check_dbmail_db.c test/check_dbmail_db.c -index 47c34be..e6cb170 100644 ---- test/check_dbmail_db.c -+++ test/check_dbmail_db.c -@@ -414,6 +414,32 @@ START_TEST(test_db_get_sql) - } - END_TEST - -+START_TEST(test_diff_time) -+{ -+ struct timeval before, after; -+ int diff; -+ -+ before.tv_sec = 1; before.tv_usec = 0; -+ after.tv_sec = 2; after.tv_usec = 0; -+ diff = diff_time(before, after); -+ fail_unless(diff == 1); -+ -+ before.tv_sec = 1; before.tv_usec = 1000000 - 1; -+ after.tv_sec = 2; after.tv_usec = 0; -+ diff = diff_time(before, after); -+ fail_unless(diff == 0); -+ -+ before.tv_sec = 1; before.tv_usec = 500001; -+ after.tv_sec = 2; after.tv_usec = 0; -+ diff = diff_time(before, after); -+ fail_unless(diff == 0); -+ -+ before.tv_sec = 1; before.tv_usec = 499999; -+ after.tv_sec = 2; after.tv_usec = 0; -+ diff = diff_time(before, after); -+ fail_unless(diff == 1); -+} -+END_TEST - - Suite *dbmail_db_suite(void) - { -@@ -435,6 +461,7 @@ Suite *dbmail_db_suite(void) - tcase_add_test(tc_db, test_mailbox_match_new); - tcase_add_test(tc_db, test_db_findmailbox_by_regex); - tcase_add_test(tc_db, test_db_get_sql); -+ tcase_add_test(tc_db, test_diff_time); - - return s; - } --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0006-simplify-log_query_time-duration-logic ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase =================================================================== --- head/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase (revision 538229) +++ head/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase (nonexistent) @@ -1,41 +0,0 @@ -From b6f28ffa54e6533fd0d8676248d0c9bc6d4bd859 Mon Sep 17 00:00:00 2001 -From: Paul J Stevens -Date: Sun, 10 Jan 2016 20:01:31 +0100 -Subject: [PATCH 04/33] prevent assertion in p_string_erase - ---- - src/dm_imapsession.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git src/dm_imapsession.c src/dm_imapsession.c -index dbf1834..67eae60 100644 ---- src/dm_imapsession.c -+++ src/dm_imapsession.c -@@ -870,19 +870,20 @@ static void _imap_send_part(ImapSession *self, GMimeObject *part, body_fetch *bo - } else { - char *tmp = imap_get_logical_part(part,type); - String_T str = p_string_new(self->pool, tmp); -+ size_t len = p_string_len(str); - g_free(tmp); - -- if (p_string_len(str) < 1) { -+ if (len < 1) { - dbmail_imap_session_buff_printf(self, "] NIL"); - } else { - uint64_t cnt = 0; - if (bodyfetch->octetcnt > 0) { -- cnt = get_dumpsize(bodyfetch, p_string_len(str)); -+ cnt = get_dumpsize(bodyfetch, len); - dbmail_imap_session_buff_printf(self, "]<%" PRIu64 "> {%" PRIu64 "}\r\n", bodyfetch->octetstart, cnt); -- p_string_erase(str,0,bodyfetch->octetstart); -+ p_string_erase(str,0,min(bodyfetch->octetstart,len)); - p_string_truncate(str,cnt); - } else { -- dbmail_imap_session_buff_printf(self, "] {%" PRIu64 "}\r\n", p_string_len(str)); -+ dbmail_imap_session_buff_printf(self, "] {%" PRIu64 "}\r\n", len); - } - dbmail_imap_session_buff_printf(self,"%s", p_string_str(str)); - } --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Index: head/mail/dbmail/files/patch-0022-Clear-the-ldap-connection =================================================================== --- head/mail/dbmail/files/patch-0022-Clear-the-ldap-connection (revision 538229) +++ head/mail/dbmail/files/patch-0022-Clear-the-ldap-connection (nonexistent) @@ -1,41 +0,0 @@ -From 24869db9c10be2eb90ba2ca9095d92c5645b6320 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Mon, 24 Oct 2016 15:12:09 +0100 -Subject: [PATCH 22/33] Clear the ldap connection - ---- - src/modules/authldap.c | 4 ++++ - src/server.c | 2 ++ - 2 files changed, 6 insertions(+) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 11c1305..7fa3a73 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -638,6 +638,10 @@ int auth_connect(void) - } - int auth_disconnect(void) - { -+ // Just free the pointer, -+ // G_PRIVATE_INIT calls GDestroyNotify -+ // which calls authldap_free() -+ g_private_replace(&ldap_conn_key, NULL) - return 0; - } - -diff --git src/server.c src/server.c -index 72fab52..ba3ce10 100644 ---- src/server.c -+++ src/server.c -@@ -282,6 +282,8 @@ static int server_start_cli(ServerConfig_T *conf) - TRACE(TRACE_ERR, "could not connect to authentication"); - return -1; - } -+ // Disconnect this connection as threads will create their own -+ auth_disconnect(); - - srand((int) ((int) time(NULL) + (int) getpid())); - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0022-Clear-the-ldap-connection ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0018-Add-definition-for-authldap_free =================================================================== --- head/mail/dbmail/files/patch-0018-Add-definition-for-authldap_free (revision 538229) +++ head/mail/dbmail/files/patch-0018-Add-definition-for-authldap_free (nonexistent) @@ -1,63 +0,0 @@ -From cf3b24b2ea79c262c7827a954da9105a21b2c7d7 Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Fri, 14 Oct 2016 13:59:56 +0100 -Subject: [PATCH 18/33] Add definition for authldap_free - ---- - src/modules/authldap.c | 33 +++++++++++++++++---------------- - 1 file changed, 17 insertions(+), 16 deletions(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 2bf3b95..065ee31 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -28,22 +28,7 @@ - - extern char configFile[PATH_MAX]; - --/* -- signal-safe releasing of thread-local ldap connection --*/ --static void authldap_free(gpointer data) --{ -- LDAP *c = (LDAP *)data; -- struct sigaction act, oldact; -- -- memset(&act, 0, sizeof(act)); -- memset(&oldact, 0, sizeof(oldact)); -- act.sa_handler = SIG_IGN; -- sigaction(SIGPIPE, &act, &oldact); -- ldap_unbind(c); -- sigaction(SIGPIPE, &oldact, 0); --} -- -+static void authldap_free(gpointer data); - static GPrivate ldap_conn_key = G_PRIVATE_INIT (authldap_free); - static GOnce ldap_conn_once = G_ONCE_INIT; - static int authldap_connect(void); -@@ -177,6 +162,22 @@ static LDAP * ldap_con_get(void) - } - - /* -+ signal-safe releasing of thread-local ldap connection -+*/ -+static void authldap_free(gpointer data) -+{ -+ LDAP *c = (LDAP *)data; -+ struct sigaction act, oldact; -+ -+ memset(&act, 0, sizeof(act)); -+ memset(&oldact, 0, sizeof(oldact)); -+ act.sa_handler = SIG_IGN; -+ sigaction(SIGPIPE, &act, &oldact); -+ ldap_unbind(c); -+ sigaction(SIGPIPE, &oldact, 0); -+} -+ -+/* - * auth_ldap_bind() - * - * Bind to server using config credentials --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0018-Add-definition-for-authldap_free ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-0020-Reduce-failed-LDAP-connection-for-search-to-error =================================================================== --- head/mail/dbmail/files/patch-0020-Reduce-failed-LDAP-connection-for-search-to-error (revision 538229) +++ head/mail/dbmail/files/patch-0020-Reduce-failed-LDAP-connection-for-search-to-error (nonexistent) @@ -1,25 +0,0 @@ -From 7daaac91d559f15a476c39f52228cc643f4608ba Mon Sep 17 00:00:00 2001 -From: Alan Hicks -Date: Tue, 18 Oct 2016 13:38:04 +0100 -Subject: [PATCH 20/33] Reduce failed LDAP connection for search to error - ---- - src/modules/authldap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git src/modules/authldap.c src/modules/authldap.c -index 065ee31..fc9db8e 100644 ---- src/modules/authldap.c -+++ src/modules/authldap.c -@@ -299,7 +299,7 @@ static LDAPMessage * authldap_search(const gchar *query) - sleep(1); // Search failed. Wait before trying again. - } - -- TRACE(TRACE_EMERG,"unrecoverable error while talking to ldap server"); -+ TRACE(TRACE_ERR,"unrecoverable error while talking to ldap server"); - return NULL; - } - --- -2.10.1 (Apple Git-78) - Property changes on: head/mail/dbmail/files/patch-0020-Reduce-failed-LDAP-connection-for-search-to-error ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/dbmail/files/patch-acinclude.m4 =================================================================== --- head/mail/dbmail/files/patch-acinclude.m4 (revision 538229) +++ head/mail/dbmail/files/patch-acinclude.m4 (revision 538230) @@ -1,69 +1,60 @@ --- acinclude.m4.orig 2015-01-25 10:20:50 UTC +++ acinclude.m4 @@ -221,7 +221,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo 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 - AC_CHECK_HEADERS([ldap.h],[LDAPLIB="-lldap"], [LDAPLIB="failed"]) + AC_CHECK_HEADERS([ldap.h],[LDAPLIB="-lldap_r"], [LDAPLIB="failed"]) if test [ "x$LDAPLIB" != "xfailed" ]; then break fi @@ -233,7 +233,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo SAVE_CFLAGS=$CFLAGS dnl The headers might be in a funny place, so we need to use -Ipath CFLAGS="$CFLAGS -L$TEST_PATH $LDAPINC" - AC_CHECK_HEADERS([ldap.h],[LDAPLIB="-L$TEST_PATH -lldap"], [LDAPLIB="failed"]) + AC_CHECK_HEADERS([ldap.h],[LDAPLIB="-L$TEST_PATH -lldap_r"], [LDAPLIB="failed"]) CFLAGS=$SAVE_CFLAGS if test [ "x$LDAPLIB" != "xfailed" ]; then break 2 @@ -247,7 +247,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo AC_MSG_ERROR([Could not find LDAP library.]) else AC_DEFINE([AUTHLDAP], 1, [Define if LDAP will be used.]) - AC_SEARCH_LIBS(ldap_initialize, ldap, AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [ldap_initialize() can be used instead of ldap_init()])) + AC_SEARCH_LIBS(ldap_initialize, ldap_r, AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [ldap_initialize() can be used instead of ldap_init()])) AC_SUBST(LDAPLIB) AC_SUBST(LDAPINC) AUTHALIB="modules/.libs/libauth_ldap.a" -@@ -291,6 +291,8 @@ AC_DEFUN([DM_CHECK_ZDB], [dnl - [ZDBLIB="-lzdb"], - [ZDBLIB="failed"], - [[ -+#include -+#include - #include - #include - #include @@ -339,7 +341,7 @@ AC_DEFUN([DM_CHECK_EVENT], [ AC_DEFUN([DM_CHECK_SSL], [ AC_CHECK_HEADERS([openssl/ssl.h], - [SSLLIB=`pkg-config --libs openssl 2>/dev/null`],[SSLLIB="failed"]) + [SSLLIB="-lcrypto -lssl"],[SSLLIB="failed"]) if test [ "x$SSLLIB" = "xfailed" ]; then AC_MSG_ERROR([Could not find OPENSSL library.]) else @@ -539,15 +541,15 @@ AC_DEFUN([CMU_SOCKETS], [ save_LIBS="$LIBS" SOCKETLIB="" AC_CHECK_FUNC(connect, :, - AC_CHECK_LIB(nsl, gethostbyname, - SOCKETLIB="-lnsl $SOCKETLIB") - AC_CHECK_LIB(socket, connect, - SOCKETLIB="-lsocket $SOCKETLIB") + AC_CHECK_LIB(c, gethostbyname, + SOCKETLIB="-lc $SOCKETLIB") + AC_CHECK_LIB(c, connect, + SOCKETLIB="-lc $SOCKETLIB") ) LIBS="$SOCKETLIB $save_LIBS" AC_CHECK_FUNC(res_search, :, - AC_CHECK_LIB(resolv, res_search, - SOCKETLIB="-lresolv $SOCKETLIB") + AC_CHECK_LIB(c, res_search, + SOCKETLIB="-lc $SOCKETLIB") ) LIBS="$SOCKETLIB $save_LIBS" AC_CHECK_FUNCS(dn_expand dns_lookup) Index: head/mail/dbmail/pkg-plist =================================================================== --- head/mail/dbmail/pkg-plist (revision 538229) +++ head/mail/dbmail/pkg-plist (revision 538230) @@ -1,101 +1,102 @@ @sample etc/dbmail.conf.sample %%LDAP%%lib/dbmail/libauth_ldap.so %%LDAP%%lib/dbmail/libauth_ldap.so.0 %%LDAP%%lib/dbmail/libauth_ldap.so.0.0.0 lib/dbmail/libauth_sql.so lib/dbmail/libauth_sql.so.0 lib/dbmail/libauth_sql.so.0.0.0 lib/dbmail/libdbmail.so lib/dbmail/libdbmail.so.0 lib/dbmail/libdbmail.so.0.0.0 %%SIEVE%%lib/dbmail/libsort_sieve.so %%SIEVE%%lib/dbmail/libsort_sieve.so.0 %%SIEVE%%lib/dbmail/libsort_sieve.so.0.0.0 man/man1/dbmail-deliver.1.gz man/man1/dbmail.1.gz man/man5/dbmail.conf.5.gz man/man8/dbmail-export.8.gz man/man8/dbmail-httpd.8.gz man/man8/dbmail-imapd.8.gz man/man8/dbmail-lmtpd.8.gz man/man8/dbmail-pop3d.8.gz man/man8/dbmail-sievecmd.8.gz man/man8/dbmail-timsieved.8.gz man/man8/dbmail-users.8.gz man/man8/dbmail-util.8.gz sbin/dbmail-deliver sbin/dbmail-export sbin/dbmail-httpd sbin/dbmail-imapd sbin/dbmail-lmtpd sbin/dbmail-pop3d sbin/dbmail-users sbin/dbmail-util %%SIEVE%%sbin/dbmail-sievecmd %%SIEVE%%sbin/dbmail-timsieved %%DATADIR%%/dbmail.schema %%DATADIR%%/mysql/2_1_7-2_2_0.mysql %%DATADIR%%/mysql/2_2-3_0.mysql %%DATADIR%%/mysql/2_2_5-2_3_0.mysql %%DATADIR%%/mysql/2_3_0-2_3_2.mysql %%DATADIR%%/mysql/2_3_4-2_3_5.mysql %%DATADIR%%/mysql/2_3_5-2_3_6.mysql %%DATADIR%%/mysql/2_3_6-3_0_0.mysql %%DATADIR%%/mysql/3_0_2-3_1_0.mysql %%DATADIR%%/mysql/create_tables.mysql %%DATADIR%%/mysql/fix_foreign_keys.mysql %%DATADIR%%/mysql/migrate_from_1.x_to_2.0_innodb.mysql %%DATADIR%%/mysql/migrate_from_2.0_to_2.2.mysql %%DATADIR%%/mysql/update_headervalue_01.mysql %%DATADIR%%/mysql/upgrades/32001.mysql %%DATADIR%%/mysql/upgrades/32002.mysql %%DATADIR%%/mysql/upgrades/32003.mysql %%DATADIR%%/mysql/upgrades/32004.mysql %%DATADIR%%/oracle/dbmail_grant.sql %%DATADIR%%/oracle/dbmail_schema.sql %%DATADIR%%/oracle/dbmail_ts.sql %%DATADIR%%/postgresql/2_1_7-2_2_0.pgsql %%DATADIR%%/postgresql/2_2-3_0.pgsql %%DATADIR%%/postgresql/2_2_5-2_3_0.pgsql %%DATADIR%%/postgresql/2_3_4-2_3_5.pgsql %%DATADIR%%/postgresql/2_3_5-2_3_6.pgsql %%DATADIR%%/postgresql/2_3_6-3_0_0.pgsql %%DATADIR%%/postgresql/3_0_2-3_1_0.psql %%DATADIR%%/postgresql/create_tables.pgsql %%DATADIR%%/postgresql/migrate_from_1.x_to_2.0.pgsql %%DATADIR%%/postgresql/migrate_from_2.0_to_2.2.pgsql %%DATADIR%%/postgresql/upgrades/32001.psql %%DATADIR%%/postgresql/upgrades/32002.psql %%DATADIR%%/postgresql/upgrades/32003.psql %%DATADIR%%/postgresql/upgrades/32004.psql %%DATADIR%%/sqlite/2_1_7-2_2_0.sqlite %%DATADIR%%/sqlite/2_2-3_0.sqlite %%DATADIR%%/sqlite/2_2_5-2_3_0.sqlite %%DATADIR%%/sqlite/2_3_4-2_3_5.sqlite %%DATADIR%%/sqlite/2_3_5-2_3_6.sqlite %%DATADIR%%/sqlite/2_3_6-3_0_0.sqlite %%DATADIR%%/sqlite/3_0_2-3_1_0.sqlite %%DATADIR%%/sqlite/create_tables.sqlite %%DATADIR%%/sqlite/trigger.tmpl.sql %%DATADIR%%/sqlite/upgrades/32001.sqlite %%DATADIR%%/sqlite/upgrades/32002.sqlite %%DATADIR%%/sqlite/upgrades/32003.sqlite %%DATADIR%%/sqlite/upgrades/32004.sqlite %%PORTDOCS%%%%DOCSDIR%%/AUTHORS -%%PORTDOCS%%%%DOCSDIR%%/BUGS +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md %%PORTDOCS%%%%DOCSDIR%%/INSTALL +%%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/README.aliases %%PORTDOCS%%%%DOCSDIR%%/README.exim %%PORTDOCS%%%%DOCSDIR%%/README.filters %%PORTDOCS%%%%DOCSDIR%%/README.http %%PORTDOCS%%%%DOCSDIR%%/README.ldap %%PORTDOCS%%%%DOCSDIR%%/README.postfix %%PORTDOCS%%%%DOCSDIR%%/README.qmail %%PORTDOCS%%%%DOCSDIR%%/README.sieve %%PORTDOCS%%%%DOCSDIR%%/README.smtp %%PORTDOCS%%%%DOCSDIR%%/README.security-password %%PORTDOCS%%%%DOCSDIR%%/README.solaris %%PORTDOCS%%%%DOCSDIR%%/README.usermap %%PORTDOCS%%%%DOCSDIR%%/THANKS %%PORTDOCS%%%%DOCSDIR%%/UPGRADING @dir(%%DBMAIL_USER%%,%%DBMAIL_GROUP%%,) %%PIDDIR%%