From 0a6c178c6c5f45668b5bb37b8be723cc9d1e72ae Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Wed, 5 Jul 2017 12:57:24 +0100 Subject: [PATCH 1/1] Use the BDB "environment" so that a database config file is not looked for. Bug 2141 --- doc/doc-txt/ChangeLog | 5 + src/OS/Makefile-Base | 3 +- src/src/acl.c | 3 +- src/src/dbfn.c | 19 ++-- src/src/dbstuff.h | 189 ++++++++++++++++++++++++++------- src/src/exim_dbmbuild.c | 1 + src/src/exim_dbutil.c | 37 ++++--- src/src/transports/autoreply.c | 127 ++++++++++------------ test/runtest | 4 + test/stderr/0275 | 10 +- test/stderr/0278 | 10 +- test/stderr/0361 | 20 ++-- test/stderr/0386 | 20 ++-- test/stderr/0388 | 25 +++-- test/stderr/0398 | 15 +-- test/stderr/0402 | 35 +++--- test/stderr/0403 | 15 +-- test/stderr/0404 | 25 +++-- test/stderr/0408 | 10 +- test/stderr/0432 | 15 +-- test/stderr/0487 | 10 +- test/stderr/2600 | 10 +- test/stderr/5004 | 15 +-- test/stderr/5005 | 50 +++++---- test/stderr/5006 | 10 +- 25 files changed, 422 insertions(+), 261 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index da6f19820..de8151f65 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -123,6 +123,11 @@ JH/18 Prebuild the data-structure for "builtin" macros, for faster startup. was met in the configuration file input during startup; now it is done during compilation. +JH/19 Bug 2141: Use the full-complex API for Berkeley DB rather than the legacy- + compatible one, to avoid the (poorly documented) possibility of a config + file in the working directory redirecting the DB files, possibly correpting + some existing file. + Exim version 4.89 ----------------- diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base index bddd313ee..7746597ba 100644 --- a/src/OS/Makefile-Base +++ b/src/OS/Makefile-Base @@ -580,7 +580,8 @@ exim_tidydb.o: $(HDRS) exim_dbutil.c exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c @echo "$(CC) exim_dbmbuild.c" - $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c + $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \ + -o exim_dbmbuild.o exim_dbmbuild.c # Utilities use special versions of some modules - typically with debugging # calls cut out. diff --git a/src/src/acl.c b/src/src/acl.c index efebf9c69..cf7e42aa4 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -2352,8 +2352,7 @@ if (t != NULL) /* We aren't using a pre-computed rate, so get a previously recorded rate from the database, which will be updated and written back if required. */ -dbm = dbfn_open(US"ratelimit", O_RDWR, &dbblock, TRUE); -if (dbm == NULL) +if (!(dbm = dbfn_open(US"ratelimit", O_RDWR, &dbblock, TRUE))) { store_pool = old_pool; sender_rate = NULL; diff --git a/src/src/dbfn.c b/src/src/dbfn.c index 62259eb0d..5529fe93f 100644 --- a/src/src/dbfn.c +++ b/src/src/dbfn.c @@ -161,9 +161,7 @@ it easy to pin this down, there are now debug statements on either side of the open call. */ snprintf(CS filename, sizeof(filename), "%s/%s", dirname, name); -DEBUG(D_hints_lookup) debug_printf("EXIM_DBOPEN(%s)\n", filename); EXIM_DBOPEN(filename, dirname, flags, EXIMDB_MODE, &(dbblock->dbptr)); -DEBUG(D_hints_lookup) debug_printf("returned from EXIM_DBOPEN\n"); if (!dbblock->dbptr && errno == ENOENT && flags == O_RDWR) { @@ -171,7 +169,6 @@ if (!dbblock->dbptr && errno == ENOENT && flags == O_RDWR) debug_printf("%s appears not to exist: trying to create\n", filename); created = TRUE; EXIM_DBOPEN(filename, dirname, flags|O_CREAT, EXIMDB_MODE, &(dbblock->dbptr)); - DEBUG(D_hints_lookup) debug_printf("returned from EXIM_DBOPEN\n"); } save_errno = errno; @@ -217,17 +214,17 @@ if (created && geteuid() == root_uid) } /* If the open has failed, return NULL, leaving errno set. If lof is TRUE, -log the event - also for debugging - but not if the file just doesn't exist. */ +log the event - also for debugging - but debug only if the file just doesn't +exist. */ if (!dbblock->dbptr) { - if (save_errno != ENOENT) - if (lof) - log_write(0, LOG_MAIN, "%s", string_open_failed(save_errno, "DB file %s", + if (lof && save_errno != ENOENT) + log_write(0, LOG_MAIN, "%s", string_open_failed(save_errno, "DB file %s", filename)); - else - DEBUG(D_hints_lookup) - debug_printf("%s", CS string_open_failed(save_errno, "DB file %s\n", + else + DEBUG(D_hints_lookup) + debug_printf("%s\n", CS string_open_failed(save_errno, "DB file %s", filename)); (void)close(dbblock->lockfd); errno = save_errno; @@ -532,7 +529,7 @@ while (Ufgets(buffer, 256, stdin) != NULL) odb = dbfn_open(s, O_RDWR, dbblock + i, TRUE); stop = clock(); - if (odb != NULL) + if (odb) { current = i; printf("opened %d\n", current); diff --git a/src/src/dbstuff.h b/src/src/dbstuff.h index ace46c24c..a4ee603bb 100644 --- a/src/src/dbstuff.h +++ b/src/src/dbstuff.h @@ -39,7 +39,7 @@ tdb_traverse to be called) */ /* Access functions */ /* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed */ -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ *(dbpp) = tdb_open(CS name, 0, TDB_DEFAULT, flags, mode) /* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */ @@ -77,7 +77,7 @@ free() must not die when passed NULL */ #define EXIM_DBDELETE_CURSOR(cursor) free(cursor) /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) tdb_close(db) +#define EXIM_DBCLOSE__(db) tdb_close(db) /* Datum access types - these are intended to be assignable */ @@ -113,8 +113,8 @@ definition of DB_VERSION_STRING, which is present in versions 2.x onwards. */ /***************** Berkeley db 3.x/4.x native definitions ******************/ /* Basic DB type */ -#define EXIM_DB DB - +#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) +# define EXIM_DB DB_ENV /* Cursor type, for scanning */ #define EXIM_CURSOR DBC @@ -122,78 +122,161 @@ definition of DB_VERSION_STRING, which is present in versions 2.x onwards. */ #define EXIM_DATUM DBT /* Some text for messages */ -#define EXIM_DBTYPE "db (v3/4)" +#define EXIM_DBTYPE "db (v4.1+)" /* Access functions */ /* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed. The -API changed for DB 4.1. */ +API changed for DB 4.1. - and we also starting using the "env" with a +specified working dir, to avoid the DBCONFIG file trap. */ + +# define ENV_TO_DB(env) ((DB *)((env)->app_private)) + +# define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ + if ( db_env_create(dbpp, 0) != 0 \ + || ((*dbpp)->set_errcall(*dbpp, dbfn_bdb_error_callback), 0) \ + || (*dbpp)->open(*dbpp, CS dirname, DB_CREATE|DB_INIT_MPOOL|DB_PRIVATE, 0) != 0\ + ) \ + *dbpp = NULL; \ + else if (db_create((DB **) &((*dbpp)->app_private), *dbpp, 0) != 0) \ + { \ + ((DB_ENV *)(*dbpp))->close((DB_ENV *)(*dbpp), 0); \ + *dbpp = NULL; \ + } \ + else if (ENV_TO_DB(*dbpp)->open(ENV_TO_DB(*dbpp), NULL, CS name, NULL, \ + (flags) == O_RDONLY ? DB_UNKNOWN : DB_HASH, \ + (flags) == O_RDONLY ? DB_RDONLY : DB_CREATE, \ + mode) != 0 \ + ) \ + { \ + ENV_TO_DB(*dbpp)->close(ENV_TO_DB(*dbpp), 0); \ + ((DB_ENV *)(*dbpp))->close((DB_ENV *)(*dbpp), 0); \ + *dbpp = NULL; \ + } -#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ - if (db_create(dbpp, NULL, 0) != 0 || \ - ((*dbpp)->set_errcall(*dbpp, dbfn_bdb_error_callback), \ - ((*dbpp)->open)(*dbpp, NULL, CS name, NULL, \ - ((flags) == O_RDONLY)? DB_UNKNOWN : DB_HASH, \ - ((flags) == O_RDONLY)? DB_RDONLY : DB_CREATE, \ - mode)) != 0) *(dbpp) = NULL -#else -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +/* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */ +# define EXIM_DBGET(db, key, data) \ + (ENV_TO_DB(db)->get(ENV_TO_DB(db), NULL, &key, &data, 0) == 0) + +/* EXIM_DBPUT - returns nothing useful, assumes replace mode */ +# define EXIM_DBPUT(db, key, data) \ + ENV_TO_DB(db)->put(ENV_TO_DB(db), NULL, &key, &data, 0) + +/* EXIM_DBPUTB - non-overwriting for use by dbmbuild */ +# define EXIM_DBPUTB(db, key, data) \ + ENV_TO_DB(db)->put(ENV_TO_DB(db), NULL, &key, &data, DB_NOOVERWRITE) + +/* Return values from EXIM_DBPUTB */ + +# define EXIM_DBPUTB_OK 0 +# define EXIM_DBPUTB_DUP DB_KEYEXIST + +/* EXIM_DBDEL */ +# define EXIM_DBDEL(db, key) ENV_TO_DB(db)->del(ENV_TO_DB(db), NULL, &key, 0) + +/* EXIM_DBCREATE_CURSOR - initialize for scanning operation */ + +# define EXIM_DBCREATE_CURSOR(db, cursor) \ + ENV_TO_DB(db)->cursor(ENV_TO_DB(db), NULL, cursor, 0) + +/* EXIM_DBSCAN - returns TRUE if data is returned, FALSE at end */ +# define EXIM_DBSCAN(db, key, data, first, cursor) \ + ((cursor)->c_get(cursor, &key, &data, \ + (first? DB_FIRST : DB_NEXT)) == 0) + +/* EXIM_DBDELETE_CURSOR - terminate scanning operation */ +# define EXIM_DBDELETE_CURSOR(cursor) \ + (cursor)->c_close(cursor) + +/* EXIM_DBCLOSE */ +# define EXIM_DBCLOSE__(db) \ + (ENV_TO_DB(db)->close(ENV_TO_DB(db), 0) , ((DB_ENV *)(db))->close((DB_ENV *)(db), DB_FORCESYNC)) + +/* Datum access types - these are intended to be assignable. */ + +# define EXIM_DATUM_SIZE(datum) (datum).size +# define EXIM_DATUM_DATA(datum) (datum).data + +/* The whole datum structure contains other fields that must be cleared +before use, but we don't have to free anything after reading data. */ + +# define EXIM_DATUM_INIT(datum) memset(&datum, 0, sizeof(datum)) +# define EXIM_DATUM_FREE(datum) + +#else /* pre- 4.1 */ + +# define EXIM_DB DB + +/* Cursor type, for scanning */ +# define EXIM_CURSOR DBC + +/* The datum type used for queries */ +# define EXIM_DATUM DBT + +/* Some text for messages */ +# define EXIM_DBTYPE "db (v3/4)" + +/* Access functions */ + +/* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed. */ + +# define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ if (db_create(dbpp, NULL, 0) != 0 || \ ((*dbpp)->set_errcall(*dbpp, dbfn_bdb_error_callback), \ ((*dbpp)->open)(*dbpp, CS name, NULL, \ ((flags) == O_RDONLY)? DB_UNKNOWN : DB_HASH, \ ((flags) == O_RDONLY)? DB_RDONLY : DB_CREATE, \ mode)) != 0) *(dbpp) = NULL -#endif /* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */ -#define EXIM_DBGET(db, key, data) \ +# define EXIM_DBGET(db, key, data) \ ((db)->get(db, NULL, &key, &data, 0) == 0) /* EXIM_DBPUT - returns nothing useful, assumes replace mode */ -#define EXIM_DBPUT(db, key, data) \ +# define EXIM_DBPUT(db, key, data) \ (db)->put(db, NULL, &key, &data, 0) /* EXIM_DBPUTB - non-overwriting for use by dbmbuild */ -#define EXIM_DBPUTB(db, key, data) \ +# define EXIM_DBPUTB(db, key, data) \ (db)->put(db, NULL, &key, &data, DB_NOOVERWRITE) /* Return values from EXIM_DBPUTB */ -#define EXIM_DBPUTB_OK 0 -#define EXIM_DBPUTB_DUP DB_KEYEXIST +# define EXIM_DBPUTB_OK 0 +# define EXIM_DBPUTB_DUP DB_KEYEXIST /* EXIM_DBDEL */ -#define EXIM_DBDEL(db, key) (db)->del(db, NULL, &key, 0) +# define EXIM_DBDEL(db, key) (db)->del(db, NULL, &key, 0) /* EXIM_DBCREATE_CURSOR - initialize for scanning operation */ -#define EXIM_DBCREATE_CURSOR(db, cursor) \ +# define EXIM_DBCREATE_CURSOR(db, cursor) \ (db)->cursor(db, NULL, cursor, 0) /* EXIM_DBSCAN - returns TRUE if data is returned, FALSE at end */ -#define EXIM_DBSCAN(db, key, data, first, cursor) \ +# define EXIM_DBSCAN(db, key, data, first, cursor) \ ((cursor)->c_get(cursor, &key, &data, \ (first? DB_FIRST : DB_NEXT)) == 0) /* EXIM_DBDELETE_CURSOR - terminate scanning operation */ -#define EXIM_DBDELETE_CURSOR(cursor) \ +# define EXIM_DBDELETE_CURSOR(cursor) \ (cursor)->c_close(cursor) /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) (db)->close(db, 0) +# define EXIM_DBCLOSE__(db) (db)->close(db, 0) /* Datum access types - these are intended to be assignable. */ -#define EXIM_DATUM_SIZE(datum) (datum).size -#define EXIM_DATUM_DATA(datum) (datum).data +# define EXIM_DATUM_SIZE(datum) (datum).size +# define EXIM_DATUM_DATA(datum) (datum).data /* The whole datum structure contains other fields that must be cleared before use, but we don't have to free anything after reading data. */ -#define EXIM_DATUM_INIT(datum) memset(&datum, 0, sizeof(datum)) -#define EXIM_DATUM_FREE(datum) +# define EXIM_DATUM_INIT(datum) memset(&datum, 0, sizeof(datum)) +# define EXIM_DATUM_FREE(datum) + +#endif #else /* DB_VERSION_MAJOR >= 3 */ @@ -215,7 +298,7 @@ before use, but we don't have to free anything after reading data. */ /* Access functions */ /* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed */ -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ if ((errno = db_open(CS name, DB_HASH, \ ((flags) == O_RDONLY)? DB_RDONLY : DB_CREATE, \ mode, NULL, NULL, dbpp)) != 0) *(dbpp) = NULL @@ -264,7 +347,7 @@ the new option that is available, so I guess that it happened at 2.5.x. */ (cursor)->c_close(cursor) /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) (db)->close(db, 0) +#define EXIM_DBCLOSE__(db) (db)->close(db, 0) /* Datum access types - these are intended to be assignable. */ @@ -312,7 +395,7 @@ before been able to pass successfully. */ /* Access functions */ /* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed */ -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ *(dbpp) = dbopen(CS name, flags, mode, DB_HASH, NULL) /* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */ @@ -347,7 +430,7 @@ refer to cursor, to keep picky compilers happy. */ #define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) (db)->close(db) +#define EXIM_DBCLOSE__(db) (db)->close(db) /* Datum access types - these are intended to be assignable */ @@ -389,7 +472,7 @@ typedef struct { /* Access functions */ /* EXIM_DBOPEN - returns a EXIM_DB *, NULL if failed */ -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ { (*(dbpp)) = (EXIM_DB *) malloc(sizeof(EXIM_DB));\ if (*(dbpp) != NULL) { \ (*(dbpp))->lkey.dptr = NULL;\ @@ -435,7 +518,7 @@ refer to cursor, to keep picky compilers happy. */ #define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) \ +#define EXIM_DBCLOSE__(db) \ { gdbm_close((db)->gdbm);\ if ((db)->lkey.dptr != NULL) free((db)->lkey.dptr);\ free(db); } @@ -478,7 +561,7 @@ interface */ /* Access functions */ /* EXIM_DBOPEN - returns a EXIM_DB *, NULL if failed */ -#define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ +#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \ *(dbpp) = dbm_open(CS name, flags, mode) /* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */ @@ -513,7 +596,7 @@ refer to cursor, to keep picky compilers happy. */ #define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } /* EXIM_DBCLOSE */ -#define EXIM_DBCLOSE(db) dbm_close(db) +#define EXIM_DBCLOSE__(db) dbm_close(db) /* Datum access types - these are intended to be assignable */ @@ -528,6 +611,34 @@ after reading data. */ #endif /* USE_GDBM */ + + + + +# ifdef COMPILE_UTILITY + +# define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ + EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) +# define EXIM_DBCLOSE(db) EXIM_DBCLOSE__(db) + +# else + +# define EXIM_DBOPEN(name, dirname, flags, mode, dbpp) \ + do { \ + DEBUG(D_hints_lookup) \ + debug_printf("EXIM_DBOPEN: file <%s> dir <%s> flags 0x%x\n", \ + (name), (dirname), flags); \ + EXIM_DBOPEN__(name, dirname, flags, mode, dbpp); \ + DEBUG(D_hints_lookup) debug_printf("returned from EXIM_DBOPEN: %p\n", *dbpp); \ + } while(0) +# define EXIM_DBCLOSE(db) \ + do { \ + DEBUG(D_hints_lookup) debug_printf("EXIM_DBCLOSE(%p)\n", db); \ + EXIM_DBCLOSE__(db); \ + } while(0) + +# endif + /********************* End of dbm library definitions **********************/ diff --git a/src/src/exim_dbmbuild.c b/src/src/exim_dbmbuild.c index eb19005a2..7431bbc03 100644 --- a/src/src/exim_dbmbuild.c +++ b/src/src/exim_dbmbuild.c @@ -30,6 +30,7 @@ characters. */ #include "exim.h" +uschar * spool_directory = NULL; /* dummy for dbstuff.h */ #define max_insize 20000 #define max_outsize 100000 diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c index eb3ae16b3..fb455bbd3 100644 --- a/src/src/exim_dbutil.c +++ b/src/src/exim_dbutil.c @@ -517,15 +517,16 @@ uschar keybuffer[1024]; dbdata_type = check_args(argc, argv, US"dumpdb", US""); spool_directory = argv[1]; -dbm = dbfn_open(argv[2], O_RDONLY, &dbblock, FALSE); -if (dbm == NULL) exit(1); +if (!(dbm = dbfn_open(argv[2], O_RDONLY, &dbblock, FALSE))) + exit(1); /* Scan the file, formatting the information for each entry. Note that data is returned in a malloc'ed block, in order that it be correctly aligned. */ -key = dbfn_scan(dbm, TRUE, &cursor); -while (key != NULL) +for (key = dbfn_scan(dbm, TRUE, &cursor); + key; + key = dbfn_scan(dbm, FALSE, &cursor)) { dbdata_retry *retry; dbdata_wait *wait; @@ -547,9 +548,8 @@ while (key != NULL) return 1; } Ustrcpy(keybuffer, key); - value = dbfn_read_with_length(dbm, keybuffer, &length); - if (value == NULL) + if (!(value = dbfn_read_with_length(dbm, keybuffer, &length))) fprintf(stderr, "**** Entry \"%s\" was in the key scan, but the record " "was not found in the file - something is wrong!\n", CS keybuffer); @@ -669,7 +669,6 @@ while (key != NULL) } store_reset(value); } - key = dbfn_scan(dbm, FALSE, &cursor); } dbfn_close(dbm); @@ -776,8 +775,9 @@ for(;;) { int verify = 1; spool_directory = argv[1]; - dbm = dbfn_open(argv[2], O_RDWR, &dbblock, FALSE); - if (dbm == NULL) continue; + + if (!(dbm = dbfn_open(argv[2], O_RDWR, &dbblock, FALSE))) + continue; if (Ustrcmp(field, "d") == 0) { @@ -973,11 +973,10 @@ for(;;) /* Handle a read request, or verify after an update. */ spool_directory = argv[1]; - dbm = dbfn_open(argv[2], O_RDONLY, &dbblock, FALSE); - if (dbm == NULL) continue; + if (!(dbm = dbfn_open(argv[2], O_RDONLY, &dbblock, FALSE))) + continue; - record = dbfn_read_with_length(dbm, name, &oldlength); - if (record == NULL) + if (!(record = dbfn_read_with_length(dbm, name, &oldlength))) { printf("record %s not found\n", name); name[0] = 0; @@ -1160,8 +1159,8 @@ oldest = time(NULL) - maxkeep; printf("Tidying Exim hints database %s/db/%s\n", argv[1], argv[2]); spool_directory = argv[1]; -dbm = dbfn_open(argv[2], O_RDWR, &dbblock, FALSE); -if (dbm == NULL) exit(1); +if (!(dbm = dbfn_open(argv[2], O_RDWR, &dbblock, FALSE))) + exit(1); /* Prepare for building file names */ @@ -1174,14 +1173,14 @@ to the file while scanning it. Pity the man page doesn't warn you about that. Therefore, we scan and build a list of all the keys. Then we use that to read the records and possibly update them. */ -key = dbfn_scan(dbm, TRUE, &cursor); -while (key != NULL) +for (key = dbfn_scan(dbm, TRUE, &cursor); + key; + key = dbfn_scan(dbm, FALSE, &cursor)) { key_item *k = store_get(sizeof(key_item) + Ustrlen(key)); k->next = keychain; keychain = k; Ustrcpy(k->key, key); - key = dbfn_scan(dbm, FALSE, &cursor); } /* Now scan the collected keys and operate on the records, resetting @@ -1189,7 +1188,7 @@ the store each time round. */ reset_point = store_get(0); -while (keychain != NULL) +while (keychain) { dbdata_generic *value; diff --git a/src/src/transports/autoreply.c b/src/src/transports/autoreply.c index 4a3fe4714..ba6669b4d 100644 --- a/src/src/transports/autoreply.c +++ b/src/src/transports/autoreply.c @@ -346,33 +346,22 @@ else file_expand = ob->file_expand; return_message = ob->return_message; - if ((from != NULL && - (from = checkexpand(from, addr, tblock->name, cke_hdr)) == NULL) || - (reply_to != NULL && - (reply_to = checkexpand(reply_to, addr, tblock->name, cke_hdr)) == NULL) || - (to != NULL && - (to = checkexpand(to, addr, tblock->name, cke_hdr)) == NULL) || - (cc != NULL && - (cc = checkexpand(cc, addr, tblock->name, cke_hdr)) == NULL) || - (bcc != NULL && - (bcc = checkexpand(bcc, addr, tblock->name, cke_hdr)) == NULL) || - (subject != NULL && - (subject = checkexpand(subject, addr, tblock->name, cke_hdr)) == NULL) || - (headers != NULL && - (headers = checkexpand(headers, addr, tblock->name, cke_text)) == NULL) || - (text != NULL && - (text = checkexpand(text, addr, tblock->name, cke_text)) == NULL) || - (file != NULL && - (file = checkexpand(file, addr, tblock->name, cke_file)) == NULL) || - (logfile != NULL && - (logfile = checkexpand(logfile, addr, tblock->name, cke_file)) == NULL) || - (oncelog != NULL && - (oncelog = checkexpand(oncelog, addr, tblock->name, cke_file)) == NULL) || - (oncerepeat != NULL && - (oncerepeat = checkexpand(oncerepeat, addr, tblock->name, cke_file)) == NULL)) + if ( from && !(from = checkexpand(from, addr, tblock->name, cke_hdr)) + || reply_to && !(reply_to = checkexpand(reply_to, addr, tblock->name, cke_hdr)) + || to && !(to = checkexpand(to, addr, tblock->name, cke_hdr)) + || cc && !(cc = checkexpand(cc, addr, tblock->name, cke_hdr)) + || bcc && !(bcc = checkexpand(bcc, addr, tblock->name, cke_hdr)) + || subject && !(subject = checkexpand(subject, addr, tblock->name, cke_hdr)) + || headers && !(headers = checkexpand(headers, addr, tblock->name, cke_text)) + || text && !(text = checkexpand(text, addr, tblock->name, cke_text)) + || file && !(file = checkexpand(file, addr, tblock->name, cke_file)) + || logfile && !(logfile = checkexpand(logfile, addr, tblock->name, cke_file)) + || oncelog && !(oncelog = checkexpand(oncelog, addr, tblock->name, cke_file)) + || oncerepeat && !(oncerepeat = checkexpand(oncerepeat, addr, tblock->name, cke_file)) + ) return FALSE; - if (oncerepeat != NULL) + if (oncerepeat) { once_repeat_sec = readconf_readtime(oncerepeat, 0, FALSE); if (once_repeat_sec < 0) @@ -388,11 +377,11 @@ else /* If the never_mail option is set, we have to scan all the recipients and remove those that match. */ -if (ob->never_mail != NULL) +if (ob->never_mail) { const uschar *never_mail = expand_string(ob->never_mail); - if (never_mail == NULL) + if (!never_mail) { addr->transport_return = FAIL; addr->message = string_sprintf("Failed to expand \"%s\" for " @@ -400,11 +389,11 @@ if (ob->never_mail != NULL) return FALSE; } - if (to != NULL) check_never_mail(&to, never_mail); - if (cc != NULL) check_never_mail(&cc, never_mail); - if (bcc != NULL) check_never_mail(&bcc, never_mail); + if (to) check_never_mail(&to, never_mail); + if (cc) check_never_mail(&cc, never_mail); + if (bcc) check_never_mail(&bcc, never_mail); - if (to == NULL && cc == NULL && bcc == NULL) + if (!to && !cc && !bcc) { DEBUG(D_transport) debug_printf("*** all recipients removed by never_mail\n"); @@ -430,7 +419,7 @@ recipient, the effect might not be quite as envisaged. If once_file_size is set, instead of a dbm file, we use a regular file containing a circular buffer recipient cache. */ -if (oncelog != NULL && *oncelog != 0 && to != NULL) +if (oncelog && *oncelog != 0 && to) { time_t then = 0; @@ -438,7 +427,7 @@ if (oncelog != NULL && *oncelog != 0 && to != NULL) if (ob->once_file_size > 0) { - uschar *p; + uschar * p, * nextp; struct stat statbuf; cache_fd = Uopen(oncelog, O_CREAT|O_RDWR, ob->mode); @@ -475,18 +464,16 @@ if (oncelog != NULL && *oncelog != 0 && to != NULL) zero. If we find a match, put the time into "then", and the place where it was found into "cache_time". Otherwise, "then" is left at zero. */ - p = cache_buff; - while (p < cache_buff + cache_size) + for (p = cache_buff; p < cache_buff + cache_size; p = nextp) { uschar *s = p + sizeof(time_t); - uschar *nextp = s + Ustrlen(s) + 1; + nextp = s + Ustrlen(s) + 1; if (Ustrcmp(to, s) == 0) { memcpy(&then, p, sizeof(time_t)); cache_time = p; break; } - p = nextp; } } @@ -524,10 +511,9 @@ if (oncelog != NULL && *oncelog != 0 && to != NULL) can be abolished. */ if (EXIM_DATUM_SIZE(result_datum) == sizeof(time_t)) - { memcpy(&then, EXIM_DATUM_DATA(result_datum), sizeof(time_t)); - } - else then = now; + else + then = now; } } @@ -559,10 +545,10 @@ if (oncelog != NULL && *oncelog != 0 && to != NULL) /* We are going to send a message. Ensure any requested file is available. */ -if (file != NULL) +if (file) { ff = Ufopen(file, "rb"); - if (ff == NULL && !ob->file_optional) + if (!ff && !ob->file_optional) { addr->transport_return = DEFER; addr->message = string_sprintf("Failed to open file %s when sending " @@ -583,6 +569,7 @@ if (pid < 0) addr->message = string_sprintf("Failed to create child process to send " "message from %s transport: %s", tblock->name, strerror(errno)); DEBUG(D_transport) debug_printf("%s\n", addr->message); + if (dbm_file) EXIM_DBCLOSE(dbm_file); return FALSE; } @@ -592,20 +579,20 @@ are newlines in it which might, if placed earlier, screw up other headers. */ f = fdopen(fd, "wb"); -if (from != NULL) fprintf(f, "From: %s\n", from); -if (reply_to != NULL) fprintf(f, "Reply-To: %s\n", reply_to); -if (to != NULL) fprintf(f, "To: %s\n", to); -if (cc != NULL) fprintf(f, "Cc: %s\n", cc); -if (bcc != NULL) fprintf(f, "Bcc: %s\n", bcc); -if (subject != NULL) fprintf(f, "Subject: %s\n", subject); +if (from) fprintf(f, "From: %s\n", from); +if (reply_to) fprintf(f, "Reply-To: %s\n", reply_to); +if (to) fprintf(f, "To: %s\n", to); +if (cc) fprintf(f, "Cc: %s\n", cc); +if (bcc) fprintf(f, "Bcc: %s\n", bcc); +if (subject) fprintf(f, "Subject: %s\n", subject); /* Generate In-Reply-To from the message_id header; there should always be one, but code defensively. */ -for (h = header_list; h != NULL; h = h->next) +for (h = header_list; h; h = h->next) if (h->type == htype_id) break; -if (h != NULL) +if (h) { message_id = Ustrchr(h->text, ':') + 1; while (isspace(*message_id)) message_id++; @@ -615,12 +602,12 @@ if (h != NULL) /* Generate a References header if there is at least one of Message-ID:, References:, or In-Reply-To: (see RFC 2822). */ -for (h = header_list; h != NULL; h = h->next) +for (h = header_list; h; h = h->next) if (h->type != htype_old && strncmpic(US"References:", h->text, 11) == 0) break; -if (h == NULL) - for (h = header_list; h != NULL; h = h->next) +if (!h) + for (h = header_list; h; h = h->next) if (h->type != htype_old && strncmpic(US"In-Reply-To:", h->text, 12) == 0) break; @@ -629,10 +616,10 @@ limit, some systems do not like headers growing beyond recognition. Keep the first message ID for the thread root and the last few for the position inside the thread, up to a maximum of 12 altogether. */ -if (h != NULL || message_id != NULL) +if (h || message_id) { fprintf(f, "References:"); - if (h != NULL) + if (h) { uschar *s, *id, *error; uschar *referenced_ids[12]; @@ -656,8 +643,8 @@ if (h != NULL || message_id != NULL) /* The message id will have a newline on the end of it. */ - if (message_id != NULL) fprintf(f, " %s", message_id); - else fprintf(f, "\n"); + if (message_id) fprintf(f, " %s", message_id); + else fprintf(f, "\n"); } /* Add an Auto-Submitted: header */ @@ -666,16 +653,16 @@ fprintf(f, "Auto-Submitted: auto-replied\n"); /* Add any specially requested headers */ -if (headers != NULL) fprintf(f, "%s\n", headers); +if (headers) fprintf(f, "%s\n", headers); fprintf(f, "\n"); -if (text != NULL) +if (text) { fprintf(f, "%s", CS text); if (text[Ustrlen(text)-1] != '\n') fprintf(f, "\n"); } -if (ff != NULL) +if (ff) { while (Ufgets(big_buffer, big_buffer_size, ff) != NULL) { @@ -684,11 +671,11 @@ if (ff != NULL) uschar *s = expand_string(big_buffer); DEBUG(D_transport) { - if (s == NULL) + if (!s) debug_printf("error while expanding line from file:\n %s\n %s\n", big_buffer, expand_string_message); } - fprintf(f, "%s", (s == NULL)? CS big_buffer : CS s); + fprintf(f, "%s", s ? CS s : CS big_buffer); } else fprintf(f, "%s", CS big_buffer); } @@ -807,7 +794,6 @@ try will skip, of course. However, if there were no recipients in the message, we do not fail. */ if (rc != 0) - { if (rc == EXIT_NORECIPIENTS) { DEBUG(D_any) debug_printf("%s transport: message contained no recipients\n", @@ -820,7 +806,6 @@ if (rc != 0) "transport (%d)", tblock->name, rc); goto END_OFF; } - } /* Log the sending of the message if successful and required. If the file fails to open, it's hard to know what to do. We cannot write to the Exim @@ -831,7 +816,7 @@ file opened for appending, in order to avoid interleaving of output from different processes. The log_buffer can be used exactly as for main log writing. */ -if (logfile != NULL) +if (logfile) { int log_fd = Uopen(logfile, O_WRONLY|O_APPEND|O_CREAT, ob->mode); if (log_fd >= 0) @@ -840,37 +825,37 @@ if (logfile != NULL) DEBUG(D_transport) debug_printf("logging message details\n"); sprintf(CS ptr, "%s\n", tod_stamp(tod_log)); while(*ptr) ptr++; - if (from != NULL) + if (from) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " From: %s\n", from); while(*ptr) ptr++; } - if (to != NULL) + if (to) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " To: %s\n", to); while(*ptr) ptr++; } - if (cc != NULL) + if (cc) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " Cc: %s\n", cc); while(*ptr) ptr++; } - if (bcc != NULL) + if (bcc) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " Bcc: %s\n", bcc); while(*ptr) ptr++; } - if (subject != NULL) + if (subject) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " Subject: %s\n", subject); while(*ptr) ptr++; } - if (headers != NULL) + if (headers) { (void)string_format(ptr, LOG_BUFFER_SIZE - (ptr-log_buffer), " %s\n", headers); diff --git a/test/runtest b/test/runtest index 373043c4d..0e7e8ee0b 100755 --- a/test/runtest +++ b/test/runtest @@ -1106,6 +1106,10 @@ RESET_AFTER_EXTRA_LINE_READ: next if /^(ppppp )?setsockopt FASTOPEN: Protocol not available$/; + # Specific pointer values reported for DB operations change from run to run + s/^(returned from EXIM_DBOPEN: 0x)[0-9a-f]+/$1AAAAAAAA/; + s/^(EXIM_DBCLOSE.0x)[0-9a-f]+/$1AAAAAAAA/; + # When Exim is checking the size of directories for maildir, it uses # the check_dir_size() function to scan directories. Of course, the order # of the files that are obtained using readdir() varies from system to diff --git a/test/stderr/0275 b/test/stderr/0275 index 5f76af09a..089dc2a8b 100644 --- a/test/stderr/0275 +++ b/test/stderr/0275 @@ -198,9 +198,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -307,8 +308,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 diff --git a/test/stderr/0278 b/test/stderr/0278 index 2d9967293..b7c7913df 100644 --- a/test/stderr/0278 +++ b/test/stderr/0278 @@ -145,9 +145,10 @@ Delivery address list: CALLER@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: CALLER@test.ex @@ -209,8 +210,9 @@ search_tidyup called --------> CALLER@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to CALLER transport=t1 diff --git a/test/stderr/0361 b/test/stderr/0361 index 2506e1cfb..4d3bb363b 100644 --- a/test/stderr/0361 +++ b/test/stderr/0361 @@ -86,8 +86,9 @@ Delivery address list: kilos@recurse.test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: kilos@recurse.test.ex @@ -122,8 +123,9 @@ rewrite_one_header: type=F: re-routed to kilos@recurse.test.ex.test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: kilos@recurse.test.ex.test.ex @@ -161,8 +163,9 @@ routed by r3 router transport: locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: kilos@recurse.test.ex.test.ex @@ -209,8 +212,9 @@ search_tidyup called --------> kilos@recurse.test.ex.test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to kilos transport=t2 diff --git a/test/stderr/0386 b/test/stderr/0386 index 6fb8a5536..5573a9964 100644 --- a/test/stderr/0386 +++ b/test/stderr/0386 @@ -252,9 +252,10 @@ Delivery address list: 2@b locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: 2@b @@ -289,8 +290,9 @@ search_tidyup called --------> 2@b <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to 2 <2@b> transport=t1 @@ -434,8 +436,9 @@ Delivery address list: 2@b locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: 2@b @@ -470,8 +473,9 @@ search_tidyup called --------> 2@b <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to 2 <2@b> transport=t1 diff --git a/test/stderr/0388 b/test/stderr/0388 index 92b3f23e1..5a21445c9 100644 --- a/test/stderr/0388 +++ b/test/stderr/0388 @@ -9,9 +9,10 @@ set_process_info: pppp delivering specified messages set_process_info: pppp delivering 10HmaX-0005vi-00 locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: x@y @@ -76,8 +77,9 @@ set_process_info: pppp delivering 10HmaX-0005vi-00 using smtp checking status of 127.0.0.1 locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available 127.0.0.1 in serialize_hosts? no (option unset) set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (x@y) @@ -107,8 +109,9 @@ address match test: subject=*@127.0.0.1 pattern=* checking status of V4NET.0.0.0 locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available V4NET.0.0.0 in serialize_hosts? no (option unset) set_process_info: pppp delivering 10HmaX-0005vi-00 to V4NET.0.0.0 [V4NET.0.0.0] (x@y) @@ -137,8 +140,8 @@ Deferred addresses: x@y locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDWR address match test: subject=x@y pattern=* y in "*"? yes (matched "*") @@ -164,6 +167,7 @@ dbfn_write: key=T:V4NET.0.0.0:V4NET.0.0.0:1224 timed out: all retries expired LOG: MAIN ** x@y: retry timeout exceeded +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile end of retry processing exec TESTSUITE/eximdir/exim -DEXIM_PATH=TESTSUITE/eximdir/exim -C TESTSUITE/test-config -d=0xebb95ced -odi -odi -t -oem -oi -f <> -E10HmaX-0005vi-00 @@ -236,8 +240,8 @@ set_process_info: pppp delivering specified messages set_process_info: pppp delivering 10HmaY-0005vi-00 locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDONLY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: CALLER@myhost.test.ex @@ -248,6 +252,7 @@ dbfn_read: key=R:CALLER@myhost.test.ex:<> no domain retry record no address retry record CALLER@myhost.test.ex: queued for routing +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> routing CALLER@myhost.test.ex diff --git a/test/stderr/0398 b/test/stderr/0398 index b975ad05a..f61f37457 100644 --- a/test/stderr/0398 +++ b/test/stderr/0398 @@ -120,13 +120,14 @@ routed by r2 router Attempting full verification using callout locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR dbfn_read: key=remote callout cache: found domain record for remote dbfn_read: key=qq@remote callout cache: no address record found for qq@remote +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile interface=NULL port=1224 Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected @@ -150,14 +151,15 @@ cmd buf flush ddd bytes SMTP(close)>> locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x42 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR|O_CREAT dbfn_write: key=remote wrote callout cache domain record for remote: result=1 postmaster=0 random=0 dbfn_write: key=qq@remote wrote negative callout cache address record for qq@remote +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile ----------- end verify ------------ l_message: $acl_verify_message @@ -231,14 +233,15 @@ routed by r2 router Attempting full verification using callout locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR dbfn_read: key=remote callout cache: found domain record for remote dbfn_read: key=qq@remote callout cache: found address record for qq@remote callout cache: address record is negative +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile ----------- end verify ------------ l_message: $acl_verify_message diff --git a/test/stderr/0402 b/test/stderr/0402 index 7f301651b..8d62a2ef5 100644 --- a/test/stderr/0402 +++ b/test/stderr/0402 @@ -221,9 +221,10 @@ Delivery address list: rd+usery@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: CALLER@test.ex @@ -416,8 +417,9 @@ routed by r1 router transport: t1 locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: TESTSUITE/test-mail/junk @@ -443,8 +445,9 @@ search_tidyup called --------> TESTSUITE/test-mail/junk <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available ┌considering: /non-exist/$local_part ├──expanding: /non-exist/$local_part @@ -502,8 +505,9 @@ LOG: MAIN --------> TESTSUITE/test-mail/junk <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to TESTSUITE/test-mail/junk transport=ft1 @@ -558,8 +562,9 @@ LOG: MAIN --------> CALLER@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to CALLER transport=t1 @@ -583,8 +588,9 @@ LOG: MAIN --------> usery@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available ┌considering: /non-exist/$local_part ├──expanding: /non-exist/$local_part @@ -611,8 +617,9 @@ LOG: MAIN --------> userz@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available ┌considering: /$local_part ├──expanding: /$local_part diff --git a/test/stderr/0403 b/test/stderr/0403 index 716cabdf2..a77d8cd98 100644 --- a/test/stderr/0403 +++ b/test/stderr/0403 @@ -74,9 +74,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -137,8 +138,9 @@ routed by r1 router transport: locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: TESTSUITE/test-mail/junk @@ -156,8 +158,9 @@ search_tidyup called --------> TESTSUITE/test-mail/junk <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to TESTSUITE/test-mail/junk transport=t1 diff --git a/test/stderr/0404 b/test/stderr/0404 index 3b7605ba7..1718307be 100644 --- a/test/stderr/0404 +++ b/test/stderr/0404 @@ -177,9 +177,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -220,8 +221,9 @@ routed by r2 router transport: locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: >sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex, ... @@ -239,8 +241,9 @@ search_tidyup called --------> >sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex, ... <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to >sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex, ... <>sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex,sender@test.ex, ...> transport=t1 @@ -3375,8 +3378,9 @@ Delivery address list: sender@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: sender@test.ex @@ -17981,8 +17985,9 @@ sender@test.ex is a duplicate address: discarded --------> sender@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to sender transport=t2 diff --git a/test/stderr/0408 b/test/stderr/0408 index 9cdb41d96..fddbe4a46 100644 --- a/test/stderr/0408 +++ b/test/stderr/0408 @@ -74,9 +74,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -138,8 +139,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 diff --git a/test/stderr/0432 b/test/stderr/0432 index 6ac5a0428..79117e25a 100644 --- a/test/stderr/0432 +++ b/test/stderr/0432 @@ -81,13 +81,14 @@ get[host|ipnode]byname[2] looked up these IP addresses: Attempting full verification using callout locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR dbfn_read: key=y callout cache: no domain record found for y dbfn_read: key=x@y callout cache: no address record found for x@y +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile interface=NULL port=1224 Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected @@ -111,14 +112,15 @@ cmd buf flush ddd bytes SMTP(close)>> locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x42 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR|O_CREAT dbfn_write: key=y wrote callout cache domain record for y: result=1 postmaster=0 random=0 dbfn_write: key=x@y wrote positive callout cache address record for x@y +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile ----------- end verify ------------ sender x@y verified ok @@ -189,14 +191,15 @@ get[host|ipnode]byname[2] looked up these IP addresses: Attempting full verification using callout locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/callout) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/callout: flags=O_RDWR dbfn_read: key=y callout cache: found domain record for y dbfn_read: key=x@y callout cache: found address record for x@y callout cache: address record is positive +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile ----------- end verify ------------ sender x@y verified ok diff --git a/test/stderr/0487 b/test/stderr/0487 index 70da61fff..56e21b60e 100644 --- a/test/stderr/0487 +++ b/test/stderr/0487 @@ -103,9 +103,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -140,8 +141,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 diff --git a/test/stderr/2600 b/test/stderr/2600 index 599be797a..ffdad152f 100644 --- a/test/stderr/2600 +++ b/test/stderr/2600 @@ -362,9 +362,10 @@ Delivery address list: userx@myhost.test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@myhost.test.ex @@ -409,8 +410,9 @@ search_tidyup called --------> userx@myhost.test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 diff --git a/test/stderr/5004 b/test/stderr/5004 index bedf5be2e..08b4c9784 100644 --- a/test/stderr/5004 +++ b/test/stderr/5004 @@ -78,9 +78,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -116,8 +117,9 @@ routed by r1 router transport: locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: TESTSUITE/test-mail @@ -135,8 +137,9 @@ search_tidyup called --------> TESTSUITE/test-mail <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to TESTSUITE/test-mail transport=t1 diff --git a/test/stderr/5005 b/test/stderr/5005 index a68bc11c9..7e6ea98b2 100644 --- a/test/stderr/5005 +++ b/test/stderr/5005 @@ -74,9 +74,10 @@ Delivery address list: nofile@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: nofile@test.ex @@ -111,8 +112,9 @@ search_tidyup called --------> nofile@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to nofile transport=t1 @@ -263,8 +265,9 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -299,8 +302,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 @@ -453,8 +457,9 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -489,8 +494,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 @@ -547,8 +553,8 @@ Deferred addresses: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDWR address match test: subject=userx@test.ex pattern=* test.ex in "*"? yes (matched "*") @@ -560,6 +566,7 @@ Writing retry data for T:userx@test.ex first failed=dddd last try=dddd next try=+86400 expired=0 errno=-22 more_errno=dd mailbox is full (MTA-imposed quota exceeded while writing to tmp/MAILDIR.myhost.test.ex) dbfn_write: key=T:userx@test.ex +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile end of retry processing delivery deferred: update_spool=1 header_rewritten=0 @@ -651,8 +658,8 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDONLY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -663,6 +670,7 @@ dbfn_read: key=R:userx@test.ex: no domain retry record no address retry record userx@test.ex: queued for routing +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> routing userx@test.ex @@ -691,12 +699,13 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDONLY dbfn_read: key=T:userx@test.ex retry record exists: age=ttt (max 1w) time to retry = tttt expired = 0 +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile search_tidyup called changed uid/gid: local delivery to userx transport=t1 @@ -740,8 +749,8 @@ Deferred addresses: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x2 +returned from EXIM_DBOPEN: 0xAAAAAAAA opened hints database TESTSUITE/spool/db/retry: flags=O_RDWR address match test: subject=userx@test.ex pattern=* test.ex in "*"? yes (matched "*") @@ -753,6 +762,7 @@ Writing retry data for T:userx@test.ex first failed=dddd last try=dddd next try=+86400 expired=0 errno=-22 more_errno=dd mailbox is full (MTA-imposed quota exceeded while writing to tmp/MAILDIR.myhost.test.ex) dbfn_write: key=T:userx@test.ex +EXIM_DBCLOSE(0xAAAAAAAA) closed hints database and lockfile end of retry processing delivery deferred: update_spool=1 header_rewritten=0 diff --git a/test/stderr/5006 b/test/stderr/5006 index 771f5fd56..e494f83b5 100644 --- a/test/stderr/5006 +++ b/test/stderr/5006 @@ -74,9 +74,10 @@ Delivery address list: userx@test.ex locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) ensuring TESTSUITE/spool/db/retry.lockfile is owned by exim +failed to open DB file TESTSUITE/spool/db/retry.lockfile: No such file or directory no retry data available >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering: userx@test.ex @@ -111,8 +112,9 @@ search_tidyup called --------> userx@test.ex <-------- locking TESTSUITE/spool/db/retry.lockfile locked TESTSUITE/spool/db/retry.lockfile -EXIM_DBOPEN(TESTSUITE/spool/db/retry) -returned from EXIM_DBOPEN +EXIM_DBOPEN: file dir flags 0x0 +returned from EXIM_DBOPEN: (nil) +failed to open DB file TESTSUITE/spool/db/retry: No such file or directory no retry data available search_tidyup called changed uid/gid: local delivery to userx transport=t1 -- 2.30.2