summaryrefslogtreecommitdiffabout
path: root/src/bi_db.m4
Side-by-side diff
Diffstat (limited to 'src/bi_db.m4') (more/less context) (ignore whitespace changes)
-rw-r--r--src/bi_db.m415
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index bb0b9f4..f366008 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -1,8 +1,8 @@
-/* This file is part of mailfromd. -*- c -*-
- Copyright (C) 2006, 2007 Sergey Poznyakoff
+/* This file is part of Mailfromd. -*- c -*-
+ Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
@@ -134,13 +134,13 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null)
MU_DATUM_SIZE(key)++;
rc = mu_dbm_delete(&db, key);
mu_dbm_close(&db);
MF_ASSERT(rc == 0,
mf_dbfailure,
_("Failed to delete data `%s' from `%s': %s"),
- key,
+ keystr,
dbname,
mu_dbm_strerror());
}
END
@@ -235,15 +235,16 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
debug1(20, "greylist record for %s expired",
email);
if (!readonly) {
memcpy(MU_DATUM_PTR(contents),
&now, sizeof now);
if (mu_dbm_insert(&db, key, contents, 1))
- mu_error(_("Cannot insert datum `%s' in "
+ mu_error(_("Cannot insert datum `%-.*s' in "
"greylist database %s: %s"),
- key,
+ MU_DATUM_SIZE(key),
+ (char*)MU_DATUM_PTR(key),
greylist_format->dbname,
mu_dbm_strerror());
} else
debug(20, "database opened in readonly mode: "
"not updating");
rc = 1;
@@ -256,15 +257,15 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
} else if (!readonly) {
debug1(20, "greylisting %s", email);
MF_VAR_REF(greylist_seconds_left, interval);
MU_DATUM_PTR(contents) = (void*)&now;
MU_DATUM_SIZE(contents) = sizeof now;
if (mu_dbm_insert(&db, key, contents, 1))
- mu_error(_("Cannot insert datum `%s' in greylist "
+ mu_error(_("Cannot insert datum `%-.*s' in greylist "
"database %s: %s"),
- key,
+ MU_DATUM_SIZE(key), (char*)MU_DATUM_PTR(key),
greylist_format->dbname,
mu_dbm_strerror());
rc = 1;
} else
rc = 0;

Return to:

Send suggestions and report system problems to the System administrator.